Author Topic: An Eventing Question  (Read 586 times)

Hia

So i'm trying to make multiple bricks that will spawn a key at the beginning of each mini game, but the key will be in one of the random selected location.

How could this be done?


have a setup where there are 4 plates in a line, each evented to spawn a key at one of each different location

above the plates, have a brick evented to release a pong projectile with a spread wide enough so that it can fire a projectile that could end up hitting any one of those 4 plates. Or, have it have a 100% random spread (on the same plane as the plates) and bound the setup with bricks so the pong projectile will eventually hit one of the evented plates.

have the pong brick fire one projectile every time the minigame resets.

EDIT: goddamnit fastlex

find a way to use vce's randomdice
i haven't vce'd in forever but it can be done with that

a simple way could be to name them all the same thing, and use VCE to give that named brick (which is actually several named bricks) a random chance of gaining a variable (with a diceroll, like aromania mentioned), and if that variable is true I guess, then make it do acheck that adds the item
but I dunno how to make sure it only spawns on one brick, or how to make sure it spawns on at least one
besides that, it's probably a really bad way to do it lol
and I'm really not sure if what I said would even work, I'd have to mess around in the game to really get you some definite stuff, which I'm probably not going to do at this hour

I'm not sure if the event to spawn an item on a brick is default or not, but I know VCE isn't (although, imo, it should be, especially since he's added other player-made addons), so you'll have to get that
« Last Edit: April 05, 2013, 11:09:02 PM by Night Fox »

event to set a brick's item is default.

event to set a brick's item is default.
ah, thanks. I get confused, because I always have so many event mods installed lol

For reference on how to correctly get a random number:
(Considering it's not extremely obvious)
Look, to randomize vce:

Don't ever forget to set the variable you're trying to 0 first, it acts as the minimum number. If you don't set it, it gives you a number between null and whatever number you put into the other box. This normally returns something like 0.123847523

Here's the correct way to get a random number
Code: [Select]
OnActivate -> self -> vce_modvariable var set 0   //This sets the minimum to 0
OnActivate -> self -> vce_modvariable var rand 10    //This generates a number between the value of 'var' and 10, setting the result to the variable 'var'
OnActivate -> client -> centerprint  <var:br:var>



oh lol
random dice is gay anyway this sounds much better

You could make a projectile randomizer.
Here is a nice example.
http://www.youtube.com/watch?v=6DGqdg5v48c&list=UU6PB2OvVe4Lr9pPScJsPivw&index=5
have a setup where there are 4 plates in a line, each evented to spawn a key at one of each different location

above the plates, have a brick evented to release a pong projectile with a spread wide enough so that it can fire a projectile that could end up hitting any one of those 4 plates. Or, have it have a 100% random spread (on the same plane as the plates) and bound the setup with bricks so the pong projectile will eventually hit one of the evented plates.

have the pong brick fire one projectile every time the minigame resets.

EDIT: goddamnit fastlex
^^^
do this

Spawning a projectile generates a random location to spawn it.