Author Topic: Player Model As Item.  (Read 4763 times)

Only item datablocks have a onPickup, you have to make it pick up on collision. Also, if the model went down, it'd fall through the floor, unless you make the object static, but then it'd not be able to have commands...I haven't done stuff like that in a while. I MAYBE, MAYBE, wrong, but I think I remember it being like that.

I was able to pick it up the other day.

Most likely changed a script the wrong way...

Yeah ill run over it tonight.

I re-did the script. But i cant pick it up still. Any ideas?

function botItem::onAdd(%this,%a,%b,%c,%d,%e) //General arguments, just in case
{
for (%i = 0; %i <= $accentnum; %i++) %this.hideNode($accent[%i]);
for (%i = 0; %i <= $chestnum; %i++) %this.hideNode($chest[%i]);
for (%i = 0; %i <= $hatnum; %i++) %this.hideNode($hat[%i]);
for (%i = 0; %i <= $hipnum; %i++) %this.hideNode($hip[%i]);
for (%i = 0; %i <= $LArmnum; %i++) %this.hideNode($LArm[%i]);
for (%i = 0; %i <= $LHandnum; %i++) %this.hideNode($LHand[%i]);
for (%i = 0; %i <= $LLegnum; %i++) %this.hideNode($LLeg[%i]);
for (%i = 0; %i <= $packnum; %i++) %this.hideNode($pack[%i]);
for (%i = 0; %i <= $RArmnum; %i++) %this.hideNode($RArm[%i]);
for (%i = 0; %i <= $RHandnum; %i++) %this.hideNode($RHand[%i]);
for (%i = 0; %i <= $RLegnum; %i++) %this.hideNode($RLeg[%i]);
for (%i = 0; %i <= $secondPacknum; %i++) %this.hideNode($secondPack[%i]);
%player.hideNode("headSkin");
%player.hideNode("LSki");
%player.hideNode("RSki");
%player.hideNode("skirtTrimLeft");
%player.hideNode("skirtTrimRight");
%player.unhideNode("tank");
%player.setNodeColor("tank", "1 0.25 1 1");
}

In the case of items, %this is the datablock of the item. Also, where do you define %player?

* Rolland puts hands on head in an annoyed look

I give up, Space Guy, add %player var before %a and define it there, instead of changing the name of %a to %player midscript.