Adding and removing synonyms for verbs and commands?
MisterEightySix
20 Aug 2016, 20:00I'm new to this sort of thing and I have little programming experience. I'm trying to make a simple, retro-styled game, but I've noticed a little hiccup: While I can "look at doors" that are nearby, I cannot simply "look doors". And while I can "turn on" and "turn off" a magic torch, I can also "switch on" and "switch off" that torch, which doesn't make grammatical sense. Additionally, I don't know how to make the game treat, for example, "extinguish torch" and "ignite torch" as synonyms for "turn torch off" and "turn torch on", respectively. Can someone help me out?
hegemonkhan
20 Aug 2016, 20:32I'm not sure with some of this stuff, so take it with a grain of salt, and wait for more knowledgeable repsonses such as from Pixie or Jay, but here's my shot at it:
for what Verbs are displayed, it is controlled by the 'displayverbs' and 'inventoryverbs' built-in Stringlist Attributes
for Commands, I think you can simply put in semicolons in the 'pattern' box/Attribute, to add alternative/synonyms for it.
for Verbs, I think there's an 'alt' (alternative names) box/Attribute for them, and you can have multiple ones, again via using the semicolon
You can also of course create your own Verbs/Commands too.
here's some links that may be of help:
http://textadventures.co.uk/forum/samples/topic/4953/how-to-use-verbs
http://textadventures.co.uk/forum/samples/topic/5023/how-to-use-display-verbs-and-inventory-verbs-effectively
http://textadventures.co.uk/forum/samples/topic/5862/complex-commands
http://docs.textadventures.co.uk/quest/elements/command.html
http://docs.textadventures.co.uk/quest/elements/verb.html
http://docs.textadventures.co.uk/quest/guides/display_verbs.html
XanMag
20 Aug 2016, 23:37While I can "look at doors" that are nearby, I cannot simply "look doors".
So, you want to be able to type 'look doors' or 'look object' and get a description? If so, you can add the verb 'look' to any object without it interfering with the built-in 'look at'/'x' command. Just copy-paste your 'look at' description into the 'look' verb.
And while I can "turn on" and "turn off" a magic torch, I can also "switch on" and "switch off" that torch, which doesn't make grammatical sense.
For the torch, simply do NOT make it "switchable". Then add the verbs 'turn on' and 'turn off' to the verb list. Then, run whatever script you want for that.
Additionally, I don't know how to make the game treat, for example, "extinguish torch" and "ignite torch" as synonyms for "turn torch off" and "turn torch on", respectively.
Again, I believe you can add extinguish and ignite as verbs to the torch and copy-paste your scripts over from your turn on/turn off scripts. The "turn torch on/off" would work differently however. You would probably need to add this as a global command . Then you can copy-paste your script from the turn off/turn on verb you added. You would first need to use an IF script to check to see if the player is carrying the torch.
If you need help with all of that, let me know. I'm pretty sure this is the easiest way to accomplish what you are trying, but someone may come along and tell you differently! =)
What you are doing is awfully tedious, but, in my opinion, well worth it.
The Pixie
21 Aug 2016, 07:28Bear in mid that there are two parts to Quest verbs, one is the script associated with the object, the other defines the synonyms, and the latter cannot be changed at all in the on-line editor.