After Interaction Say Something Else

Started by , Sat 18/09/2004 13:18:31

Previous topic - Next topic

Plog

I'm a little sketchy been a long time since I used AGS and I was never extremely good at in anyways.

But basically I want it so when I interact with a hotspot that something go int my inventory then when you interact and look at the hotspot again the Player character says something different than when you hadn't interacted with it.

Anyone help?

BorisZ

You should set variable to new value after interacting, and use condition (if ... else) on look action.
Check manual about variables and conditions.

Ashen unlogged

BorisZ is right, varibles are the key here.

e.g. 1 (scripting):
if (GetGlobalInt (10) == 0) { // or an int you've created
Ã, Display ("You found a key!");
Ã, AddInventory (1); Ã, 
Ã, SetGlobalInt (1, 1); // or set your int
}
else Display ("There's nothing in there.");

e.g. 2 (Interaction editor)
Conditional - If variable is set to a certain value (GotApple, 0)
Ã, Game - Display a message (number of the 'Found a key' message)
Ã, Player - Give the player an inventory item (1)
Ã, Game - Set variable value (GotApple, 1)
Ã, Stop running more commands
Conditional - If variable is set to a certain value (GotApple, 1)
Ã, Game - Display a message (number of the 'Nothing there' message)

You could also base it on whether the character has the inventory item, but that way they'd be given it again if they came back after using it.
(This post is probably not needed, but BorisZ posted as I was typing it, so I thought I'd post it anyway.)

SMF spam blocked by CleanTalk