Disable display verbs and command verbs (keyboard) at the same time.... [SOLVED]

I have a problem.
I checked "display automatically generated display verb list to yhe object" and put the display verbs.

With: list remove (monster.displayverbs, "speak") the verb display disappears ... and everything is ok.

But unfortunately the verb command (speak) still works when typing with the keyboard, and the game breaks !
I don't understand how you can disable displayverbs and command verbs at the same time.....

Thanks for the answers. <3


But unfortunately the verb command (speak) still works when typing with the keyboard, and the game breaks !
I don't understand how you can disable displayverbs and command verbs at the same time.....

Displayverbs (and inventoryverbs/generatedverbslist) just controls what is displayed. In order to stop an actual command working, you need to check within the command.

You would normally set some attribute so you can check later if you need to. For example, if you give Jim an "annoyed" flag that stops him talking to you, then his script for the 'speak' verb might be:

if (GetBoolean (jim, "annoyed")) {
  msg ("You can't talk to him because he's annoyed.,")
}
else {
  // The rest of his speak script goes here
}

If you want to check for the displayverb itself, you could do:

if (ListContains (this.displayverbs, "speak")) {
  // your speak effect goes here
}
else {
  msg ("You can't speak to him now.")
}

Or, if you want to permanently delete the verb for an object, you could do something like:

objectname.speak = null

Thanks !

for the verb command I solved with a counter, increases by +1 after taking the action .

if (verbscount.COUNT >= 1) {
msg ("I don't understand the command")

objectname.speak = null is OK !


Log in to post a reply.

Support

Forums