tying in multiple verbs to one action

leftycool
04 Dec 2012, 03:41
Hi guys,
after some playtesting I've found users do not like that the 'use' function is pretty much the only function used in the game, and ask for some variety, eg 'pull' lever instead of just 'use'. however, I do not want the new verbs to be exclusive, I think a player should be able to both 'use' and 'push' buttons, or other items.
However, I do not want the player to be able to duplicate effects or items by both using, pressing, or pulling an object.

What is the best way to make sure once the action has been tripped once, it wont be tripped by other verbs?
Do i copy the code for every verb, and tie every one in with 'when complete delete X code'? that seems like a long-winded way to do it.


Thoughts?

Pertex
04 Dec 2012, 07:30
leftycool wrote:Hi guys,
However, I do not want the player to be able to duplicate effects or items by both using, pressing, or pulling an object.

Don't you have this problem now if the player calls 'use lever' twice? Normally 'use lever' and 'pull lever' would call the same function, so you have to make sure that after calling the function the first time you get another action.

leftycool
04 Dec 2012, 07:59
At the moment im ending it with either 'remove code' at the end of the script, or raise a flag, and have the command begin with 'if X does not have flag', what im looking for is a method that does not involve copy-pasting the entire command and removing it from all verbs.

Is there a way to have the pull/push/ etc etc commands refer to the use command?
eg, if pulling and using an object bring about the same result, have all the commands listed as a result of using, and one command under pull to point it to the use command?

The Pixie
04 Dec 2012, 08:02
You also do noit want them doing "pull lever" twice, so you need some mechanism to stop that too. Set up the script for "pull lever" to check if a flag is set first, and only do stuff if the flag has not been set. When doing stuff, set that flag.

All your other verbs, give them a script that in turn will call the script "pull" on the object.

Hope this is clear.

Alex
04 Dec 2012, 09:22
You don't need to set flags any more if you want to perform an action only once - you can use the "first time" script to handle this for you.

Pertex
04 Dec 2012, 11:39
Where is it saved that a verb is executed the first or second time? In an attribute?

Alex
04 Dec 2012, 12:25
It's per instance of the script. So it's saved on the script itself.