Author Topic: [VCE] How to create menus?  (Read 1951 times)

I used to know how to do this years ago, but I'm really stumped on it now. What string of events do I need to set up branching dialogue in VCE? Thanks

what kind of menus?
varlinks in the chat, or clicking bricks and printing out?

what kind of menus?
varlinks in the chat, or clicking bricks and printing out?
varlinks in the chat

onVariableUpdate is the input event for when somebody clicks the varlink

I don't quite remember how varlinks syntax is, but I think it's something like <varlink:a:b> to set variable a to be b, and prints a(?)

onVariableUpdate is the input event for when somebody clicks the varlink

I don't quite remember how varlinks syntax is, but I think it's something like <varlink:a:b> to set variable a to be b, and prints a(?)
i guess I don't really want varlinks, I'm not sure how to describe it.

I basically want it so that when a person types "/help" after the bot prompts them to type it, it'll launch another client>ChatMessage

I basically want it so that when a person types "/help" after the bot prompts them to type it, it'll launch another client>ChatMessage
if this is exactly what you want done then it's ten times easier to script it
unless you're just using that as an example

if this is exactly what you want done then it's ten times easier to script it
unless you're just using that as an example
that's pretty much all i want. not sure how to do it

if you want to use server commands, it'll require a script

I don't want it to use commands, I just want it so that when they say "/help" or "help" or any phrase, it opens a new chat message

"/help" is a command
"help" is a chat message

you're going to have to pick one, or both, just let me know what interfacing you want it to have

"/help" is a command
"help" is a chat message

you're going to have to pick one, or both, just let me know what interfacing you want it to have
Chat message

so if using chat messages, what will trigger the event?
varlinks and onVariableUpdate
a button with onActivate
a room with a floor with onPlayerTouch/onChatMsg
a loop that runs until the end of the menu

would not really recommend onPlayerTouch/loop, but onChatMsg is probably the cleanest from the users perspective

I'm using onBotActivate

what would you like it to do?

should it have different keywords to display messages, or should it remember where you are in the menu?

different keywords:
onActivate>self>VCE_ifValue[<var:cl:lastMsg>][==][shop][1 5] //line 0
onVariableTrue>client>chatMsg[Here is the shop:]
onVariableTrue>client>chatMsg[Gun: 5 points]
onVariableTrue>client>chatMsg[Shotgun: 15 points]
onVariableTrue>client>chatMsg[Minigun: 25 points]
onVariableFalse>self>VCE_ifValue[<var:cl:lastMsg>][==][gun][9 10] //line 5
onVariableTrue>player>addItem[gun] //put before the the score check to not interfere with the lastMsg check, could put at the very end instead
onVariableTrue>client>incScore[-5]
onVariableFalse>client>chatMsg[Not enough points]
onVariableTrue>self>VCE_ifValue<var:cl:score>][>=][5][6 8] //line 9
onVariableFalse>self>VCE_ifValue[<var:cl:lastMsg>][==][shotgun][14 15] //line 10
onVariableTrue>player>addItem[shotgun] //put before the the score check to not interfere with the lastMsg check, could put at the very end instead
onVariableTrue>client>incScore[-15]
onVariableFalse>client>chatMsg[Not enough points]
onVariableTrue>self>VCE_ifValue<var:cl:score>][>=][5][11 13] //line 14
onVariableFalse>self>VCE_ifValue[<var:cl:lastMsg>][==][minigun][19 20] //line 15
onVariableTrue>player>addItem[gun] //put before the the score check to not interfere with the lastMsg check, could put at the very end instead
onVariableTrue>client>incScore[-5]
onVariableFalse>client>chatMsg[Not enough points]
onVariableTrue>self>VCE_ifValue<var:cl:score>][>=][5][16 18] //line 19
onVariableFalse>self>VCE_ifValue[<var:cl:lastMsg>][==][teleports][21 25] //line 20
onVariableTrue>client>chatMsg[Here are the teleport locations:]
onVariableTrue>client>chatMsg[House]
onVariableTrue>client>chatMsg[Factory]
onVariableTrue>client>chatMsg[Pond]
onVariableFalse>self>VCE_ifValue[<var:cl:lastMsg>][==][House][26 27] //line 25
onVariableTrue>namedBrick[House]>setPlayerTransform
onVariableFalse>self>VCE_ifValue[<var:cl:lastMsg>][==][House][28 29] //line 27
onVariableTrue>namedBrick[House]>setPlayerTransform
onVariableFalse>self>VCE_ifValue[<var:cl:lastMsg>][==][House][30 33] //line 29
onVariableTrue>namedBrick[House]>setPlayerTransform
onVariableFalse>client>chatMsg[Available menus:]
onVariableFalse>client>chatMsg[Shop]
onVariableFalse>client>chatMsg[Teleports]

default menu is at the end, in case all other options are false
if you want to have a state based menu, like 20 questions and yes/no options each time, then you'd want to save that in a variable and read text based on it

(it may be better for me to just show all of this ingame)

is there any way I can make it so you wouldn't have to activate it again after sending the message? in a way so that when you type it, the next text just comes below it