Page MenuHomeFeedback Tracker

animal scripted commands cause server crash after 1.18 update
Closed, ResolvedPublic

Description

After 1.18 update my scripted commands for animals stopped working. I tried update according one change in constructor for scripted commands but when command run, server crashes. What I am doing wrong? All is based on swim example from github (which is probably outdated now)

My commandhandler:

	override bool ModCommandHandlerAfter( float dt, int pCurrentCommandID, bool pCcurrentCommandFinished )
	{
		if (super.ModCommandHandlerAfter(pDt, pCurrentCommandID, pCurrentCommandFinished))
		{
			return true;
		}
		DayZAnimalInputController inputController = GetInputController();
		
		
		if ( pCurrentCommandID == DayZAnimalConstants.COMMANDID_SCRIPT )
		{
			//Print("Dog Command " + GetCommand_Script() );
			if ( m_Movement )
			{
				if (inputController.IsJump())
				{
					Print("JUMP COMMAND");
					StartCommand_Jump();
				}
				else if (inputController.IsAttack())
				{
					Print("ATTACK COMMAND");
					//StartCommand_Attack();
					//SignalAIAttackStarted();
				}
				return true;
			}
		}
		if (!inputController.IsJump())
		{
			StartCommand_DogMovement();
		}
		return false;
	}

Scripted command definition:

	DogCommandMovement StartCommand_DogMovement()
	{
		if ( !m_AnimST )
			m_AnimST = new DogST( this );

		m_Movement = DogCommandMovement.Cast( StartCommand_Script( new DogCommandMovement( this, this, m_AnimST ) ) );
		
		return m_Movement;
	}

My Scripted command constructor:

	void DogCommandMovement( DayZAnimal pAnimal, Doggo_Base dog, DogsST st )
	{
		m_Dog = dog;
		m_ST = st;
        }

Please help 1.18 update breaks this awesome mod.

Details

Severity
Crash
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
General
Steps To Reproduce

run scripted command
server will crash

Event Timeline

Hunterz created this task.Jun 15 2022, 5:13 PM

When tried debugging, I saw it crashes somewhere between PrePhysUpdate which I see is called and PostPhysUpdate, so assuming it crashes when animal is simulated.

dedmen added a subscriber: dedmen.Jun 16 2022, 9:30 AM

If you get a .mdmp with the crash, please upload it here (preferably packed in a zip file together with RPT). That makes it alot faster to find the fault if its simply visible in the dump.

Geez changed the task status from New to Assigned.Jun 16 2022, 10:50 AM
NATION added a subscriber: NATION.Jun 16 2022, 2:29 PM

Just FYI - similar way I am doing scripted commands on player and it works. All is based on swim sample at github: https://github.com/BohemiaInteractive/DayZ-Samples/tree/master/Test_ScriptCmdSwim

Tried create similar scripted command and handler for Infected (ZombieBase) and it works without crash. Looks like only animals are broken.

T3Z added a subscriber: T3Z.Jun 19 2022, 8:28 PM

Tried create similar scripted command and handler for Infected (ZombieBase) and it works without crash. Looks like only animals are broken.

fully agree

Geez closed this task as Resolved.Jun 24 2022, 11:35 AM
Geez claimed this task.
Geez added a subscriber: Geez.

Hello everyone.
The issue has been fixed internally and it should be fixed on the current experimental as well.
Regards,
Geez

not crashing server anymore, but started filling crashlog T166345

Its really annoying explain server owners again and again that T166345 stil not touched.