Blockland Forums > General Discussion

Creating random results with VCE?

Pages: (1/2) > >>

RagnaTheBroedge:

(not necessarily sure if this would be the correct place to put this, since it's not really a tech issue and thus wouldn't go in help, but oh well)

I'm trying to create a random result with VCE events but I can't seem to get it right. I'm trying to make it simply choose a random number from 1 - 3 and then play the appropriate sound depending on what's chose. The events I have right now are as follows:

What's the correct way to do this? As I have it now, once the events are triggered the game just stutters for a few seconds before reporting too many onVariableFalse events. I'm guessing I messed something up somewhere and it's just going through the whole thing a billion times before giving up.
I know a ton of you have a lot of good

SkyHawk:

Change your false variables into onItemPickup.

Note: I am rather new to VCE so I am not entirely certain if that will work, but just through common sense it seems that'll do the trick.

SgtDaemon:

Also on The Modvariable space you need to use simply sound not <var:brick:sound> If it still doesn't work, try changing between OnVariable and Onvalue, because I always mix them up.

EDIT: at the end, when you definy which onVartrue or Onvarfalse events will be triggered, it is not a list. 4 5 doesnt mean use event line 4 and 5, it means use event line 4-5. This means you need to change 6 to 6 6.

RagnaTheBroedge:

yep, got it working now but it seems only capable of choosing between two sounds. if the third option is true the second one plays as well because it simply considers it larger. i also realized that this is really buggy and rather than choosing 1, 2, or 3, it just chooses a random ass decimal between 0 and 1? hell, it still works.

thanks for the help lads, though if anyone has ideas for a way to get it to work with 3 choices, that'd be nice.

Lugnut:

put this line at the very top:onItemPickup > Self > VCE_ModVariable [ Brick ] [ sound ] [ set ] [ 0 ]

Pages: (1/2) > >>

Go to full version