a way to display only some click on commands

Brian123
The click on commands I'm referring to are those that popup when you click on an object and get the option to Look At.

Is there anyway to hide some of the popup commands until certain conditions are in place so as not to give away too much to the player. Also at the start of the adventure commands like Dry Yourself should not be displayed until the player is wet from swimming.
So far the only way has been to replace an object with another object and display it with the name. For example replace the dry ball object with a wet ball object (using invisible and visible options) and add the command Dry Ball to the Wet Ball and display it with the same name of Ball.
But I'm hoping that there is a better way to do this.

Brian123

Silver
If you want to only do some actions with an object but at a later juncture want to add actions the easiest way is to create two objects with the same alias that get substituted for each other.

HegemonKhan
The quest-proper (and in-code) terms are:

'displayverbs' (special Stringlist Attributes) = the 'buttons' and 'hyperlinks' for Objects, when not in your Inventory
'inventoryverbs' (special Stringlist Attributes) = the 'buttons' and 'hyperlinks' for Objects, when in your Inventory

http://docs.textadventures.co.uk/quest/ ... ments.html
http://docs.textadventures.co.uk/quest/ ... types.html (scroll down just a bit for the 'displayverbs~inventoryverbs' beginning)

thus, you need to learn how to code with lists:

using lists ( http://docs.textadventures.co.uk/quest/ ... lists.html )
list add ( http://docs.textadventures.co.uk/quest/ ... t_add.html )
list remove ( http://docs.textadventures.co.uk/quest/ ... emove.html )
etc etc etc

if (fire_spell.parent = player) {
list add (fire_spell.inventoryverbs, "cast")
}


if you don't want certain 'buttons' and 'hyperlinks' to be displayed initially (at game start)... its a bit more complicated...

the simple first part is to:

'game' (the special Game Object) -> Room Descriptions (Tab) -> automatically generate object display verbs list and~or display hyperlinks-> uncheck it

and~or

'(whatever)' (your individual Objects) -> Object (Tab) -> Display Verbs and~or Inventory Verbs -> (check ~ uncheck ~ set it up how you want)

the hard second part is going into the code, and coding in the rest of what you need to do... (when those Verbs become available) ... I can help you do this, but it's a bit advanced for people new to quest and especially to coding~programming.

The reference material for this stuff is Pixie's Spell Library, which I think is now hidden~combined with Pixie's Simple Combat and~or Tabs~Types sections within the tutorial:

there is no 'cast' button-verb displayed~available until you 'learn' the spell first, then the 'cast' button-verb becomes displayed~available

I can post Pixie's Spell Library up, if you can't find the material, I got it saved *before* it got mixed~hidden in the tutorial due~during the shift to the new wiki pages, hehe :D

The Pixie
This is the page HK mentions as "reference material", go down to the section "Display and Inventory Verbs", the rest is not relevant. It is pretty brief, however...

There is an added complication not mentioned there or in HK's post. If you just add a verb to the list, you will get this error: "Error running script: Cannot modify the contents of this list as it is defined by an inherited type. Clone it before attempting to modify."

What this means is that your object has the list of its type, and not its own list. Probably the easiest way around that is to create a new list each time, and the easiest way to do that is using the Split function.

When your ball gets wet, then, you might do this:
ball.inventoryverbs = Split("Look at;Drop;Dry", ";")

When it is dried, you do this:
ball.inventoryverbs = Split("Look at;Drop", ";")

(An alternative, which I mention for completeness only, would be to use the above in the start script, and then you could add and remove from the list as normal.)

If you are unsure what to do with code like the above, see here

Brian123
Noted thanks pixie.
I'll try this soon.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums