Blockland Forums > Modification Help
Recolor question 2
Tom:
You will need to get the bricks colorID (%brick.colorID) then use getColorIdTable(%colorID); to determine the RGB color of it. Then you will need to set the zombies color to that.
lordician:
--- Quote from: Tom on August 03, 2010, 06:46:06 PM ---You will need to get the bricks colorID (%brick.colorID) then use getColorIdTable(%colorID); to determine the RGB color of it. Then you will need to set the zombies color to that.
--- End quote ---
Usefull for something else i am working on, but not for this.
But thanks anyway.
Tom:
Oh sorry, I was confused about what you wanted.
I don't really see anything wrong with the script, maybe you could stick a few echos in their to see where the problem is happening.
--- Code: ---function Zombie::onAdd(%this,%obj)
{
echo("Zombie::onAdd was called!");
parent::onAdd(%this,%obj);
ZombieDefault::onAdd(%this,%obj);
//%obj.mountimage(rocketlauncherimage,0);
if(%obj.getClassName() $= "AIPlayer" && isObject(%brick = %obj.spawnBrick))
{
echo("The zombie is an AI player!");
if(%obj.spawnbrick.ReColorVehicle == 1)
{
echo("The spawnbrick has reColorVehicle set.");
%obj.schedule(100,setnodeColor,"ALL",%obj.getDataBlock().skinColor);
}
}
}
--- End code ---
If everything shows up in the console, then you problem have a problem with the setNodeColor schedule.
lordician:
--- Quote from: Tom on August 04, 2010, 07:40:23 PM ---Oh sorry, I was confused about what you wanted.
I don't really see anything wrong with the script, maybe you could stick a few echos in their to see where the problem is happening.
--- Code: ---function Zombie::onAdd(%this,%obj)
{
echo("Zombie::onAdd was called!");
parent::onAdd(%this,%obj);
ZombieDefault::onAdd(%this,%obj);
//%obj.mountimage(rocketlauncherimage,0);
if(%obj.getClassName() $= "AIPlayer" && isObject(%brick = %obj.spawnBrick))
{
echo("The zombie is an AI player!");
if(%obj.spawnbrick.ReColorVehicle == 1)
{
echo("The spawnbrick has reColorVehicle set.");
%obj.schedule(100,setnodeColor,"ALL",%obj.getDataBlock().skinColor);
}
}
}
--- End code ---
If everything shows up in the console, then you problem have a problem with the setNodeColor schedule.
--- End quote ---
I thought it was fine too, but i'll try that to check it. Thanks a lot.
lordician:
It only echo'd the first echo. :S
So, something's wrong with checking if the spawnbrick is an object.
Because i am sure, the AIplayer check works right.