Interactions using Conditional

Started by Babar, Sun 03/08/2003 18:20:16

Previous topic - Next topic

Babar

Ok I there was this part I wanted to put in the game that a message would be displayed and if the player had an inventory item, another message after that. If the player did not have it, a different message would show. I did the part if the player had the item (using a condition if player had inventory item), but I didn't know how to do the part to show the message if he did not have it. I know my question is kind of confusing, but I newly got ags 2.55 and I needed help
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

Scummbuddy

youll need a conditional "if" statement, plus a global integer "global int" to store and check to see if the player has the inventory item.  youll probably also need a custom function to call to in order to check whether or not the person has the item.



Check this out in the manual:

GetGlobalInt
GetGlobalInt (int index)

Returns the value of global variable INDEX.
Example:

if (GetGlobalInt(20)==1);
  { code here }

will execute the code only if Global Integer 20 is 1.
See Also: SetGlobalInt, GetGlobalString

- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

SMF spam blocked by CleanTalk