Make verbs "appear" or rather disable/enable verbs

Hey guys,
I hope this isn´t too obvious, but I searched for quite some time now:
I´m quite new and have a very particular problem;
Short Context:
The game I make is intended to have clickable verbs rather than they have to be typed.

The question I´m asking is: when I want to enable verbs on an object for the player after the player did something particular,

  1. how do I make the verb appear/enabled
    and
  2. hide/unable the verb before the player enables the object-verb through an accomplishment?

For example: If I am creating a murder mystery and the butler is the murderer, I want to make it possible for the player to confront the Butler with the verbs, let´s say, "You are the murderer, I found your fingerprints on the knife!". But if I simply show or even enable this verb before the player actually did all these things, this would be a major spoiler, as the player knows the butler did it, on the knives are fingerprints and additionally, the order of the plot is destroyed. So the verb should only appear and be enabled, as the player fulfills all the requirements.

I am very thankful, in advance, this has been bugging me for a long time!

P.S.: Please explain it simply, as I am still a beginner


I use the 'Speak to' verb.
The script

msg ("The Butler Says, <i>May I help you sir</i>")
if (knife.parent = player) {
  msg ("You reply, <i>You are the murderer, I found your fingerprints on the knife!</i>")
else {
  msg("You reply, <i>Oh, never mind.</i>")
}

This way you don't mess with enabling/disabling verbs and the Speak to verb can always show.


If you want to enable or disable a verb, you can put an if statement around it so that it gives a different response depending on some condition (such as whether you've found a clue).

If you want to add/remove displayverbs, you just modify the list "displayverbs".

In code view, this might mean that when you find the last clue, it does:

butler.displayverbs = butler.displayverbs + "Confront"

(or whatever you want the verb to be. I would strongly advise against putting the whole text in the verb, because displayverbs don't wrap well on smaller screens)


Hey guys, thank you for your quick responses :)

@Forgewright: Yes, this is really a good hint, I will use this more often, still the verb "speak" is limited to only one option at a time then.

@mrangel:
I think you are hinting me the exact thing that I search for.
But how do I find the "displayverbs" list to hide a verb, to begin with?
I´m quite new, so I don´t fully comprehend your answer by now, I can integrate the code after the conditions are met, but there has to be already the hidden verb for this to work, hasn´t it?.


list remove (butler.displayverbs, "Speak to")

or

list add (butler.displayverbs, "Speak to")

I think mrangel is saying not to use:

list add (butler.displayverbs, "You are the murderer, I found your fingerprints on the knife!")

as this does not wrap well on a small screen.


You could do this in the 'speak to' verb...

msg ("The Butler Says, <i>May I help you sir</i><br>")
if (knife.parent = player) {
  msg ("{command: Confront Butler about the knife!}")
}
else {
  msg ("Nothing, i'll talk with you later.")
  msg ("The butler says, <i>Very good sir.</i>")
}

you'll need to add a command to game:

 <command name="butlerconfront">
    <pattern>Confront Butler about the knife!</pattern>
    <script>
       msg ("You reply, <i>You are the murderer, I found your fingerprints on the knife!</i>")
    </script>
  </command>

I have weak coding skills but I try...
It's how I do this with my game.


there has to be already the hidden verb

Common confusion. There is a difference between verbs and displayverbs.

Verbs control what happens when the player enters a particular command, whether they typed it in or clicked it on a menu. They are on the object's "Verbs" tab.

displayverbs are the things that appear on the menu when the player clicks on an object, and also the buttons that appear when an object is selected in the sidebar.

You can edit the displayverbs here (the box highlighted in purple):
screenshot of Quest

There is also an option (highlighted in red) to automatically add displayverbs corresponding to the object's verbs. Tick this box to make all of an object's verbs hidden. However, note that once you have done this, you will need to make sure that you add all verbs that you want to be visible to the displayverbs list.


On the subject of not having such a long verb name - I'd stick with either having a "Speak to" verb which presents the player with a menu of things to say; or have different verbs "Speak to", "Question", "Insult", "Accuse". You can see the full line of dialogue as part of the response. Then, maybe you wouldn't even need to hide the verb. Because you could accuse anyone, and then make the butler's "accuse" verb have an if script to check if you found the fingerprints. If you found the fingerprints, you say that and arrest him; if you haven't, you accuse him without evidence and he tells you how offended he is.


@ Fryer:


the 'displayverbs' and 'inventoryverbs' are built-in String List Attributes

these are what's shown as verb-buttons and hypertext, for each Object

the 'displayverbs' is what is used/seen when the Object is NOT in your inventory (the "inventory" is just the Player Object, if you put/move/set an Object to be within the Player Object, then it is within the "inventory")

the 'inventoryverbs' is what is used/seen when the Object IS in your inventory


A List Attribute, is just a broken up string ("text"), which creates separate 'items', which can be selected.


for example (using Variable VARIABLES and not Attribute VARIABLES):

string_variable = "red blue yellow"

stringlist_variable = Split (string_variable, " ")

msg (string_variable)

DisplayList (stringlist_variable, true)

// output:

red blue yellow // from the 'msg (string_variable)'

1. red // from the 'DisplayList (stringlist_variable, true)'
2. blue // from the 'DisplayList (stringlist_variable, true)'
3. yellow // from the 'DisplayList (stringlist_variable, true)'

// and, we can re-connect those list items back into a string ("text"):

string_variable_2 = Join (stringlist_variable, " ")

msg (string_variable_2)

// output:

red blue yellow

to see (and add/remove/edit) an Object's Attributes in the GUI/Editor:

'WHATEVER' Object -> 'Attributes' Tab -> Attributes (the box at the bottom) -> (see below)

to Add an Attribute, then:

'WHATEVER' Object -> 'Attributes' Tab -> Attributes (the box at the bottom) -> Add -> (set-up/create the Attribute you want to add)

to remove an Attribute:

'WHATEVER' Object -> 'Attributes' Tab -> Attributes (the box at the bottom) -> find and click on the desired Attribute within the box so it is highlighted, then there should be options for 'removing/deleting' it

to edit an Attribute:

'WHATEVER' Object -> 'Attributes' Tab -> Attributes (the box at the bottom) -> find and click on the desired Attribute within the box so it is highlighted, then there should be options for 'editing/changing' it


the light grey font Attributes are the built-in Attributes

the black font Attributes are the custom Attributes that you created/added


http://docs.textadventures.co.uk/quest/using_lists.html

http://docs.textadventures.co.uk/quest/display_verbs.html


ask if you need help with anything or are confused by anything


I got it now, perfect support from you guys, a big "THANK YOU" to you all! :)


Log in to post a reply.

Support

Forums