How can I mount an AIPlayer to a player without breaking crouch?

Author Topic: How can I mount an AIPlayer to a player without breaking crouch?  (Read 1486 times)

I'm writing some code and I've hit somewhat of an annoying roadblock here. I'm trying to mount an AIPlayer to a player object, specifically to the chest/head/pants slots, but in doing so the player will often get stuck crouching. Is there a way to prevent this?

Searched a bit for a solution and didn't really find one. Any help would be appreciated. This is the playerdata dataBlock I'm using:


datablock playerData(thermalObjPlayer : PlayerStandardArmor)
{
    shapeFile = "./model/thermal/thermalObj_chest.dts";
   boundingBox = "0.01 0.01 0.01";
   deathSound = "";
   painSound = "";
   useCustomPainEffects = true;
   mountSound = "";
};

that's odd. maybe try mounting an empty.dts bot to the node you want, then mounting the thermalObj_chest bot to that empty.dts

I've done a lot of different testing to attempt to achieve this so I could use a second shape name on a player and have had no luck.

I tried every mount point on the default player and even used the empty.dts shape in a datablock but the player would still get stuck occasionally while crouching. I think the only way to do this is to have a custom m.dts with a far away mount point.

that's odd. maybe try mounting an empty.dts bot to the node you want, then mounting the thermalObj_chest bot to that empty.dts

Gave it a whirl earlier, no dice unfortunately. It's hard to reproduce the problem, it happens rarely when mounted to the hands, but almost always when mounted to the pants.

I think the only way to do this is to have a custom m.dts with a far away mount point.

Might be worth a shot, I'll look into it

i recommend setting the bots damage level to 100 packaging the body remove functions and make sure the bot has no pain effects, if you need the bot to have normal pain effects and normal death stuff, just create a second identical bot and swap it out, killing a bot will set its typemask to corpse and it will not collide with players

i recommend setting the bots damage level to 100 packaging the body remove functions and make sure the bot has no pain effects, if you need the bot to have normal pain effects and normal death stuff, just create a second identical bot and swap it out, killing a bot will set its typemask to corpse and it will not collide with players

This seems to be giving good results

By the way, is there a way to prevent playerMountSound from playing when I mount an AIPlayer to a player lol? mountSound = ""; doesn't seem to do the trick

It is in the default code.

package something like this
Code: [Select]
function armor::onMount(%db,%pl,%obj,%node)
{
if(%db == nameToId(thermalObjPlayer))
return;
return parent::onMount(%db,%pl,%obj,%node);
}


onMount does almost nothing except play the mount sound and you may need to call a transform function like %obj.setTransform("0 0 0 0 0 0 0");

but other than that it should be fine for the purposes of what you need
« Last Edit: May 04, 2017, 09:49:08 PM by Swollow »