Page MenuHomeFeedback Tracker

Patch 1.18 PrePhys_IsTag doesn't work.
Closed, ResolvedPublic

Description

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.

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General
Steps To Reproduce
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;
    }
};

Event Timeline

T3Z created this task.Jun 15 2022, 11:31 AM
T3Z edited Steps To Reproduce. (Show Details)Jun 15 2022, 11:35 AM
T3Z edited Steps To Reproduce. (Show Details)
T3Z renamed this task from Patch 1.18 PrePhys_IsTag doen't work. to Patch 1.18 PrePhys_IsTag doesn't work..Jun 15 2022, 1:11 PM
Amurag added a subscriber: Amurag.Jun 15 2022, 2:56 PM
Kitica added a subscriber: Kitica.Jun 15 2022, 7:55 PM

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.

Geez changed the task status from New to Assigned.Jun 16 2022, 11:11 AM
T3Z added a comment.Jun 19 2022, 8:27 PM

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.

  • Added: PrePhysUpdate, IsEvent and IsTag callbacks to AnimCommand so they are usable from any Animal and Infected command
  • Added: PrePhysUpdate, IsEvent and IsTag callbacks to AnimCommandBase so they are usable from any Animal and Infected animation command

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.

Geez changed the task status from Assigned to Acknowledged.Dec 7 2022, 3:54 PM
Geez closed this task as Resolved.Dec 7 2022, 4:11 PM
Geez claimed this task.
Geez added a subscriber: Geez.

Hello everyone.
This has been resolved internally and a fix will appear with the 1.20 update.
Regards,
Geez

Geez added a comment.Dec 7 2022, 4:20 PM

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