Author Topic: VCE : >= Problems  (Read 538 times)

Simplified Scenario:

Ore Brick:
Code: [Select]
1. OnActivate > Client > VCE_ModVariable (Wheat) [Add] (1)
*Player Harvests 10 Wheat*

Selling Booth:
Code: [Select]
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.]
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.

First line in the second piece of events, you're checking the brick's wheat variable not the client's.

You're also editing the brick's wheat and gold variables in line 2 and 3, instead of the client's I presume.


2nd word :D

(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.
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

First line in the second piece of events, you're checking the brick's wheat variable not the client's.
Thanks.