Author Topic: Set Random Print Event  (Read 810 times)

Would be good for slot machines.

You can do this with VCE.


Can't remember. Ask someone who's actually GOOD with VCE.

Something along the lines of displaying variables like this
Set all variables to 0
VCEmodVariable > [Brick] [Var1] [set]

VCEmodVariable > [Brick] [Var2] [set]

VCEmodVariable > [Brick] [Var3] [set]


Make them random number between 0 and 10
VCEmodVariable > [Brick] [Var1] [Random] [10]
VCEmodVariable > [Brick] [Var2] [Random] [10]
VCEmodVariable > [Brick] [Var3] [Random] [10]

Display the "slotmachine" style number
Client > CentrePrint > [Your generated slot machine is :<var:br:var1><var:br:var2><var:br:var3>]

Could even do like jackpot style things with subsystem
VCEifValue > [<var:br:var1>] [==] [9] {2 2}  - Not right subsystem value
OnVariableTrue > VCEifValue > [<var:br:var2>] [==] [9] {3 3}
OnVariableTrue > VCEifValue > [<var:br:var3>] [==] [9] {4 5}
OnVariableTrue > VCEmodVariable > [client] [credits] [add] [200]
OnVariableTrue > Client > [All the 9s! You win 200 credits! Your credits is now <var:cl:credits>]

Very cut down events, but hopefully that gives you the idea.

What I was hoping for was 3 prints, pull down a lever, and variables events for jackpot. Had this idea a while ago, but couldn't finished because I needed random print event.

I don't know if you can use variable replacers in print events, but you could try it.

Using my example of variables...

NamedBrick[firstprint]>SetPrint(is this the right event?)>[var:br:Var1]
NamedBrick[secondprint]>SetPrint(is this the right event?)>[var:br:Var2]
NamedBrick[thirdprint]>SetPrint(is this the right event?)>[var:br:Var3]

This may not work, for a few reasons....
1. The brick variables my try to pull it from the named brick rather than the brick the variables are stored on
Workaround - Assign the variables to player/client

2. Variable replacers can't work in the real name of whatever that print event is...
Workaround - I don't immediately know, ask someone else =3.

If this isn't solved by the time I wake up, I'll have a look at bashing together one myself.

I also remember that the setPrint was failed...why?

This could be very useful C:

I don't know if you can use variable replacers in print events, but you could try it.
In the old variables there was ifprint so I think it's on VCE.

try random variables, 3 different ones, making them random between 1 and 3, then if the first variable is 1, set print to 1, if 2, set to 2, if 3, set the print to 3, and same thing with the others, then you will need to check the variables to eachother

Can't remember. Ask someone who's actually GOOD with VCE.

Hi. I'd be glad to help. :3

Method A: Single random print

Code: [Select]
[X] 0 [0] onActivate > Self > VCE_modVariable > [number] set [0]
[X] 1 [0] onActivate > Self > VCE_modVariable > [number] random [9]
[X] 2 [0] onActivate > Self > VCE_ifValue > [<var:br:printcount>] == [0] [12 12]
[X] 3 [0] onActivate > Self > VCE_ifValue > [<var:br:printcount>] == [1] [13 13]
[X] 4 [0] onActivate > Self > VCE_ifValue > [<var:br:printcount>] == [2] [14 14]
[X] 5 [0] onActivate > Self > VCE_ifValue > [<var:br:printcount>] == [3] [15 15]
[X] 6 [0] onActivate > Self > VCE_ifValue > [<var:br:printcount>] == [4] [16 16]
[X] 7 [0] onActivate > Self > VCE_ifValue > [<var:br:printcount>] == [5] [17 17]
[X] 8 [0] onActivate > Self > VCE_ifValue > [<var:br:printcount>] == [6] [18 18]
[X] 9 [0] onActivate > Self > VCE_ifValue > [<var:br:printcount>] == [7] [19 19]
[X] 10 [0] onActivate > Self > VCE_ifValue > [<var:br:printcount>] == [8] [20 20]
[X] 11 [0] onActivate > Self > VCE_ifValue > [<var:br:printcount>] == [9] [21 21]
[X] 12 [0] onVariableTrue > Self > setPrintCount > [0]
[X] 13 [0] onVariableTrue > Self > setPrintCount > [1]
[X] 14 [0] onVariableTrue > Self > setPrintCount > [2]
[X] 15 [0] onVariableTrue > Self > setPrintCount > [3]
[X] 16 [0] onVariableTrue > Self > setPrintCount > [4]
[X] 17 [0] onVariableTrue > Self > setPrintCount > [5]
[X] 18 [0] onVariableTrue > Self > setPrintCount > [6]
[X] 19 [0] onVariableTrue > Self > setPrintCount > [7]
[X] 20 [0] onVariableTrue > Self > setPrintCount > [8]
[X] 21 [0] onVariableTrue > Self > setPrintCount > [9]
[X] 22 [33] onActivate > Self > playSound > error.wav

Method B: Increase print count from 10 to 20 times.

Code: [Select]
[X] 0 [0] onActivate > Self > VCE_modVariable > [stop] set [10]
[X] 1 [0] onActivate > Self > VCE_modVariable > [stop] random [20]
[X] 2 [0] onActivate > Self > VCE_modVariable > [count] set [0]
[X] 3 [0] onActivate > Self > setRaycasting > [ ]
[X] 4 [0] onActivate > Self > VCE_ifVariable > [count] == [<var:br:stop>] [5 10]
[X] 5 [100] onVariableTrue > Self > setRaycasting > [X]
[X] 6 [33] onVariableTrue > Self > playSound > synth4_11.wav
[X] 7 [33] onVariableFalse > Self > playSound > synth4_00.wav
[X] 8 [0] onVariableFalse > Self > incrementPrintCount > [1]
[X] 9 [0] onVariableFalse > Self > VCE_modVariable > [count] add [1]
[X] 10 [100] onVariableFalse > Self > VCE_ifVariable > [count] == [<var:br:stop>] [5 10]

Want another method? Just ask.



I don't know if you can use variable replacers in print events, but you could try it.

Using my example of variables...

NamedBrick[firstprint]>SetPrint(is this the right event?)>[var:br:Var1]
NamedBrick[secondprint]>SetPrint(is this the right event?)>[var:br:Var2]
NamedBrick[thirdprint]>SetPrint(is this the right event?)>[var:br:Var3]

This may not work, for a few reasons....
1. The brick variables my try to pull it from the named brick rather than the brick the variables are stored on
Workaround - Assign the variables to player/client

2. Variable replacers can't work in the real name of whatever that print event is...
Workaround - I don't immediately know, ask someone else =3.

If this isn't solved by the time I wake up, I'll have a look at bashing together one myself.

This won't work, as the default setPrint event will only allow numbers 0-9. A variable replacer would not fit.
« Last Edit: April 15, 2010, 09:44:28 AM by Deathwishez »

I don't get. I might go on BL later, can you show me there?

I am currently unable to get on Blockland. I can only answer questions on the forums.