One time only verbs
DanielLykos
25 Apr 2020, 17:20Hi. I have a verb that I put in all my characters (objets that are select like people), but I'd like to be able to use it only one time (if it's possible, only one time and only one character, but if it's not, only one time per character). Is there a way to do that? I'm a complete dummy with codes and stuff
Thanks
mrangel
25 Apr 2020, 17:51You could delete the verb when it's been used.
To remove it from the current character:
this.name of verb = null
or to delete the verb entirely:
destroy ("name of verb")
You could put either in the verb's script.
If you just want to remove it from the drop-down menu but allow the verb to be used if the player types it, you'd remove it from displayverbs/generatedverbslist:
this.displayverbs = ListExclude (this.displayverbs, "Name of verb") this.generatedverbslist = ListExclude (this.generatedverbslist, "Name of verb")
DanielLykos
27 Apr 2020, 11:37Thanks, but I don't know how to put it, ¿could you show me an example, please? If not, don't worry, it's not something essential for the game, only something I think would be good

Pykrete
27 Apr 2020, 14:10Exactly as he posted, at the end of the script for the verb. If your verb currently just prints a message, copy it, change it to a script, put in a print message, paste it, then copy in either of those two expressions into code view beneath it.
Lets say your verb is 'expand'.
msg ("Hello, this is a message.")
destroy ("expand")
mrangel
27 Apr 2020, 19:13Actually, in this situation it's more likely that you want to use a boolean variable (flag). have the action check if a flag is set, and if so display a message telling the player they can only do that thing once. If not, it gives the usual response and then sets the flag.

Pykrete
28 Apr 2020, 02:55Oh, so a warning the first time, actual execution the second time.