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

Topics - vrazumijin

#1
Hello

So, there is a room with a rooster. If the main character talks to the rooster, the game should run one dialog
If the main character gives coffe to the rooster and talks to the rooster, the game should run another dialog
If the main character gives coffe to the rooster again and talks to the rooster, the game should run a third dialog.

For that, first i create a global variable (varGALLOCAFE) with value 1
Then, in the global script, I declare the variable and write two functions, one to use the inventory object on the character cGallo and another to talk to the character cGallo.

Like this

Code: AGS
int varGALLOCAFE = 1;

function cGallo_Talk(Character *theCharacter, CursorMode mode) {
   if (varGALLOCAFE == 1) { 
      dGallo1.Start();
      varGALLO=2; 
      }
  
   if(varGALLOCAFE == 2) {
      dGallo2.Start();
      varGALLO=3;
      }

   if (varGALLOCAFE == 3)  {
       dGallo3.Start();
       }
}

function cGallo_UseInv(Character *theCharacter, CursorMode mode) {
        if (cEgo.ActiveInventory == iCafetera) {
            if (varGALLOCAFE==1) {   
                SetTimer(2, 300);
                cGallo.Walk(800, 900, eBlock, eWalkableAreas); 
                cEgo.Walk(870, 900, eBlock, eWalkableAreas); 
                varGALLO=2;
                }
            if ((varGALLOCAFE==2) && IsTimerExpired(20))  { 
                SetTimer(2, 300);
                cGallo.Walk(800, 900, eBlock, eWalkableAreas); 
                cEgo.Walk(870, 900, eBlock, eWalkableAreas); 
                varGALLO=3;
                }
            if ((varGALLOCAFE==3) && IsTimerExpired(20)) { 
                cEgo.Say("Creo que ya es suficiente");
                 }
}

And it doesn't work, when the main character first give coffe to the rooster, they move to the expected place, but the first dialog remains the one that appears.

Can someone explain what I'm doing wrong?
thanks
#2
I don`t know why, but the last choice of all my dialogs is not clickable, and, as you can see in the picture below, doesn´t react when the mouse is over

https://ibb.co/ykBPDH5

Can someone help?
#3
Hello. Can someone explain me why this works

Code: ags
function room_AfterFadeIn() {

   cGallo.Walk(1000, 1020,  eBlock); 
   cGallo.Walk(400, 1020,  eBlock); 
   cGallo.Walk(1000, 1020,  eBlock); 
   cGallo.Walk(400, 1020,  eBlock); 
   cGallo.Walk(1000, 1020,  eBlock); 
   cGallo.Walk(400, 1020,  eBlock); 
}

but this doesn't?


Code: ags
function room_AfterFadeIn() {

   cGallo.Walk(1000, 1020,  eNoBlock); 
   cGallo.Walk(400, 1020,  eNoBlock); 
   cGallo.Walk(1000, 1020,  eNoBlock); 
   cGallo.Walk(400, 1020,  eNoBlock); 
   cGallo.Walk(1000, 1020,  eNoBlock); 
   cGallo.Walk(400, 1020,  eNoBlock); 
}

in this second version, the character just walks directly to the final point, how can I get a character to execute multiple walk commands without stoping the main action?

thanks
#4
Hello

Im trying to make my character change room after entering for the first time, seen a text displayed and wait for, lets say 4 seconds. I do it like this

Code: ags

// room script file

function room_FirstLoad()
{
Overlay.CreateTextual(20,133,0, Game.SpeechFont, 15,"El 28 de julio de 1914,despues de siglos de tensiones, estalla una gran guerra en Europa.");  
SetTimer(1,160);
if (IsTimerExpired(1)) {
player.ChangeRoom(2);
}

}





It builts, but just never changes to room 2.

I cant see what I'm doing wrong, could someone help please?
SMF spam blocked by CleanTalk