Blockland Forums > Help
VCE : >= Problems
Pages: (1/1)
Tezuni:
Simplified Scenario:
Ore Brick:
--- Code: ---1. OnActivate > Client > VCE_ModVariable (Wheat) [Add] (1)
--- End code ---
*Player Harvests 10 Wheat*
Selling Booth:
--- Code: ---1. OnActivate > Self > VCE_IfVariable (Wheat) [>=] (10) (2 4)
2. OnVariableTrue > Self > VCE_ModVariable (Wheat) [Subtract] (10)
3. OnVariableTrue > Self > VCE_ModVariable (Gold) [Add] (10)
4. OnVariableFalse > Client > ChatMsg > [You need at least 10 wheat to sell.]
--- End code ---
After harvesting 10 wheat and then clicking the sell booth, it is saying: "You need at least 10 wheat to sell."
Also, I tried using <= (Less than and/or equal to), and it worked as greater than and/or equal to.
However, when I used <= in the events above, it allowed it to go into negatives and make them sell negative wheat.
Destiny/Zack0Wack0:
First line in the second piece of events, you're checking the brick's wheat variable not the client's.
Destiny/Zack0Wack0:
You're also editing the brick's wheat and gold variables in line 2 and 3, instead of the client's I presume.
phflack:
2nd word :D
--- Quote from: Tezuni on March 27, 2010, 05:55:50 AM ---(Less than and/or equal to), and it worked as greater than and/or equal to.
However, when I used <= in the events above, it allowed it to go into negatives and make them sell negative wheat.
--- End quote ---
you can say less than or equal to, same with greater than or equal to, as if it less than/greater than, then it can't be equal to, if it equal to then it can't be less or greater than
and for your problems, it will go into the negatives with less than or equal to, because it is still returning true when less than
Tezuni:
--- Quote from: Destiny/Zack0Wack0 on March 27, 2010, 06:33:54 AM ---First line in the second piece of events, you're checking the brick's wheat variable not the client's.
--- End quote ---
Thanks.
Pages: (1/1)