Author Topic: is there any way i can disable crouching with a playertype  (Read 2062 times)

ummmm m m i ts th      tytle?

ya, set crouch bounding box to the same as standing, as well as all the crouch max movement speeds. then remove the anim from the playertype model - you may need to make a copy of m.dts and all its animations/ifls minus the crouch (replaced with a renamed copy of root anim) in the playertype addon

ya, set crouch bounding box to the same as standing, as well as all the crouch max movement speeds. then remove the anim from the playertype model - you may need to make a copy of m.dts and all its animations/ifls minus the crouch (replaced with a renamed copy of root anim) in the playertype addon
idk why you would have to use a renamed copy of the root.dsq, you could just specify the crouch animation as the root.dsq couldn't you?

Actually, instead of copying all that and packaging it with the add-on... A better way to do it would be to do something like this...

Code: [Select]
if(!isFile("base/data/shapes/player/mNC.dts"))
fileCopy("base/data/shapes/player/m.dts","base/data/shapes/player/mNC.dts");
datablock TSShapeConstructor(mNCDts : mDts)
{
baseShape = "base/data/shapes/player/mNC.dts";
sequence5 = "base/data/shapes/player/m_root.dsq crouch";
sequence6 = "base/data/shapes/player/m_run.dsq crouchRun";
sequence7 = "base/data/shapes/player/m_back.dsq crouchBack";
sequence8 = "base/data/shapes/player/m_side.dsq crouchSide";
};

Then you just gotta worry about the datablock, and all the functions that specifically check for m.dts, like GameConnection::applyBodyParts and GameConnection::applyBodyColors.
You also wouldn't want to use the root animation otherwise they'll just start sliding while crouching.

idk why you would have to use a renamed copy of the root.dsq, you could just specify the crouch animation as the root.dsq couldn't you?

With the method of copying everything over, you would have to actually copy and rename everything over. Can't give a proper explanation other than "TSShapeConstructors are loving weird" because they want everything to be in the same folder as the shape and have a completely unique name no matter it's location.

Are you sure fileCopy can copy files w/ null bytes? I want to say that it can't.

You also wouldn't want to use the root animation otherwise they'll just start sliding while crouching.
why not just set crouch forward, side, and back speeds to 0 and make it use the root animation. then the player cannot crouch (or even move) while holding shift (or whatever their crouch button is)

Code: [Select]
datablock TSShapeConstructor(mNCDts : mDts)
{
baseShape = "base/data/shapes/player/mNC.dts";
sequence5 = "base/data/shapes/player/m_root.dsq crouch";
sequence6 = "base/data/shapes/player/m_root.dsq crouchRun";
sequence7 = "base/data/shapes/player/m_root.dsq crouchBack";
sequence8 = "base/data/shapes/player/m_root.dsq crouchSide";
};

Code: [Select]
datablock PlayerData(PlayerNoCrouch : PlayerStandardArmor)
{
        maxForwardCrouchSpeed = 0;
maxBackwardCrouchSpeed = 0;
maxSideCrouchSpeed =  0;
}

?

Are you sure that really works Goth?

why not just set crouch forward, side, and back speeds to 0 and make it use the root animation. then the player cannot crouch (or even move) while holding shift (or whatever their crouch button is)

Code: [Select]
datablock TSShapeConstructor(mNCDts : mDts)
{
baseShape = "base/data/shapes/player/mNC.dts";
sequence5 = "base/data/shapes/player/m_root.dsq crouch";
sequence6 = "base/data/shapes/player/m_root.dsq crouchRun";
sequence7 = "base/data/shapes/player/m_root.dsq crouchBack";
sequence8 = "base/data/shapes/player/m_root.dsq crouchSide";
};

Code: [Select]
datablock PlayerData(PlayerNoCrouch : PlayerStandardArmor)
{
        maxForwardCrouchSpeed = 0;
maxBackwardCrouchSpeed = 0;
maxSideCrouchSpeed =  0;
}

?

why would you disable movement while “crouched” though

You would think
Code: [Select]
allowCrouching = false; would work because it's literally in the TorqueScript documentation but for some reason it just doesn't.

Are you sure fileCopy can copy files w/ null bytes? I want to say that it can't.
It can.

You would think
Code: [Select]
allowCrouching = false; would work because it's literally in the TorqueScript documentation but for some reason it just doesn't.
Lmao I'm loving handicapped. This is for Torque 3D. Carry on