Page MenuHomeFeedback Tracker

StartCommand_Script is not working correctly
Closed, ResolvedPublic

Description

class ScriptHumanCommandBase
{
int m_VehicleType;
int m_Raised;

void ScriptHumanCommandBase( Human human )
{

		HumanAnimInterface interface = human.GetAnimInterface();
		m_VehicleType = interface.BindVariableInt("VehicleType");
		m_Raised = interface.BindVariableBool("Raised");

}
}

class ModulesHumanCommand extends HumanCommandScript
{
DayZPlayerImplement m_Player;
ScriptHumanCommandBase m_Script;
HumanInputController m_Input;

void ModulesHumanCommand( DayZPlayerImplement user,ScriptHumanCommandBase script )
{

		m_Player = user;
		m_Script = script;
		m_Input = user.GetInputController();

}
};

// 1. if you call it when the player is inside the vehicle, then the information that the player is in the vehicle is partially removed, you can cut it off and walk through the air with partial attachment
ref ScriptHumanCommandBase m_ScriptCommand = new ScriptHumanCommandBase( this );
ModulesHumanCommand cmd = new ModulesHumanCommand( this, m_ScriptCommand );
player.StartCommand_Script( cmd );

//2. if you call this, it crashes, no validation
player.StartCommand_Script( NULL );

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
General

Event Timeline

komer created this task.Aug 15 2020, 11:22 PM

That is the intended behavior for how that method works.

What you have done is forgotten is to tell the Vehicle Command to unlink the player from the vehicle, this is done through the methods in the HumanCommandVehicle class such as GetOut.

komer added a comment.Aug 16 2020, 9:08 AM

in this case, the animation and attachment should have been reset if not a bug. but why should I walk through the air? this is mistake

It is not a bug with HumanCommandScript. The reason this happens is because HumanCommandVehicle::GetOutVehicle (or equivalent) was not called before the command change. This is done by design to allow the player to enter the command HumanCommandUnconscious while still being attached to the vehicle. If you want to be detached, call HumanCommandVehicle::GetOutVehicle.

I highly suggest just opening up the 'player_main.aw' animation workspace file and then looking at how the graph works to wrap your head around why it is just not possible to "reset" animations after a command has ended.

I called the GetOutVehicle function before starting StartCommand_Script, the player got out of the car, but now I can walk through the textures

Did you wait for the HumanCommandVehicle to end before calling StartCommand_Script inside one of the Command Handler override methods, you can check that by seeing the current command id and checking if that command was finished using the boolean. This method works for me as was intended.

I called the GetOutVehicle function before starting StartCommand_Script, the player got out of the car, but now I can walk through the textures

Just to let you know, textures themselves do not have collisions.

komer added a comment.Aug 16 2020, 1:06 PM

Jacob_Mango, yes my mistake, everything works, but still a crutch, but thanks.

Thurston, did I ask anything about texture collision? I don't understand how this relates to this topic.

Geez closed this task as Resolved.Aug 17 2020, 10:55 AM
Geez claimed this task.