Author Topic: 30000+ Bricks Eventing  (Read 970 times)

Alright: I'm making a railway and basically I forgeted up big time. I need to make about 30000 - 50000 bricks all be  have collision on.

Luckily I named all the railway tracks 'rails'. The problem is when I do the basic OnActivate > NamedBrick > SetColliding > CheckBox it says to many events. I try to raise the schedule amount but I think it's to high sadly.

Please help me. :c

modify this
This will only work for the default colorset, and YOUR bricks.

%bg=localClientConnection.brickgroup; for(%x=0;%x<%bg.getCount();%x++){%b=%bg.getObject(%x);if(%b.getColorID() == 2){%b.setColliding(0);%b.setRayCasting(0);}}

All of that on one line.

modify this
Let me break this up for you.

Code: [Select]
%bg=localClientConnection.brickgroup; for(%x=0;%x<%bg.getCount();%x++){%b=%bg.getObject(%x);if(%b.getColorID() == 2){%b.setColliding(0);%b.setRayCasting(0);}}
Code: [Select]
%bg=localClientConnection.brickgroup;This defines %bg as your brick group. In case you didn't know, blockland breaks up all the bricks into ownership as per brickgroup_blidhere
EG:Brickgroup_16807

Code: [Select]
for(%x=0;%x<%bg.getCount();%x++)
This loops through every brick in your brickgroup and does the stuff within the brackets.

Code: [Select]
{%b=%bg.getObject(%x);%b is the brick, you can do anything with the brick from here. You could destroy them all, fakekill them all, etc.

Code: [Select]
if(%b.getColorID() == 2)
This is an if statement. If the statement inside of the parenthesis is correct, do the stuff inside of the brackets. "getColorID()" will return the color ID of the brick. In most colorsets, red is 0. In any colorset, the color in the top left of your paint pallet will be 0, followed by 1 (going down)

Code: [Select]
{%b.setColliding(0);%b.setRayCasting(0);}
This is sort of self explanatory.