Author Topic: Disabling Crouch for Player Type  (Read 1674 times)

How can I disable a specific player type from crouching or playing the animation while crouching? (While still allowing PlayerStandardArmor + Others to crouch)

I tried defining an 'mDTS2' which is like the mDTS TSShapeConstructor except that the animations for crouch, crouchRun, etc direct to root, run and the rest. When I tried this, I get [attached image] and the player jerking to face up and forwards whether you look up or down while holding the key.

m_portal.dts is m.dts copied/pasted into the same folder, so PlayerPortal uses the 'new' animation set rather than mDTS as it is already defined.

Code: [Select]
datablock TSShapeConstructor(mDts2 : mDTS) //No crouch animation
{
baseShape = "base/data/shapes/player/m_portal.dts";
  sequence5 = getWord(mdts.sequence0,0) SPC getWord(mDTS.sequence5,1);
sequence6 = getWord(mdts.sequence1,0) SPC getWord(mDTS.sequence6,1);
sequence7 = getWord(mdts.sequence3,0) SPC getWord(mDTS.sequence7,1);
sequence8 = getWord(mdts.sequence4,0) SPC getWord(mDTS.sequence8,1);
};

datablock PlayerData(PlayerPortal : PlayerStandardArmor)
{
shapeFile = "base/data/shapes/player/m_portal.dts";
maxDamage = 1;
maxEnergy = 59;
canJet = 0;
rechargeRate = 0.1;
airControl = 0.2;
jumpforce = PlayerStandardArmor.jumpforce * 0.67;
speedDamagescale = 0;
maxForwardCrouchSpeed = PlayerStandardArmor.maxForwardSpeed;
maxForwardBackwardSpeed = PlayerStandardArmor.maxBackSpeed;
    maxForwardSideSpeed = PlayerStandardArmor.maxSideSpeed;
crouchBoundingBox = PlayerStandardArmor.boundingBox;
uiName = "Portal-Style Player";
showEnergyBar = true;
};



Yes, but I don't want it to happen. Do either of you have any ideas?

what about playing a different animation altogether? Maybe to root rather then crouch.

That's what it is doing.
sequence5 = getWord(mdts.sequence0,0) SPC getWord(mDTS.sequence5,1);

That makes sequence5 "base/data/shapes/player/m_root.dsq crouch" i.e. the crouch animation set to be the root dsq rather than the crouch one.

Here's what Badspot suggested to me for doing something like this:

Quote from: Badspot
you probably want "crouch" to be m_root.dsq and crouchwalk or crouchforward or whatever it's called to be m_forward.dsq

I have already done that. That part in particular does work. It does disable you crouching. However, I get you forced 'standing up' rather than leaning over when looking down and holding crouch, and the "White Suit" glitch.

I have to use a model and TSShapeConstructor 'different' from m.dts to stop it overriding the Standard Player's crouch animations too (I only want it to affect PortalPlayer) but when I do it doesn't do the hidenodes correctly.

I see.  Hmm, I'd PM Badspot on this one.