Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: mport2004 on Sat 08/10/2005 23:13:43

Title: Is there a If player is not command
Post by: mport2004 on Sat 08/10/2005 23:13:43
I was wondering if there was a command thats the opposite of the command. if (player.ID == CSR) {SetGlobalInt(11,1);}
Or in other words I need my game to change the variable to 11,0 if the player character is not CSR.
Title: Re: Is there a If player is not command
Post by: Babar on Sat 08/10/2005 23:24:01
use != instead of ==
Title: Re: Is there a If player is not command
Post by: mport2004 on Sat 08/10/2005 23:34:34
Thx for the help
Title: Re: Is there a If player is not command
Post by: Ashen on Sun 09/10/2005 14:52:11
For future reference, a list of operators supported in AGS is in the Manual. (http://www.adventuregamestudio.co.uk/manual/Operators.htm)
Title: Re: Is there a If player is not command
Post by: monkey0506 on Sun 09/10/2005 22:52:01
Or, you could do this:

if (player == cCsr) SetGlobalInt(11, 1);
else SetGlobalInt(11, 0);


Seeing as you said you wanted global-int 11 to be 1 if the player was CSR, I put that code, with the code to make it 0 if the player isn't CSR (via the else statement).