Author Topic: Image mount on spawn?  (Read 660 times)

I have a weapon that I want to color shift the same color as the player's helmet's current color. Anyone know how to do this?
« Last Edit: August 11, 2009, 04:10:28 PM by Thorax »


Currently impossible.
By currently, do you mean this might be added in a future update?

There are no plans to implement this as of yet, but;

If you find something Badspot really wants badly then you can probably trade it to him for this feature to be implemented. Although I think anything he wants can be bought using funds from his bathtub of Blockland earnings so this may not be a viable plan.

On the flipside you can always blackmail Kompressor as he has some good leverage in that department. I suggest taking his cat Tiffany hostage. She never disappoints!

Ok then, I'm going to have to find another way. Don't be surprised if you see any pictures pop up of Tiffany balancing on very tall objects... Wearing socks!

I found another way, but I need some help.

Code: [Select]
datablock PlayerData(PlayerMjolnir : PlayerStandardArmor)
{
runForce = 48 * 90;
runEnergyDrain = 0;
minRunEnergy = 0;
maxForwardSpeed = 7;
maxBackwardSpeed = 4;
maxSideSpeed = 6;
maxForwardCrouchSpeed = 3;
maxBackwardCrouchSpeed = 2;
maxSideCrouchSpeed = 2;

minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;

uiName = "Mjolnir Armor Player";
maxDamage = "115";
showEnergyBar = true;
maxTools = "6";
maxItems = "6";
rechargeRate = "28.75";
};

datablock ShapeBaseImageData(HelmImage)
{
shapeFile = "./HelmGreen.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0.02 0.3";
eyeOffset = "0 0 0.4";
rotation = eulerToMatrix("0 0 0");
scale = "0.1 0.1 0.1";
doColorShift = true;
colorShiftColor = "0.034 0.069 0.069 1.000";
};

function serverCmdHelm(%client)
{
%player = %client.player;

if(isObject(%player))
{
if(%player.getMountedImage(2) $= nametoID(HelmImage))
{
%player.unmountImage(2);
%client.applyBodyParts();
%client.applyBodyColors();
}
else
{
%player.unmountImage(2);
%player.mountImage(MadHatterImage,2);

for(%i = 0;$hat[%i] !$= "";%i++)
{
%player.hideNode($hat[%i]);
%player.hideNode($accent[%i]);
}
}
}
}

I want it to mount the Helm when you spawn as the playertype, but I'm not sure how to do that.

Code: [Select]
function playerMjolnir::onAdd(%this, %obj)
{
   %obj.mountImage(2, HelmImage);
   parent::onAdd(%this, %obj);
}

It didn't work. Would you mind setting up the script exactly how it's supposed to be?

It didn't work because the way I set it up requires a minigame because you have to actually spawn as the playertype.
Code: [Select]
package mountOnSpawn
{
   function armor::changeDatablock(%this, %obj, %newData) //I think
   {
      if(%newData == playerMjolnir.getID())
      {
         %obj.mountImage(2, HelmImage);
      }
      parent::changeDatablock(%this, %obj, %newData);
   }
   function playerMjolnir::onAdd(%this, %obj)
   {
      %obj.mountImage(2, HelmImage);
      parent::onAdd(%this, %obj);
   }
};
activatePackage(mountOnSpawn);

It didn't work because the way I set it up requires a minigame because you have to actually spawn as the playertype.
Code: [Select]
package mountOnSpawn
{
   function armor::changeDatablock(%this, %obj, %newData) //I think
   {
      if(%newData == playerMjolnir.getID())
      {
         %obj.mountImage(2, HelmImage);
      }
      parent::changeDatablock(%this, %obj, %newData);
   }
   function playerMjolnir::onAdd(%this, %obj)
   {
      %obj.mountImage(2, HelmImage);
      parent::onAdd(%this, %obj);
   }
};
activatePackage(mountOnSpawn);

I was using a minigame and did spawn as the playertype. But whatever. Thanks again.

Still not working. I modified Warren's Mad Hatter Hat and it worked perfectly,  but other than that, it won't load with the playertype.