Blockland Forums > Modification Help
setEmitter problem
(1/1)
Mystery Guy:
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: ---if(%brick.setEmitter(BurnEmitterA))
               echo("GOOD");
            else
               echo("BAD");
--- End code ---
and it echoes "BAD".
The rest of the code for this brick executes nicely though:

--- Code: ---..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...
--- End code ---
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: ---..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...

--- End code ---

Why would setRendering make it stop to work?

EDIT2:
I changed it to

--- Code: ---else if(%brickdb.isFish)
         {
            %brick.setRendering(0);
            %brick.setEmitter(BurnEmitterA);
            %brick.resources = %brickdb.resources;
            %brick.setColor(15);
            %brick.setColliding(0);
            %brick.setRaycasting(1);
         }
--- End code ---
And now it works? What did just happen?
MegaScientifical:
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.
ZSNO:
setEmitter is a function not a variable
Package setEmitter
Destiny/Zack0Wack0:

--- Quote from: ZSNO on July 16, 2010, 05:21:45 PM ---setEmitter is a function not a variable
Package setEmitter

--- End quote ---
No you're wrong, he's doing it right as it is.
Navigation
Message Index

Go to full version