Blockland Forums > Modification Help
Node coloring
(1/4) > >>
pecon98:
Alright, so I have this AI I am trying to color every node black. I thought this was done by setting all the color codes to 0, however that just resulted in making all the nodes white.

--- Code: --- %obj.name = "Renderman";
%obj.chestcolor = "1 .0 0 0";
%obj.hatcolor = "1 .0 0 0";
%obj.rarmcolor = "1 .0 0 0";
%obj.larmcolor = "1 .0 0 0";
%obj.hipcolor = "1 .0 0 0";
%obj.llegcolor = "1 .0 0 0";
%obj.rlegcolor = "1 .0 0 0";

%obj.chest = "0";
%obj.lhand = "0";
%obj.rhand = "0";
%obj.larm = "0";
%obj.rarm = "0";
%obj.hat = "0";
%obj.accent = "0";
%obj.pack = "0";
%obj.secondpack = "0";
%obj.lleg = "0";
%obj.rleg = "0";
%obj.hip = "0";

GameConnection::ApplyBodyParts(%obj);
GameConnection::ApplyBodyColors(%obj);
%obj.setfacename("asciiTerror");
%obj.setdecalname("Mod-Suitblack");
%color = %obj.getdatablock().skincolor;
%obj.setNodecolor($rhand[0], %color);
%obj.setNodecolor($lhand[0], %color);
%obj.setNodecolor("headskin", %color);
--- End code ---

Can anyone tell me what I'm doing wrong or fix it?
Demian:
That color code makes no sense. Try either "0 0 0" or "0 0 0 1".
Headcrab Zombie:
Also,

--- Code: ---        GameConnection::ApplyBodyParts(%obj);
GameConnection::ApplyBodyColors(%obj);

--- End code ---
Should be


--- Code: ---        %obj.ApplyBodyParts();
        %obj.ApplyBodyColors();

--- End code ---
and I'm not sure what you're trying to do with all the code after that part, those are all set by the .applyBody_____()



I have something that uses a bot with a customized appearance, here's all the code I have for it to spawn on map load, and automatically respawn if it dies


--- Code: ---package AdambotBody
{
function AIConnection::spawnPlayer(%this,%location)
{
if(%this $= Adambot)
{
%this.player = new AIPlayer()
{
datablock = PlayerStandardArmor;
};
%this.player.client = %this;
%this.player.setTransform(%location);
%this.applyBodyParts();
%this.applyBodyColors();
%this.player.setScale("0.7 0.7 0.7");
}
else
Parent::spawnPlayer(%this,%location);
}

function AIConnection::onDeath(%this,%obj,%name,%something,%location)
{
if(%this $= Adambot)
%this.spawnPlayer(pickSpawnLocation());
else
Parent::spawnPlayer(%this,%obj,%name,%something,%location);
}

function onMissionLoaded()
{
Parent::onMissionLoaded();
new AIConnection(Adambot){};
Adambot.chestColor = "0.078 0.078 0.078 1";
Adambot.decalName = "Mod-Suit";
Adambot.faceName = "smiley";
Adambot.headColor = "1 0.878 0.611 1";
Adambot.hidColor = "0.078 0.078 0.078 1";
Adambot.larmColor = "0.078 0.078 0.078 1";
Adambot.lhandColor = "1 0.878 0.611 1";
Adambot.llegColor = "0.078 0.078 0.078 1";
Adambot.rarmColor = "0.078 0.078 0.078 1";
Adambot.rhandColor = "1 0.878 0.611 1";
Adambot.rlegColor = "0.078 0.078 0.078 1";
Adambot.name = "Adambot";
Adambot.netName = "Adambot";
Adambot.spawnPlayer(pickSpawnPoint());
AdambotBody::Tick();
}

function onServerDestroyed()
{
Parent::onServerDestroyed();
Adambot.delete();
}
};
Activatepackage(AdambotBody);

--- End code ---
Greek2me:
You guys are thinking about this too hard.


--- Code: ---package blah
{
function GameConnection::applyBodyColors(%this)
{
parent::applyBodyColors(%this);
%this.player.setNodeColor("ALL","0 0 0 1");
}
};
activatePackage(blah);
--- End code ---
pecon98:

--- Quote from: Greek2me on September 14, 2011, 05:26:23 PM ---You guys are thinking about this too hard.


--- Code: ---package blah
{
function GameConnection::applyBodyColors(%this)
{
parent::applyBodyColors(%this);
%this.player.setNodeColor("ALL","0 0 0 1");
}
};
activatePackage(blah);
--- End code ---

--- End quote ---

Didn't seem to work.

--- Quote from: console ---Add-Ons/Ai_Renderman/Ai_Renderman.cs (0): Unable to find object: '' attempting to call function 'setNodeColor'
BackTrace: ->Kingfy->[blah]GameConnection::ApplyBodyColors
--- End quote ---
Navigation
Message Index
Next page

Go to full version