Use AnObject On An Hotspot

Started by Thuplump, Thu 14/10/2004 03:46:22

Previous topic - Next topic

Thuplump

First off, I have read many tutorials. And I thout I knew how to do this but nohng happens when I test my game. Anyways, how do you make it so that if you click on a door and dont have the key a message says that it is ;ocked, but if you do have the key, you go to the next room, and lose the item used? This is just an example. This will help me in many other ways if you could answer this.

TerranRich

Have you even tried using the Interaction Editor? If you don't know what that is, then read the manual, from the beginning. Bsaically, all the commands you need are in there. You can also use scripting if you choose. If so, look up "global variables" in the manual, as well as Display() and NewRoom() and LoseInventory(). :)
Status: Trying to come up with some ideas...

strazer

- Click the door hotspot's "Interaction..." button.
- Double-click "Use inventory on hotspot".
- Choose "Run script".
- Click "Edit script..."
- Put this script in there (modify to your needs):
Code: ags

if (character[GetPlayerCharacter()].activeinv == YOURKEYINVITEMNUMBERHERE) { // if key used
  LoseInventory(YOURKEYINVITEMNUMBERHERE); // remove key from inventory
  NewRoom(YOURROOMNUMBERHERE); // go to new room
}
else { // if something else used on hotspot
  DisplaySpeech(GetPlayerCharacter(), "That doesn't work.");
}


There's also an interacton editor-only way, but I think scripting is easier.

Thuplump

Thanks, that helped a lot. (not sarcastic but sounded it)

SMF spam blocked by CleanTalk