MultiResponse: Difference between revisions

From Adventure Game Studio
Jump to navigation Jump to search
*>SSH
mNo edit summary
*>SSH
mNo edit summary
Line 1: Line 1:
requires AGS 2.71 or above
''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?
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?
Line 19: Line 19:


{{SSH Module|MultiResponse}}
{{SSH Module|MultiResponse}}
[[Category:Dialog Modules]]
{{Module|Dialog}}

Revision as of 15:55, 3 October 2006

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);