Author Topic: A way to randomly pick named bricks  (Read 3462 times)

So basically what i want is some sort of event or system that picks from named bricks at random.

For example if i have 5 bricks each named "Brick", the event would pick one of those 5 named bricks to do an output event on.

could go in this order possibly? OnActivate-NamedBrick[Brick][Random]-SetRendering

Where [Random] is a secondary box where you can set whether it chooses the named bricks randomly or not.


Neat idea and all, but
-you'd need a client and server mod for this
--which would need to completely rewrite the event system
-you'd need to change the format that events save/load
--which would need to completely rewrite the save/load system

Neat idea and all, but
-you'd need a client and server mod for this
--which would need to completely rewrite the event system
-you'd need to change the format that events save/load
--which would need to completely rewrite the save/load system
Alright, do we have alternatives?

Perhaps instead of the random picking of named bricks, we could use a system that would pick events in chronological order.
So if we had Brick1,2,3,4 and 5 and wanted to go through the list everytime OnActivate is called.

OnActivate-Namedbrick[Brick][1][5]-SetRendering


Where [1] and [5] are the starting and end points in the list that the system would choose from.

So on first activate it would use Brick1
Second activate it would use Brick2
Third it would use Brick3 and so on.

Neat idea and all, but
-you'd need a client and server mod for this
--which would need to completely rewrite the event system
-you'd need to change the format that events save/load
--which would need to completely rewrite the save/load system
you might be able to do this with just a server mod

you could detect when a new named brick "namedbrick" is made, and make a matching "namedbrick - random", and then check when any targets are a named brick with " - random" and apply it to a random "namedbrick" instead
this would use the current default GUI system, and have the server figure out what needs to be done

Alright, do we have alternatives?

Perhaps instead of the random picking of named bricks, we could use a system that would pick events in chronological order.
So if we had Brick1,2,3,4 and 5 and wanted to go through the list everytime OnActivate is called.

OnActivate-Namedbrick[Brick][1][5]-SetRendering


Where [1] and [5] are the starting and end points in the list that the system would choose from.

So on first activate it would use Brick1
Second activate it would use Brick2
Third it would use Brick3 and so on.
Still poses the same problems.

you might be able to do this with just a server mod

you could detect when a new named brick "namedbrick" is made, and make a matching "namedbrick - random", and then check when any targets are a named brick with " - random" and apply it to a random "namedbrick" instead
this would use the current default GUI system, and have the server figure out what needs to be done
Good idea on the name part. Though, that further complicates the rewriting the event system part.

Don't forget that Badspot has blocked some of the event request commands so it may not be possible to rewrite them in a way (there may be a way around this but probably can't release it here). I hate when these commands are blocked, they have some good use.

I'll make this.

It'll work like this:
onActivate > Self > pickRandNamedBrick > [BRICK NAME]
onPickRandNamedBrick > Brick > setRendering > [  ]
« Last Edit: August 08, 2016, 08:58:38 AM by jes00 »

Definitely the best solution

I'll make this.

It'll work like this:
onActivate > Self > pickRandNamedBrick > [BRICK NAME]
onPickRandNamedBrick > Brick > setRendering > [  ]
may want to have an input on which events to trigger, that way you can do things like
0 onactivate > self > pickrand > [floor][3 4]
1 onplayertouch > self > pickrand > [wall][4]
2 onprojectilehit > self > pickrand > [ceiling][5]
3 onpick > brick > disappear
4 onpick > brick > setcolor
5 onpick > brick > explode

this is possible with normal default events
you just need to make a slot machine mechanis

this is possible with normal default events
you just need to make a slot machine mechanis
I really enjoy solving things like this with just default events and using the randomness of projectiles
but I think the point of this suggestion is to streamline the process as much as possible

there was something here
« Last Edit: August 10, 2016, 03:05:09 PM by _OXBADCODE# »

It's not possible doing what OP said without rewriting the events but it's still possible doing another method

welp
when vibrator visolator says it's impossible
then i am sorry

Read the whole thread.