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
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
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
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