Hello all.Ã, I am doing a 'stealth' screen where the player needs to sneak by a guard.Ã, The are where the guard can't see the player is a region.Ã, On this region, the player needs to sneak to get by.Ã, Walking will be too loud.Ã, To do this, I have the following code:
GlobalInt 10 is the mode for walking.Ã, 1=Walk, 2=Sneak
GlobalInt 11 is the 'how many steps taken' variable.
-----------------
if ((character[8].walking != 0) && (GetGlobalInt(10)==1)){ //If in walking mode and moving on region
SetGlobalInt(11, 1);
if (GetGlobalInt(11)==1){
Display("The sentry suddenly appears alert, as if searching the darkness of the sewers.");
DisplaySpeech(1, "What was that?");
StopMoving(8);
SetGlobalInt(11, 2);
}
if (GetGlobalInt(11)==2){
Display("Your footstep again splashes in the sewage.Ã, You see the sentry put his hand to his dagger as he continues to peer into the darkness.");
StopMoving(8);
SetGlobalInt(11, 3);
}
if (GetGlobalInt(11)==3){
DisplaySpeech(1, "AHA!");
Display("The sentry finally sees you in the dimness and throws his dagger.Ã, You are dead before you hit the ground.Ã, You should've been more quiet.");
NewRoom(916);
}
}
The problem is that nothing happens.Ã, The character can walk around on the region with no consequences.
GlobalInt 10 is the mode for walking.Ã, 1=Walk, 2=Sneak
GlobalInt 11 is the 'how many steps taken' variable.
-----------------
if ((character[8].walking != 0) && (GetGlobalInt(10)==1)){ //If in walking mode and moving on region
SetGlobalInt(11, 1);
if (GetGlobalInt(11)==1){
Display("The sentry suddenly appears alert, as if searching the darkness of the sewers.");
DisplaySpeech(1, "What was that?");
StopMoving(8);
SetGlobalInt(11, 2);
}
if (GetGlobalInt(11)==2){
Display("Your footstep again splashes in the sewage.Ã, You see the sentry put his hand to his dagger as he continues to peer into the darkness.");
StopMoving(8);
SetGlobalInt(11, 3);
}
if (GetGlobalInt(11)==3){
DisplaySpeech(1, "AHA!");
Display("The sentry finally sees you in the dimness and throws his dagger.Ã, You are dead before you hit the ground.Ã, You should've been more quiet.");
NewRoom(916);
}
}
The problem is that nothing happens.Ã, The character can walk around on the region with no consequences.