Author Topic: Need help with VCE - compare to interval?  (Read 416 times)

Hi there.
I'm pretty new to VCE, so im messing around with a little dice i made.
I wonder, is it possible to compare the output of a variable to an intervall, rather than just == or < ?

Let me explain:
0. onActivate - Self - ModVariable - Brick - random - Set - 1
1. onActivate - Self - ModVariable - Brick - random - randomNum - 10
2. onActivate - Self - ifValue - <var:br:random> == 10 - [3 3]
3. onVariableTrue - Client - Centerprint - "You won 1000 coins!"
4. onActivate - Self - ifValue - <var:br:random> >=4 && <var:br:random> < 9 [5 5]
5. onVariableTrue - Client - Centerprint "You won 10 coins!"
6. onActivate - Self - ifValue - <var:br:random> <4 - [7 7]
7. onVariableTrue - Client - Centerprint - "You lose. Try again!"

This is just an example, but you know what i mean.

i think IfValue should be IfVariable.
IfValue goes to stuff like <var:cl:bl_id> and other stuff that i don't know what it does.

I wonder, is it possible to compare the output of a variable to an intervall, rather than just == or < ?

Lol oh god use IfVaraible.

Triple: I made a working example of a random number game on a glowing 32x32 baseplate in your server. feel free to use it broski

Thanks for your help skill4life, but you didnt really do what I was asking for. I know how to make a dice that has 2 different outputs (win/lose) but how about 3.
Like
1 to 45 = you lose.
46 to 91 = wow, you win.
91 to 100 = You're teh awesome!

Update: Never mind, i solved it myself.

The way i did it:

0. onActivate - Self - ModVariable - Brick - random - Set - 1
1. onActivate - Self - ModVariable - Brick - random - randomNum - 100
2. onActivate - Self - ifVariable - <var:br:random> >= 50 - [3 6]
3. onVariableTrue - Self - ifVariable - <var:br:random> >= 80 [4 5]
4. onVariableTrue - Client - Centerprint - "Wow, you got over 80!"
5. onVariableFalse- Client - Centerprint - "Nice, you got over 50!"
6. onVariableTrue - Client - Centerprint "Oh no, you got under 50 :(

Good for you. Lock now.