Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Ardentsideburns

#1
hey peeps! i 'm having a problem and i don't exactly know if there's an actual solution to it, i've looked everywhere but i can't really find a way to solve the problem.

so basically our game has plenty of animations, so to keep everything on the same axis and to allow enough space to do wildly different animations we had like every frame take about 200x200 pixels of space.

now the actual character size is about a third of that of course, the rest of it is composed of transparent pixels. This wouldn't be a big deal if it wasn't that when the character speaks the text is shown at the top of the 200x200 frame instead of on top of the character's head, making the text appear miles above the character.

is there a way for ags to ignore the transparent pixels when it comes to showing text?

thanks for your help in advance!
#2
YES! thank you so much cassiebsg and gurok, that was it! now it works! to be perfectly clear i did create it on the project explorer, but earlier in the project i thought i had to include it into the script too , that's why i wrote it there . But for some reason, now that i removed that line the character does recognize if the variable is true of false it seems!
#3
i'm sorry if i'm not being clear... i'm really a super beginner in scripting and i always had trouble finding the logic behind code...

and yes, that particular exchange is one time only, if you give him the painkillers without the variable set to true you won't get that particular message ever again.As i said there are other places in the game where the variable can be switched to true, and even if you never get that particular exchange it's fine.

anyways i did the check as you suggested, i'll attach it here:

#4
i noticed something while experimenting with various options, if i change

Code: ags
        if (necroknowlbasic==true)
        {


to
Code: ags
        if (necroknowlbasic==false)
        {


it always goes to the shorter option (the one right after  if (necroknowlbasic==true) ) instead of always going for the longer one. again, this is completely independent to which state the necroknowlbasic variable is on at that moment...
#5
QuoteThis line is useless necroknowlbasic = true ; where it is. Since you can only give the painkillers once, your next if/else  necroknowlbasic = true ;  will only run once, and will run the false statement if it's false, and the true if it's true, as in you turned it on someplace else in the script before you give the painkillers to the npc.

i'm not sure if i understand , but from what you said it sounds like it should work like i intended: if the player meets the npc and the variable hasn't turned true yet, this encounter will switch it to true, and if he doesn't encounter the npc and give him the item the variable still won't be true, and it will remain false. did i understand what you said wrong?

anyways, still trying to make this work but without success. i really don't get why in every other single instance when this happen it works like a charm, but in this particular case it doesn't.

like, this is another example, this happens in a dialogue after you reply to a character about the topic the necroknowlbasic  variable affects. It works perfectly.

Code: ags


NPC: dialogue

 if (necroknowlbasic==true) {
  player.Say("dialogue"); }
   else {
      player.Say("dialogue");
      NPC.Say("dialogue");
      player.Say("dialogue");
      NPC.Say("dialogue");
      player.Say("dialogue");

      
      necroknowlbasic=true;
     }
#6
oh, nevermind about the extra text on the item  thing, i realized i put one bracket too much in an attempt to see what was wrong with the script. Now i fixed it, (by removing the bracket before if(necroknowlbasic==true) and adding one at the end) but the problem about having the npc saying different things depending on the state of the variable necroknowlbasic still remains....
#7
well i created it using the global variables section of the project explorer. And i did the search and it appears well, every time i need to change it from false to true. there's many occasions for the player to change it to true, and it's supposed to stay that way.

and oh you're right!! when i tried giving him another item , and when i do the dialogue for the false state of the variable pops off. That must be it and it's absolutely not intended...the text in this section should only show up when the painkiller is given to the npc... can you guys help with this ? i can't figure what i did wrong...
#8
QuotePlease include the whole thing -- everything you stripped out and replaced with comments.

sure, if it helps.

Code: ags
      

 // GIVE TO
  else if (UsedAction(eGA_GiveTo)) {
    
    if (ItemGiven == ipainkillers) {
 
        player.Say("buh."); 
          protagonist.LoseInventory(ipainkillers);
          Oberon.LockView(120);
          Oberon.Animate(0, 10, eOnce, eBlock );
          Wait(20);
          Oberon.LockView(116);
          Oberon.Animate(0, 10, eOnce, eBlock );
          Oberon.ChangeView(122);
          Oberon.SpeechView=121;
           cChar1.ChangeRoom (16, 150, 165);
        cChar2.ChangeRoom (16, 400, 170);
        cChar1.LockView(52);
        cChar2.LockView(123);
        cChar2.IgnoreWalkbehinds = true;
        cChar1.IgnoreWalkbehinds = true;
        cChar2.IgnoreWalkbehinds = true;
        cChar1.ManualScaling = true;
        cChar2.ManualScaling = true;
        cChar1.Transparency=0;
        cChar2.Transparency=50;
        cChar1.LockView(52);
        player.Say("blluh?"); 
        cChar1.Transparency=50;
        cChar2.Transparency=0;
        cChar2.LockView(4);
        Oberon.Say("bler.");
        cChar2.LockView(110);
        Oberon.Say("blah.");
        Oberon.Say("bluhh");
        }
        
         if (necroknowlbasic==true) {
           cChar1.Transparency=0;
        cChar2.Transparency=50;
        cChar1.LockView(52);
        player.Say("blahblah");
        cChar1.Transparency=50;
        cChar2.Transparency=0;
        cChar2.LockView(4);
        Oberon.Say("bleh!");
        oberonmet = true ;
        }
        
        else {
        cChar1.Transparency=0;
        cChar2.Transparency=50;
        cChar1.LockView(53);
        player.Say("blar");
        cChar1.UnlockView();
        cChar1.Transparency=50;
        cChar2.Transparency=0;
        Oberon.Say("bluh");
                    cChar1.Transparency=0;
                   cChar2.Transparency=50;
        player.Say("blah");
                 cChar1.Transparency=50;
                 cChar2.Transparency=0;
        Oberon.Say("blah ");
        Oberon.Say("bluh");
                   cChar1.Transparency=0;
                   cChar2.Transparency=50;
       player.Say("the demons?");
                    cChar1.Transparency=50;
                    cChar2.Transparency=0;
       Oberon.Say("bluh");
       Oberon.Say("blah ");
                     cChar1.Transparency=0;
                     cChar2.Transparency=50;
       player.Say("bluhbluh");
       player.Say("bluuhh");
         cChar1.Transparency=50;
        cChar2.Transparency=0;
        cChar2.LockView(4);
        Oberon.Say("bleeh");
        oberonmet = true ;
        necroknowlbasic = true ;
        }
   
    }
#9
Quoteis "variable" a global variable ?

yep! and so is charactermet
#10
hey guys, i'm using the monkey island template and i have this bool global variable that is by default set on false and can get turned to true by some npcs, changing their dialogue accordingly
it works fairly well for everything except for this one character that you can't normally talk to, but if you give it an item he starts a little conversation (not in a dialogue, at least at first, just back and forth messaging between player and npc). Thing is he should react accordingly if the global variable is set to true or false, but it only ever picks the option tied to "false" and doesn't seem to react to the variable changing.

i attached the script i have stripped of all the animation and dialogue stuff, but if you think it's not enough to figure out what's wrong i can include the whole thing.

the variable in question is called here "variable" the "charactermet" global variable is used to check if you met the character already, i included it just because it's the only other variable in the script.

thanks in advance for your help people!

Code: ags
 
   // GIVE TO
  else if (UsedAction(eGA_GiveTo)) {
    
    if (ItemGiven == iitem) {
          
        //dialogue & animation stuff 

        }
        
         if (variable==true) {
      
        //dialogue & animation stuff 

        charactermet = true ;
        }
        
        else {
        
        //different dialogue & animation stuff 

        charactermet = true ;
        variable = true ;
        }
   
    }

#11
just out of curiosity, i tried  setting a variable from false to true inside a dialog option and when checking for it again having a if function to redirect to another part of the dialog script within the same option. It looked like the system was fine with checking functions set outside the dialog, but that particular one seemed to remain false no matter how i wrote in the option that it was true. In the end i worked around it by simply turning off the option once it was selected (wich is something should've done from the beginning) but that made me think about if what i attempted to do is even possible and if i should be careful not to try that again, if it's not.
#12
Anyways, i dug a bit in the forums and found a post containing a solution; this post has exactly what i needed for this to work :
http://www.adventuregamestudio.co.uk/forums/index.php?topic=12434.msg157183#msg157183
#13
i tried, but nothing seems to happen. it seems that repexec isn't really capable of starting a timer for some reason..?
#14
so my intention here is to have to characters have a dialogue in the background while the character passes them by, i thought it would be something somewhat simple but boy was i wrong..
so here the code i wrote...

Code: ags
function room_Load()
{
Turquoise.Name=("Fancy lady"); 
Alberich.Name=("Nervous guy"); 


 if (loop==0){
  SetTimer(1, 10);
   }
 if (loop==1){
  SetTimer(2, 10);
   }
   
  if (loop==2){
  SetTimer(3, 10);
   }
}


function room_RepExec()
{
  if(IsTimerExpired(1)){
  Turquoise.LockView(66);
  Alberich.LockView(8);
  Turquoise.Animate(0, 4, eRepeat, eNoBlock );
  Alberich.Animate(0, 1, eRepeat, eNoBlock );
  Turquoise.SayBackground("psst psst psst");
  loop++;
  }
 if(IsTimerExpired(2)){
  Turquoise.LockView(18);
  Alberich.LockView(12);
  Alberich.Animate(0, 1, eRepeat, eNoBlock );
  Turquoise.Animate(0, 4, eRepeat, eNoBlock );
  Alberich.SayBackground("whisper whisper whisper");
  loop++;
  }
if(IsTimerExpired(3)){
        Turquoise.LockView(66);
        Alberich.LockView(8);
        Alberich.Animate(0, 1, eRepeat, eNoBlock );
        Turquoise.Animate(0, 4, eRepeat, eNoBlock );
        Turquoise.SayBackground("mumble mumble mumble");
        loop--;
        loop--;
        }

}


ugh, what am i not getting? the code advances only when i exit and the re enter the room, so it is recognizing the timer and the loop variable, but i don't understand why it doesn't continuously check if the timers have expired... to make it clear, the characters execute the first part of the script (the psst psst psst part) then stop ,locked in the animation i set for them .When i exit and reenter the room they move forward with the second part of the script (the whisper whisper whisper part) and so on and so forth looping back to the first part when the loop variable gets reset to 0. What i want is that this whole script is executed continuosly in the background at regular intervals set by the timers... anyone can help me , please? i'm really stumped...
#15
amazing! it worked like a charm! thank you so much crimson wizard! you really hold true to your nickname X3
#16
it's tied to a talk action in the monkey island-style premade script, should i post a bigger portion of the code?
#17
so , i tried applying crimson wizards's code  , but the script just jumps on the actions after it without doing what i wrote in the braces...
i'll post what i'm trying to do:
Code: ags
       if (aibell.Frame == Game.GetFrameCountForLoop(75, 0) - 1)
       {
      aibell.LockView(11);
          aibell.Animate(0, 20, eOnce, eBlock );
  }


what am i doing wrong..? :~(
#18
so.. i have this girl jumping around on a loop and when my  main character talks to her i'd like for her to stop and assume her normal view with an animation.
i thought of using character.animating , but the example on the faq doesn't really explain how to check if an animation has finished, only if an animation is currently playing...

can anyone guide me to the solution? :X
#19
thanks guys, using your advices i managed to solve the problem! :-D
#20
i'm doing a little project to see if i can manage to make a short adventure game by myself. I'm an absolute beginner in regards of ags and programming, but i think i'm figuring things out little by little . I'm using the lucasarts template for my game and since the game has a small resolution i'd like to have some close ups of the characters when they talk, in addition to their normal lucasarts-like talking animation.

i thought of using a custom gui wirh two buttons  that would act as the characters portraits but i'm having a hard time understanding the help files and i don't really know how to change the button graphics dynamically to represent the characters talking nor how to have them animate when each character is talking.



(this is what i got so far using the custom gui..too bad it's room sensitive and i have no idea on how to do it for different characters..)


how would you tackle this problem?
SMF spam blocked by CleanTalk