I'm fairly new to scripting with Torque, and was wondering how to detect when a brick has been rendered after being generated via scripts? I noticed there is a delay between generating a brick (creating the object and collision box) and actually rendering it. This is what I was thinking (just taking a single column into account for now), but it doesn't initiate the echo command:
for(%cz=0;%cz<=%RowHFSB;%cz=%cz+2)
{
%brick = new fxDTSbrick()
{
datablock = brick4xCubeData;
colorID = 45;colorFXID = 0;shapefxID = 0;isPlanted = 1;rotation = "0 0 0 0";scale = "1 1 1";angleID = 0;
client = %client;stackBL_ID = %client.bl_id;
position = (%cpx+%cx) @ " " @ (%cpy+%cy) @ " " @ %cz;
};
%simgroup = new simGroup(){name = "Server";bl_id = %client.bl_id;};
mainBrickGroup.add( %simgroup );
%simgroup.add( %brick );
%brick.setTrusted(1);%brick.plant();%brick.setRayCasting(0);%brick.setColliding(0);
}
if(%brick.setRendering==true)
{
echo("brick rendered!");
}
I was hoping to create a chunk-based terrain generation script that waits for all the bricks (or just the last brick) in a single chunk to be rendered before moving on to the next chunk - otherwise the game freezes. Thanks!