Author Topic: Santa hat mod not working?  (Read 1659 times)

I want it so you can type /SantaHat and it'll be on your head, but i didn't get a chance to find out the mount point for the head, so i just left it at 1 (Left hand), but i typed /SantaHat, but it didn't even appear in my left hand, why?

Code: [Select]
//Santa's hat mod by Masterlegodude

datablock ShapeBaseImageData(SantaHatImage)
{
   // Basic Item properties
   shapeFile = "./Shapes/Santahat.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 1;
   offset = "0 0 0";
   eyeOffset = 0; //"0.7 1.2 -0.5";
   rotation = eulerToMatrix( "0 0 90" );
   scale = "3 3 3";
   offset = "0.5 0.1 0";

   doColorShift = true;
   colorShiftColor = "1.000 0.000 0.000 1.000";

};

function serverCmdSantaHat(%Client,%Arg)
{
 %obj.mountImage(SantaHatImage,1);
}

I've got the model in the Shapes folder, same name as it is in the script, i added a joint to the model named mountPoint, it should atleast appear in my left hand, yes it is checked in the Add-Ons

Quote
//Santa's hat mod by Masterlegodude

datablock ShapeBaseImageData(SantaHatImage)
{
   // Basic Item properties
   shapeFile = "./Shapes/Santahat.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = $HeadSlot;
   offset = "0 0 0";
   eyeOffset = 0; //"0.7 1.2 -0.5";
   rotation = eulerToMatrix( "0 0 90" );
   scale = "3 3 3";
   offset = "0.5 0.1 0";

   doColorShift = true;
   colorShiftColor = "1.000 0.000 0.000 1.000";

};

function serverCmdSantaHat(%Client,%Arg)
{
if(isObject(%client.player))
 {
 %client.player.mountImage(SantaHatImage,2);
 }

}
To code fixers, the slot I am mounting it in is '2' so it isn't cancelled by Add-Ons which mount things in left hand (Shield, Dual Guns) and so it isn't overridden by things such as /hate or /alarm. The mountPoint in the image doesn't have to be the same as the slot in ShapeBase::mountImage.
« Last Edit: December 05, 2007, 11:05:14 AM by Space Guy »

Hmm, how would i modify the script so it would un-equip any head gear, like the cop hat, space helmet and all those others?

I've modified the offset and rotation
Code: [Select]
//Santa's hat mod by Masterlegodude

datablock ShapeBaseImageData(SantaHatImage)
{
   // Basic Item properties
   shapeFile = "./Shapes/Santahat.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = $HeadSlot;
   offset = "0 0 0.2";
   eyeOffset = 0; //"0.7 1.2 -0.5";
   rotation = eulerToMatrix( "0 0 0" );
   scale = "3 3 3";

   doColorShift = true;
   colorShiftColor = "1.000 0.000 0.000 1.000";

};

function serverCmdSantaHat(%Client,%Arg)
{
if(isObject(%client.player))
 {
 %client.player.mountImage(SantaHatImage,2);
 }
}

Quote
//Santa's hat mod by Masterlegodude

datablock ShapeBaseImageData(SantaHatImage)
{
   // Basic Item properties
   shapeFile = "./Shapes/Santahat.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = $HeadSlot;
   offset = "0 0 0.2";
   eyeOffset = 0; //"0.7 1.2 -0.5";
   rotation = eulerToMatrix( "0 0 0" );
   scale = "3 3 3";

   doColorShift = true;
   colorShiftColor = "1.000 0.000 0.000 1.000";

};

function serverCmdSantaHat(%Client,%Arg)
{
 if(isObject(%client.player))
 {
  %player = %client.player;
  %player.mountImage(SantaHatImage,2);
  for (%i = 0; $hat[%i] !$= ""; %i++) %player.hideNode($hat[%i]);
 }
}

Ah, cool, thanks, i'll try it out

Also, i forgot to mention, i also want a command that gets rid of the Santa hat so you wouldn't need to Self Delete it off

Sorry to bug ya

There's also a tiny glitch, the hat comes back if you change your hat or put the same hat back on
« Last Edit: December 05, 2007, 11:45:53 AM by Masterlegodude »

Plus accents won't be hidden.