Author Topic: VCE next message  (Read 974 times)

Is there a way to check the player's next message using VCE? The limit on VCE last message is that the events will continue to trigger if you haven't said anything since you said the keywords. For example, if I enter a zone, and it checks my last message for being "balloon", and I haven't said anything after I said that earlier, it will automatically trigger, even if I said that an hour ago, half way across the map.

Save the previous message as a variable in the client.
Now, before it triggers, make it check if the last message is equal to nothing. If it is, then just return the saved message, otherwise return the new message.

EDIT: I think this is what you wanted to do? I'm sorry.
« Last Edit: April 19, 2015, 08:34:12 PM by PurpleMetro »

Save the previous message as a variable in the client.
Now, before it triggers, make it check if the last message is equal to nothing. If it is, then just return the saved message, otherwise return the new message.

EDIT: I think this is what you wanted to do? I'm sorry.

I don't know what you mean by return.

I missed something in the op, let me see if this clears it up.

Say, for example, there is a brick. You click the brick, and it tells you to say the password and then click again. This will both trigger the brick asking you for the password, and the events that occur once the variable of the lastmessage, being the password, being true.

What I want is to be able to click the brick, have it ask me for the password, say the password, and the events that occur if the variable is true occur.


there is an onChatMessage event somewhere you can use. check rtb archives.


The password thing would work but if you do want to use VCE;

When the brick is activated check the player for a request ticket variable. It should be NULL or 0 at that moment by default.

If the player clicks the brick and does not have the ticket variable, then ask them what ever question you want AND set the request ticket variable to 1.
If the player clicks the brick and does have the ticket variable, then check if the answer they entered was correct/incorrect AND set the request ticket to 0.

Depending on their answer being correct or not, just have to usual onVariableTrue/False stuff you want as the output.

That is how I would go about it in VCE. Make sure you add the variable to the player so if they die or respawn, their request variable is reset to 0.
« Last Edit: April 20, 2015, 07:43:52 AM by Jam_Jar »

What I want is to be able to click the brick, have it ask me for the password, say the password, and the events that occur if the variable is true occur.

havent used vce recently

vce retrochecks include onplayerlastmsg [ ] [             ] [ ]
for the way the door works, it would be as follows
onactivate > client > centerprint [ password ]
onactivate > firerelay
onrelay > firerelay
onrelay > vceretrocheck playerlastmsg = open sesmi
onvariabletrue > disappear 5
onvariabletrue > cancelevents


that might work, but I would have to try it in game

fff ill find the solution
« Last Edit: April 20, 2015, 12:54:54 PM by Im_AFK »

Query Brick:

"10" onActivate >> Client >> ChatMsg "<color:EEEEEE>Your last message that you saved was '<var:cl:PWS>'.  Would you like to use it as a password to unlock this device?"
"0" onActivate >> Client >> ChatMsg "<color:EEEEEE>Click the <color:55EE55>green<color:EEEEEE> brick to accept, or the <color:EE5555>red<color:EEEEEE> brick to decline."
"0" onActivate >> Self >> VCEModVariable [Client] "PWS" [Set] "<var:cl:lastmsg>"

Yes (Green) Brick:

"0" onActivate >> Self >> VCEifValue "<var:cl:lastmsg>" [==] "(desired password)" "1 3"
"0" onVariableFalse >> Client >> ChatMsg "<color:EE5555>Sorry, but this is the incorrect password."
"0" onVariableTrue >> Client >> ChatMsg "<color:55EE55>Password accepted!"
"33" onVariableTrue >> Self >> fireRelay
 . . .  "0" onRelay (In multiple instances, anything triggered by this relay will be the effect of the password being accepted.)

No (Red) Brick:

"0" onActivate >> Client >> ChatMsg "<color:EEEEEE>Your latest chat message has been cleared from entry."
"0" onActivate >> Self >> VCEModVariable [Client] "PWS" [Set] ""*

*Leave this section blank.

Hover over navy italic text to see the full word.

Why have 3 separate bricks...?

Code: [Select]
X 0ms onActivate Player VCE_ifVariable [Req_Ticket] == [0] [1 3]
X 0ms onVariableTrue Client ChatMessage [<color:FFFF00>Gate Keeper<color:FFFFFF>: What's the password, you shmuck?]
X 0ms onVariableTrue Player VCE_modVariable [Req_Ticket] Set [1]
X 0ms onVariableFalse Self VCE_retroCheck ifLastPlayerMsg == [password] [4 8]
X 0ms onVariableTrue Client ChatMessage [<color:FFFF00>Gate Keeper<color:FFFFFF>: You may pass...]
X 0ms onVariableTrue Player VCE_modVariable [Req_Ticket] Set [0]
X 0ms onVariableTrue GATE_DOOR disappear [3]
X 0ms onVariableFalse Client ChatMessage [<color:FFFF00>Gate Keeper<color:FFFFFF>: Try again, scrub.]
X 0ms onVariableFalse Player VCE_modVariable [Req_Ticket] Set [0]

Chat output:


It's all condensed into 9 lines on 1 brick.

That is what I tried to explain in my post earlier but apparently the explanation didn't come through clearly enough. So above are the events I used and also the output I got in chat from using those events. All you have to do is adjust the ChatMessages, password variable (to what you want to check for) and the GATE_DOOR line is for what ever you want to output to. So in this case I just had a block disappear out of the way.
« Last Edit: April 20, 2015, 03:18:33 PM by Jam_Jar »

You guys help a lot. I didn't think this would turn into a help topic, I thought there was a variable for the next message in VCE already. Although, you guys took the example too seriously, as that wasn't exactly what I was aiming for.

I'm going to try to break this stuff down though, as that password thing is basically what I am trying to do.



If you really want to know, I am trying to make a machine that dispenses guns. I wanted to make it so that you only have to swipe, and then it goes through giving you a bunch of info, and tells you to chat .buygun1 in order to make the purchase. The fact is that this doesn't work.

If you want it to work, you need to swipe the button again, only if you said the correct phrase told to you. This triggers all the events once again and then asks you for an extra confirmation, which is the event that triggers when the variable of the lastmessage being .buygun1 being true.

I will post the offending event lines that I have so far in a minute.

you can do a printcount loop until they buy a gun, constantly checking
either that or event the floor to have the chat event, and have it turn off once it matches something, turns on with the button

1 - opTch>ifVar><var:cl:lastmsg> $= .Gun1 [2]
2 - OVT>CL>IfVar [Block] != 1[3 5]
3 - OVT>CL>ModVar>WatGunDeyWant = <var:cl:lastmsg>
4- OVT>Cl>Block =1
5 - OVT>Cl>ChtMsg [UWantThisCake?]

6 - opTch>CL_ifVar> Block $= 1 []
7 - OVT > ifvar ><var:cl:lastmsg> $= "IWantIt" [8 11]
8 - OVT>cl>Modvar>WatGunDeyWant = NULL
[Switch For WatGunDeyWant Types]
9 - OVT>PL>AddItem
10 - OVT > Cl >Block =0
11 - OVF > Cl >Block =0