yrex wrote:Okay, I've just found a better way. Unlike the previous one, it shouldn't cause slowdowns. Although there's a limit of number of gibs getting spawned during one frame.Code: Select all
var Actor PendingActors[64];
var int PendingActorsCount;
simulated event Actor SpawnNotification(Actor A)
{
...
if(A.Class.Name == 'olCreatureChunks')
{
if(PendingActorsCount<64)
{
PendingActors[PendingActorsCount] = A;
PendingActorsCount++;
}
return;
}
...
}
function Tick(float deltaTime)
{
local int i;
local actor A;
for(i=0;i<PendingActorsCount;i++)
{
A = PendingActors[i];
// Do stuff with A.
}
PendingActorsCount = 0;
}
I see two sections with '...' in your code above. I know the gib code should be copied in to one of those sections, but what is the other section for? I am just not sure what to replace the ... with. Maybe a quick note for me as to what goes there would be great. Thanks.