Author Topic: VCE statements all true  (Read 1324 times)

I'm wondering if there's any way to make something happen only if you have one of all the variables necessary. for examples i have 3 bricks, one for carrots, one for cabbage and one for meat. Each of them adds 1 of their respective ingredients. However, when I want to put them all together I can't make the game check for one of each of them, only one of any of them. Help pls.

make the variable you're checking for a number, and make each ingredient add 1 to that number, then check to see if that number = 3

wait, unless "and" is something in VCE. then you could just use that. but afaik it's not

make the variable you're checking for a number, and make each ingredient add 1 to that number, then check to see if that number = 3

wouldn't that make it possible to, for example, have 3 of carrots and none of the other ingredients, still work?

0  onActivate      > Self   > VCE_ifValue     [<var:pl:carrots>] [>=] [3] [1 2]
1  onVariableFalse > Client > Centerprint     [You need more carrots!]
2  onVariableTrue  > Self   > VCE_ifValue     [<var:pl:cabbage>] [>=] [3] [3 4]
3  onVariableFalse > Client > Centerprint     [You need more cabbage!]
4  onVariableTrue  > Self   > VCE_ifValue     [<var:pl:meat>]    [>=] [3] [5 10]
5  onVariableFalse > Client > Centerprint     [You need more meat!]
6  onVariableTrue  > Client > VCE_modVariable [carrots] [-] [3]
7  onVariableTrue  > Client > VCE_modVariable [cabbage] [-] [3]
8  onVariableTrue  > Client > VCE_modVariable [meat]    [-] [3]
9  onVariableTrue  > Player > addItem         [Sword]
10 onVariableTrue  > Client > Centerprint     [You crafted a weapon out of food!]


The last argument for ifValue lets you chose which onVariableTrue/False it triggers on the brick.

0  onActivate      > Self   > VCE_ifValue     [<var:pl:carrots>] [>=] [3] [1 2]
1  onVariableFalse > Client > Centerprint     [You need more carrots!]
2  onVariableTrue  > Self   > VCE_ifValue     [<var:pl:cabbage>] [>=] [3] [3 4]
3  onVariableFalse > Client > Centerprint     [You need more cabbage!]
4  onVariableTrue  > Self   > VCE_ifValue     [<var:pl:meat>]    [>=] [3] [5 10]
5  onVariableFalse > Client > Centerprint     [You need more meat!]
6  onVariableTrue  > Client > VCE_modVariable [carrots] [-] [3]
7  onVariableTrue  > Client > VCE_modVariable [cabbage] [-] [3]
8  onVariableTrue  > Client > VCE_modVariable [meat]    [-] [3]
9  onVariableTrue  > Player > addItem         [Sword]
10 onVariableTrue  > Client > Centerprint     [You crafted a weapon out of food!]


The last argument for ifValue lets you chose which onVariableTrue/False it triggers on the brick.

Oh I didn't think of that. Thank you. ^^

0  onActivate      > Self   > VCE_ifValue     [<var:pl:carrots>] [>=] [3] [1 2]
1  onVariableFalse > Client > Centerprint     [You need more carrots!]
2  onVariableTrue  > Self   > VCE_ifValue     [<var:pl:cabbage>] [>=] [3] [3 4]
3  onVariableFalse > Client > Centerprint     [You need more cabbage!]
4  onVariableTrue  > Self   > VCE_ifValue     [<var:pl:meat>]    [>=] [3] [5 10]
5  onVariableFalse > Client > Centerprint     [You need more meat!]
6  onVariableTrue  > Player > VCE_modVariable [carrots] [-] [3]
7  onVariableTrue  > Player > VCE_modVariable [cabbage] [-] [3]
8  onVariableTrue  > Player > VCE_modVariable [meat]    [-] [3]
9  onVariableTrue  > Player > addItem         [Sword]
10 onVariableTrue  > Client > Centerprint     [You crafted a weapon out of food!]

Made a small error, I checked for the variables on the player but substracted them on the client. But I guess you figured that

wouldn't that make it possible to, for example, have 3 of carrots and none of the other ingredients, still work?
oh yeah. well, in that case, you could just disable and enable certain events, unless more than one player needed to use it at a time
zeblote's is nicer anyway