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.