I tried to make a brick have a different emitter when it's planted, but I didn't manage to, as it just didn't seem to set, I tested it, using:
if(%brick.setEmitter(BurnEmitterA))
echo("GOOD");
else
echo("BAD");
and it echoes "BAD".
The rest of the code for this brick executes nicely though:
..etc
else if(%brickdb.isFish)
{
if(%brick.setEmitter(BurnEmitterA))
echo("GOOD");
else
echo("BAD");
%brick.resources = %brickdb.resources;
%brick.setColor(15);
%brick.setColliding(0);
%brick.setRendering(0);
}
etc...
It sets the color to 15, collision off and rendering off, but not the emitter part.
Did I do something obvious wrong?
EDIT:
I managed to isolate the cause, by using comments:
..etc
else if(%brickdb.isFish)
{
%brick.setEmitter(BurnEmitterA);
%brick.resources = %brickdb.resources;
%brick.setColor(15);
%brick.setColliding(0);
//%brick.setRendering(0);
%brick.setRaycasting(1);
}
etc...
Why would setRendering make it stop to work?
EDIT2:
I changed it to
else if(%brickdb.isFish)
{
%brick.setRendering(0);
%brick.setEmitter(BurnEmitterA);
%brick.resources = %brickdb.resources;
%brick.setColor(15);
%brick.setColliding(0);
%brick.setRaycasting(1);
}
And now it works? What did just happen?