MultiResponse: Difference between revisions
Jump to navigation
Jump to search
*>SSH mNo edit summary |
*>SSH mNo edit summary |
||
Line 7: | Line 7: | ||
add a script action to your "interact with hotspot" for example and say: | 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!"); | 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!" | 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!" | ||
Line 15: | Line 15: | ||
The function returns which of the responses was given, so you can do something special: | 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"); | 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); | if (state==3) player.AddInventory(iIckyGoo); | ||
{{SSH Module|MultiResponse}} | {{SSH Module|MultiResponse}} | ||
[[Category:Dialog Modules]] | [[Category:Dialog Modules]] |
Revision as of 15:48, 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);