PrePhys_IsTag always return false regardless of the presence of the tag!
Expected result: The command will be executed as long as the tag is active.
PrePhys_IsTag always return false regardless of the presence of the tag!
Expected result: The command will be executed as long as the tag is active.
class MY_InfectedST { protected int m_CMD_Attack; protected int m_TAG_Attack; void MY_InfectedST( ZombieBase zmb ) { DayZCreatureAnimInterface anim_i = zmb.GetAnimInterface(); m_CMD_Attack = anim_i .BindCommand( "CMD_ATTACK" ); m_TAG_Attack = anim_i.BindTag("TagAttack"); } void CallAttack( DayZInfectedCommandScript script, int pParamInt, float pParamFloat) { script.PreAnim_CallCommand( m_CMD_Attack, pParamInt, pParamFloat ); } int GetAttackTag() { return m_TAG_Attack; } }; class MyCoolAnimCommand extends DayZInfectedCommandScript { private bool m_TagActive; private MY_InfectedST m_ST; private DayZInfectedInputController m_Input; void MyCoolAnimCommand(DayZInfected pInfected, MY_InfectedST table) { m_Input = pInfected.GetInputController(); m_ST = table; } override void OnActivate() { m_Input.OverrideMovementSpeed(true, 0.0); m_ST.CallAttack( this, 3, 0); } override void OnDeactivate() { m_Input.OverrideMovementSpeed(false, 0.0); } override void PrePhysUpdate(float pDt) { //PrePhys_IsTag always return false regardless of the presence of the tag! m_TagActive = PrePhys_IsTag( m_ST.GetAttackTag() ); } override bool PostPhysUpdate(float pDt) { //m_TagActive always false return m_TagActive; } };
How you calling scripted command in command handler? I have issue with animals in this ticket: https://feedback.bistudio.com/T165943 maybe you can help me figure it out.
override bool ModCommandHandlerInside( float pDt, int pCurrentCommandID, bool pCurrentCommandFinished ) { if( super.ModCommandHandlerInside( pDt, pCurrentCommandID, pCurrentCommandFinished ) ) { return true; } if( pCurrentCommandID == DayZAnimalConstants.COMMANDID_SCRIPT) { DayZInfectedCommandScript acs = GetCommand_Script(); if( MyCoolAnimCommand.Cast(acs) != null ) { return true; } return false; } RunMyCoolAnimCommand(); return false; } MyCoolAnimCommand RunMyCoolAnimCommand() { if( MY_InfectedST== null ) MY_InfectedST= new MY_InfectedST( this ); MyCoolAnimCommand cmd = new MyCoolAnimCommand( this, m_ST); StartCommand_Script( cmd ); return cmd; }
Any progress of fix that issue?
When was announced in changelog of 1.18 and not work its shame.
I want make custom scripted attack command for animals, especially for dog - lower attack when want hit chickens and normal jump attack when attacking to other animals/survivors.
Hello everyone.
This has been resolved internally and a fix will appear with the 1.20 update.
Regards,
Geez
Also, while you are waiting for the fix, the devs have found a workaround for this until the fix is deployed.
override void PrePhysUpdate(float pDt) { DayZCreature animal = DayZCreature.Cast(GetEntity()); DayZCreatureAnimInterface animInterface = animal.GetAnimInterface(); //! Must call 'BindTag' before 'PrePhys_IsTag' is used everytime in 'PrePhysUpdate' bool isNameOfTag = PrePhys_IsTag(animInterface.BindTag("NameOfTag")); } (edited)
Regards,
Geez