Author Topic: Very specific event help  (Read 432 times)

Ok, so I'm making sort of a puzzle game, and so what I wanted to do is that when you click a brick, which is a lighter, it'll go into your "inventory" or something like this and disappear. Now, when you click the lantern, it'll light up. Now, after you light up the lantern, there will be a paper that was there before this all started. Once you click the paper and the lantern is off, it says the lighting is too dark to read it. Once you click it when the lantern is on, it'll show you the text that's "on" the paper. I don't want specific events, I just want some guidance, as this seems to be something with VCE and I'm not too good with it.

2 variables required
Light (on or off)(0 1)
Lighter (have or do not have)(0 1)


Paper
So basically you make a variable that determines if the light is on or off
Light off = 0 (of this variable)
Light on = 1 ("     "     ")
If the variable = 1
Ontrue light on message
Onfalse dark message


Lighter
Set lighter variable to 1

Light
If light variable is 1
Turn on light



Noedit:on the light section it should be if lighter variable

You have three bricks.
Brick A, B, and C.
A = Lighter
B = Lantern
C = Paper

You have a choice here, do you want the players to lose the lighter when they die, or keep it until they log off of the server? If you want them to lose it, change the [P/C] section of the events below to "player", but to keep it, make it "client".

Brick A
onActivate > [P/C] > VCE_ModVariable [haslighter] [set] [1] - Alternately, you could put 'true' in place of the '1', but I prefer Boolean values.
onActivate > Client > ChatMessage [You obtain the lighter.]

Brick B
onActivate > [P/C] > VCE_IfVariable [haslighter] [==] [1 (Note, this needs to be the same as the true/1 on brick A)] [(This argument is for if you have multiple variable checks running on one brick. You don't need it in this application.)]
onVariableTrue > Client > ChatMessage [You light the lantern with your lighter.]
onVariableTrue > Self > Setlight
onVariableTrue > NAMED BRICK [Brick C] > VCE_ModVariable [lanternlit] [set] [1]
onVariableFalse > Client > ChatMessage [You need a lighter to light the lantern.]

Brick C
onActivate > Self > VCE_IfVariable [lanternlit] [==] [1] []
onVariableTrue > Client > ChatMessage [The paper reads: "SECRET TEXT GOES HERE LOL"]
onVariableFalse > Client > ChatMessage [It's too dark to read this piece of paper. Maybe you could light a lantern nearby..?]

NOW- if you want to add more depth to this, you could modify Brick C. This modification will require knowledge of the argument I mentioned in brick B. I will also show the line numbers for ease of use.

0 - onActivate > Self > VCE_IfVariable [lanternlit] [==] [1] [1 3] (This tells it to apply the answer to 'ifvariable' to lines 1 through 3)
1 - onVariableTrue > Client > VCE_IfVariable [readpaperwhiledark] [==] [1] [4 5]
2 - onVariableFalse > Client > ChatMessage [It's too dark to read this piece of paper. Maybe you could light a lantern nearby..?]
3 - onVariableFalse > Client > VCE_ModVariable [readpaperwhiledark] [set] [1]
4 - onVariableFalse > Client > ChatMessage [The paper reads: "SECRET TEXT GOES HERE LOL"]
5 - onVariableTrue > Client > ChatMessage [Now that you have lit the lantern, you can clearly see that the text on the paper reads: "SECRET TEXT GOES HERE LOL"]

This modification throws a new variable into play. If you click the paper before you light the lantern, it will remember that you did so, and when you light the lantern and click it again, it will modify its SECRET TELLING PHRASE accordingly. If you did not try to read the paper before lighting the lantern, it will simply tell you what the contents of the paper are.

DYNAMIC

Thanks KillAll. I didn't want to seem needy so I didn't want all the events, lugnut, but thanks lol.

I kinda wrote it to see if I could write events in a clear format.
Turns out I can.