if in room 1, then do this, otherwise do nothing

Started by bjk7209, Mon 29/08/2005 00:55:45

Previous topic - Next topic

bjk7209

I am trying to make an object appear if the player uses an inventory item in room 1.  That works fine.  But if the player uses the inventory item in another room then i get an error because the object is not in the other room.  How would the script look if i wanted the object to appear only in room1 when the inventory item is used.

monkey0506

You can use the Character.Room property to test it:

/* if player used inventory item */
if (player.Room == 1) { /* if the player is in room 1 */
  /* turn object on and do stuff */
  }
else {} /* otherwise, do nothing */

If you are using AGS 2.62 or earlier, you would have to replace player with character[GetPlayerCharacter()].  I hope this helps. :=


SMF spam blocked by CleanTalk