Author Topic: More than one variable needed to activate something?  (Read 576 times)

Say I have three things (variable-wise) that I need to activate a button.

Receive a quest item: (Onactivate -> client -> modVariable -> [questitem1] [set] [1]

How do I event the button so it'll only activate when the player has collected all three, and denies anyone missing one or more of these artifacts?

Bump, because I need this.

When you find an artifact, you could add a 'treasurefound' variable...
that way, the event like would be

0 - Onactivate : client : ifvariable : treasurefound == 3 1 3
1 - Onvariabletrue : client : centerprint : Found etc.
2 - Onvariabletrue : player: additem : rewards
3 - Onvariabletrue : client : VCEmodvariable : treasurefound : set :0

When you find an artifact, you could add a 'treasurefound' variable...
that way, the event like would be

0 - Onactivate : client : ifvariable : treasurefound == 3 1 3
1 - Onvariabletrue : client : centerprint : Found etc.
2 - Onvariabletrue : player: additem : rewards
3 - Onvariabletrue : client : VCEmodvariable : treasurefound : set :0

If you make the 1 3 into 1 5 you could do:

4 - Onvariablefalse : client : centreprint : Not finished quest yet
5 - Onvariablefalse : client : bottomprint : <var:cl:treasurefound>

Event 0: onActivate -> Brick -> IfVariable -> [Client] [questitem1] [1 2]

Event 1: onVariableFalse -> Client -> Chatmessage -> [You don't have all items]

Event 2: onVariableTrue -> Brick -> IfVariable -> [Client] [questitem2] [3 4]

Event 3: onVariableFalse -> Client -> Chatmessage -> [You don't have all items]

Event 4: onVariableTrue -> Brick -> IfVariable -> [Client] [questitem3] [5 7]

Event 5: onVariableFalse -> Client -> Chatmessage -> [You don't have all items]

Event 6: onVariableTrue -> Client -> Chatmessage -> [The button activates]

Event 7: onVariableTrue -> Whatever the button does goes here

Hope you understand what I did here.

New-reply: That works too, it is in fact a quicker way to do it.

-Chefhelpsnip-
Hope you understand what I did here.

Yes, I did. My problem was I was using onActivate for all the variable checks. Thanks!

-Cobierehelpsnip-

I wanted to be able to have different variables for different treasures, but making them all add to a collective variable is a good idea too.

Thanks for your help, guys. :D