do you want the shopkeeper to initially not have the verb buttons (of buy~sell), and then after talking to him, he then does? Or, do you just want to create the options of buying~selling within the "talk" verb with the shopkeeper?
for having a list of choices:
(hopefully you can figure this out in the GUI~Editor, I think it's: Add a script -> Output or Script -> show menu -> click in its options)
in code, it is this (I went ahead and tried to write a script block for buying~selling):
<verb name="shopping">
show menu ("Do you want to buy or sell?", split ("buy;sell;exit",";"), false) {
switch (result) {
case ("buy") {
show menu ("What do you want to buy?", shop.item_list, false) {
shop_item = result
if (player.cash >= shop_item.price) {
player.cash = player.cash - shop_item.price
shop_item.parent = player
} else {
msg ("You can't afford that!")
}
on ready {
invoke (object_name.shopping)
}
}
}
case ("sell") {
show menu ("What do you want to sell?", player.inventory, false) {
player_item = result
player.cash = player.cash + (player_item.price / 2)
player_item.parent = game_storage_object
on ready {
invoke (object_name.shopping)
}
}
}
case ("exit") {
msg ("You're finished shopping.")
}
}
}
</verb>
---------------------------------
if you want to add buttons that weren't there initially, I think you HAVE TO do that via code, as it's the ONLY WAY:
here's how to do it...
this sets NEW (wipes out the previous verb buttons) verb buttons (Objects and Places):
<displayverbs type="simplestringlist">(the verbs you want, separate them by a semicolon)</displayverbs>
this sets NEW (wipes out the previous verb buttons) verb buttons (Inventory):
<inventoryverbs type="simplestringlist">(the verbs you want, separate them by a semicolon)</inventoryverbs>
this ADDS EXTRA verb buttons to the already existing verb buttons (Objects and Places):
<displayverbs type="listextend">(the EXTRA verbs you want added, separate them by a semicolon)</</displayverbs>
this ADDS EXTRA verb buttons to the already existing verb buttons (Inventory):
<inventoryverbs type="listextend">(the EXTRA verbs you want added, separate them by a semicolon)</inventoryverbs>
-----------------------------
as for any input (ie using what the game player~user types in during game play):
get input {
your_label_for_it = result
}
http://quest5.net/wiki/Get_inputfor example:
msg ("What is your name?")
get input {
player.alias = result // the "get input" sets whatever is typed in as "result"
msg ("Your name is " + player.alias)
}
so, for example:
msg ("What is your name?")
get input {
// I type in "HK"
// result = HK
player.alias = result
msg ("Your name is " + player.alias +".")
// output: Your name is HK.
}