I'm trying to get a set of armor (headpoint and chestpoint) to work with a double handed weapon (mountpoint0 and mountpoint1)
The issue: using mountImage(image, slot) works except with slot 3, which for some handicapped reason disappears whenever taking damage or teleporting. This is the mountpoint for my helmet that im using.
Is there a better system for getting lhand + rhand + chest + headskin image mounting without one of them actually disappearing sometimes?
In order to effectively use head+chest armor in combination with akimbo weapons, the emitter mountpoint must be replaced. This is mountpoint 3 on the player, ie
%player.mountImage[/b](image, 3);The following code can be used to overwrite the emitter node so that it won't make chest-mounted armor disappear:
//$bodymount is 3
//isArmor should be a value given to the armor MountedImagefunction Player::mountImage(%player, %image, %slot, %loaded, %skin)
{
%image2 = %player.getMountedImage($bodyMount);
if(!(%image.stateEmitter[1] $= "")) //prevents spam from getclassname
{
if(%image.stateEmitter[1].getClassName() $= "ParticleEmitterData" && isObject(%image2) && %image2.isArmor)
{
//Disabling all emitter-based images will also disable the brick-trail. so we exclude this:
if(%image.stateEmitter[1] $= "brickTrailEmitter")
return parent::mountImage(%player, %image, %slot, %loaded, %skin);
//Everything else is ignored
return;
}
}
return parent::mountImage(%player, %image, %slot, %loaded, %skin);
}
Original code credit goes to JakeBlade and Darksaber for helping