Author Topic: setEmitter problem  (Read 562 times)

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:
Code: [Select]
if(%brick.setEmitter(BurnEmitterA))
               echo("GOOD");
            else
               echo("BAD");
and it echoes "BAD".
The rest of the code for this brick executes nicely though:
Code: [Select]
..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:
Code: [Select]
..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
Code: [Select]
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?
« Last Edit: July 16, 2010, 08:14:06 AM by Mystery Guy »

Does setEmitter have a return? I never checked, but I don't expect so. If not, then trying to check if it is True or False would always return False.

But the rest of the problem, I don't get.

setEmitter is a function not a variable
Package setEmitter

setEmitter is a function not a variable
Package setEmitter
No you're wrong, he's doing it right as it is.