MultiResponse

From Adventure Game Studio | Wiki
Jump to navigation Jump to search

requires AGS 2.71 or above

It's a real pain to script multiple responses to an action, sometimes. You have to go around declaring variables, put in bunches of if statements, etc. Not too much effort for one interaction, but if you're doing it for all of them?

SSH to the rescue with MultiResponse...

add a script action to your "interact with hotspot" for example and say:

 Multi.Disp("No, I'm not touching that>No, I'm really not going near it>Look, for the last time, NO!");

And the first click on it will give you "No, I'm not touching that", the 2nd "No, I'm really not going near it" and the 3rd and subsequent clicks "Look, for the last time, NO!"

Great, I hear you say, but there's more!

The function returns which of the responses was given, so you can do something special:

 int state=Multi.Say("I don't think I want to take any>I'd rather not>OK, if you insist>I've already got some");
 if (state==3) player.AddInventory(iIckyGoo);