How do I make different items do different things when clicked on the same thing

Started by NiksterG, Mon 28/02/2005 05:57:04

Previous topic - Next topic

NiksterG

In my game, you need to give a person a key to continue. However, I can only figure out how to continue when ANY inventory item is used, not just the key. Can anyone help me?
Check out my games! (Not all made with AGS)

Ashen

In the interaction editor, Conditional - If inventory item was used, in scripting use an if statement, and the player.activeinv variable, e.g.
Code: ags

if (player.activeinv == 1) { // if the key is item 1 
  DisplaySpeech (NPC, "Thanks! In you go.");
  NewRoom (2);
  // Or whatever you want to happen
}
I know what you're thinking ... Don't think that.

Scummbuddy

you could go to characters
click on the character
click on their interactions
click on use inventory with character
click on conditional - if inventory item was used
click on global vars and type in the inventory number that corresponds with the key
then the child action of that will be run script, and there you put what you want to happen,such as go to new room
- 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