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

I want the armor as a weapons item so i've got the Player Model as The Item's dts but how do i hide its nodes because well theres no variable in datablocks.

Code: [Select]
function JetOItem::onAdd(%this,%a,%b,%c,%d,%e) //General arguments, just in case
{
%player=%a;
for (%i = 0; $accent[%i] !$= ""; %i++) %player.hideNode($accent[%i]);
for (%i = 0; $chest[%i] !$= ""; %i++) %player.hideNode($chest[%i]);
for (%i = 0; $hat[%i] !$= ""; %i++) %player.hideNode($hat[%i]);
for (%i = 0; $hip[%i] !$= ""; %i++) %player.hideNode($hip[%i]);
for (%i = 0; $LArm[%i] !$= ""; %i++) %player.hideNode($LArm[%i]);
for (%i = 0; $LHand[%i] !$= ""; %i++) %player.hideNode($LHand[%i]);
for (%i = 0; $LLeg[%i] !$= ""; %i++) %player.hideNode($LLeg[%i]);
for (%i = 0; $pack[%i] !$= ""; %i++) %player.hideNode($pack[%i]);
for (%i = 0; $RArm[%i] !$= ""; %i++) %player.hideNode($RArm[%i]);
for (%i = 0; $RHand[%i] !$= ""; %i++) %player.hideNode($RHand[%i]);
for (%i = 0; $RLeg[%i] !$= ""; %i++) %player.hideNode($RLeg[%i]);
for (%i = 0; $secondPack[%i] !$= ""; %i++) %player.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");
}

And set the item model to the player. (base/data/shapes/m.dts)

JetOItem is a in-testing jetpack I won't be releasing, probably. I think it only uses %this (Datablock) and %a (Item), but other variables exist just in case.

I'm not exactly sure on this code since it seems to make the model only have unhidden nodes, not colours - try removing the line about setNodeColor and change the colorshift of the item.

Okay, Thanks shall try that now.

Didnt Change it at all Still looks like this:
« Last Edit: July 03, 2007, 12:02:00 PM by MrPickel »



Code: [Select]
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");
}

All you done was change the name of thing. Hmm, Idea. Oh wait you added the Global Variables aswell. That dont work.
« Last Edit: July 04, 2007, 11:06:22 AM by MrPickel »

Try the %player = %a; as %b or maybe %this.

Ok, I realised i was doing something wrong with Space's. I was putting BodyArmor Instead of BodyArmorItem. But now i cant pick the item up and is there a way to make the pick up bit go down a bit.

All you done was change the name of thing. Hmm, Idea. Oh wait you added the Global Variables aswell. That dont work.
I fixed it, he was using the SECOND variable instead of %this, so I fixed that. I renamed it for you, and made the loops more efficient. It should work now, don't just start at the top of the code and the first change go "All you did was the first change I even bothered to look at before giving up on reading because I fail"

That dont work.

Space Guys' works.

Is there a way to make the model come down a bit and also i cant pick it up?

But mine is more efficient :'( They both work, but his was put together weird as F. I mean, he doesn't use %this, he uses %a and renames it.

So? It does what i want it to do.


Is there a way to make the model come down a bit and also i cant pick it up?