Page MenuHomeFeedback Tracker

does not work properly fuction ForceStance (STANCEIDX_RAISEDERECT or STANCEIDX_RAISEDCROUCH or STANCEIDX_RAISEDPRONE) class HumanCommandMove
Reviewed, UrgentPublic

Description

does not work properly fuction ForceStance class HumanCommandMove

unit.GetCommand_Move().ForceStance(DayZPlayerConstants.STANCEIDX_RAISED);
unit.GetCommand_Move().ForceStance(DayZPlayerConstants.STANCEIDX_RAISEDERECT);
unit.GetCommand_Move().ForceStance(DayZPlayerConstants.STANCEIDX_RAISEDCROUCH);
unit.GetCommand_Move().ForceStance(DayZPlayerConstants.STANCEIDX_RAISEDPRONE);

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General
Steps To Reproduce

unit.GetCommand_Move().ForceStance(DayZPlayerConstants.STANCEIDX_RAISED);
unit.GetCommand_Move().ForceStance(DayZPlayerConstants.STANCEIDX_RAISEDERECT);
unit.GetCommand_Move().ForceStance(DayZPlayerConstants.STANCEIDX_RAISEDCROUCH);
unit.GetCommand_Move().ForceStance(DayZPlayerConstants.STANCEIDX_RAISEDPRONE);

not working this code

Event Timeline

nlaak created this task.Feb 24 2024, 2:07 PM

I confirm that after trying to raise your hands, this state is immediately reset

VasliyP added a comment.EditedFeb 25 2024, 8:18 PM

int unit_Raised;

void Raised()
{

		HumanAnimInterface hai = m_Unit.GetAnimInterface();
		if (!hai) return;
		
		unit_Raised = hai.BindVariableBool( "Raised" );
		
		if (!m_Unit.IsRaised())
			m_Unit.AnimSetBool(unit_Raised, true);

}

This option doesn’t work either; when you try to pick up a weapon, the animation immediately resets
in the previous version everything worked fine

Geez added a subscriber: Geez.Feb 27 2024, 11:47 AM

Hello everyone.
Sounds like what you want to be using is HumanInputController.OverrideRaise. Here is some example code that works:

modded class PlayerBase
{
	override void CommandHandler(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
	{
		HumanInputController hic = GetInputController();

		float movementSpeed;
		vector movementDirection;
		hic.GetMovement(movementSpeed, movementDirection);

		// Only raise if player is moving
		if (movementSpeed > 0)
		{
			hic.OverrideRaise(HumanInputControllerOverrideType.ONE_FRAME, true);
		}

		super.CommandHandler(pDt, pCurrentCommandID, pCurrentCommandFinished);
	}
}
Geez changed the task status from New to Reviewed.Feb 27 2024, 11:48 AM
This comment was removed by VasliyP.
VasliyP added a comment.EditedFeb 27 2024, 12:51 PM

Hello everyone.
Sounds like what you want to be using is HumanInputController.OverrideRaise. Here is some example code that works:

modded class PlayerBase
{
	override void CommandHandler(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
	{
		HumanInputController hic = GetInputController();

		float movementSpeed;
		vector movementDirection;
		hic.GetMovement(movementSpeed, movementDirection);

		// Only raise if player is moving
		if (movementSpeed > 0)
		{
			hic.OverrideRaise(HumanInputControllerOverrideType.ONE_FRAME, true);
		}

		super.CommandHandler(pDt, pCurrentCommandID, pCurrentCommandFinished);
	}
}

This is understandable, but what to do if the unit must stand still?
Unfortunately this does not work, or rather it only works on the player and probably only on the client side(

This comment was removed by VasliyP.
This comment was removed by VasliyP.
nlaak added a comment.Feb 27 2024, 8:47 PM

only on the client side.

This comment was removed by VasliyP.
nlaak added a comment.EditedFeb 27 2024, 9:33 PM

interesting behavior of the function
the function runs on the server

unit.GetCommand_Move().ForceStance(32); unit raise or unit hide
unit.GetCommand_Move().ForceStance(33);
unit raise or unit hide
unit.GetCommand_Move().ForceStance(34); unit raise or unit hide
unit.GetCommand_Move().ForceStance(35);
unit hide

It looks like DayZPlayerConstants.STANCEIDX_RAISED and the like can no longer be used((

jobbg added a subscriber: jobbg.Feb 28 2024, 1:54 PM

Already got you

I still have a question: will the normal operation of DayZPlayerConstants.STANCEIDX_RAISED and the like be fixed?

nlaak added a comment.Feb 28 2024, 9:16 PM

will the normal operation of DayZPlayerConstants.STANCEIDX_RAISED and the like be fixed?

It would be very good if you make the OverrideRaise(HumanInputControllerOverrideType.ONE_FRAME, true) function work not only on the client, but also on the server

Please fix this bug... Please..

Apparently we won't get an answer)))

VasliyP added a comment.EditedMar 11 2024, 6:07 PM

Hello everyone.
Sounds like what you want to be using is HumanInputController.OverrideRaise. Here is some example code that works:

modded class PlayerBase
{
	override void CommandHandler(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
	{
		HumanInputController hic = GetInputController();

		float movementSpeed;
		vector movementDirection;
		hic.GetMovement(movementSpeed, movementDirection);

		// Only raise if player is moving
		if (movementSpeed > 0)
		{
			hic.OverrideRaise(HumanInputControllerOverrideType.ONE_FRAME, true);
		}

		super.CommandHandler(pDt, pCurrentCommandID, pCurrentCommandFinished);
	}

}

How can I make this work on the server and not on the client?

Has there been a solution to this problem?