How to determine damage amount from a prop_manipulator_device DamagedEvent?

Hi, I need to retrieve the damage amount a player has given to a prop. I have a Zombie Boss created and I am using my own UI for the health of the prop. I have set to the zombie to be damaged by 1.0 on any damage event. I want to change the damage amount to reflect the weapon the player is using to damage the Zombie.

Meaning, right now if I hit my Zombie with a rocket launcher or a smg, it will be the same damage (1.0). I want to make it so I can reflect the correct damage in my UI.

How can I retrieve the damage given to the prop or the weapon type used from the agent that triggered the prop DamagedEvent?

Current working code:

@editable ZombiePropManipulator : prop_manipulator_device = prop_manipulator_device{}

ZombiePropManipulator.DamagedEvent.Subscribe(OnZombieDamaged)

    OnZombieDamaged(Agent:agent):void=
        for(Player : PlayersMap):
            Player.TakeDamage(1.0, IsZombieWalking)
            zeroHealth := Player.ZeroHealth()
            if (zeroHealth = true):
                set IsZombieDead = true
            Player.UpdateHealthBar()

I want to change my OnZombieDamaged to something like this below:

    OnZombieDamaged(Agent:agent):void=
        var DamageAmount : float = 0
        if (Agent.WeaponType = Assult_Rifle)
            set DamageAmount = 0.5
        else if (Agent.WeaponType = SMG)
            set DamageAmount = 0.2
        else if (Agent.WeaponType = RocketLauncher)
            set DamageAmount = 1.0

        for(Player : PlayersMap):
            Player.TakeDamage(DamageAmount, IsZombieWalking)
            zeroHealth := Player.ZeroHealth()
            if (zeroHealth = true):
                set IsZombieDead = true
            Player.UpdateHealthBar()

Or something like this if possible:

    OnZombieDamaged(Agent:agent):void=
        var DamageAmount : float = 0

        set DamageAmount = Agent.GetDamage #somehow get damage from this event?

        for(Player : PlayersMap):
            Player.TakeDamage(DamageAmount, IsZombieWalking)
            zeroHealth := Player.ZeroHealth()
            if (zeroHealth = true):
                set IsZombieDead = true
            Player.UpdateHealthBar()

Unfortunately, the prop manipulator API does not provide anything related to damage amount or even the health of the prop. They only provide agents who triggered the events associated with it.

Thanks for the info, I also came to the same conclusion. What about figuring out what weapon the agent was holding? I couldn’t figure out how to determine which weapon they are holding?

I can then do thing something like:

var DamageAmount : float = 0
        if (Agent.WeaponType = Assult_Rifle)
            set DamageAmount = 0.5
        else if (Agent.WeaponType = SMG)
            set DamageAmount = 0.2
        else if (Agent.WeaponType = RocketLauncher)
            set DamageAmount = 1.0

You can’t determine the type of weapon the player is holding but you can use the conditional button to determine what specific weapon the player was holding on specific event. Two big flaw of using the conditional button is one: you have to insert all possible item the player can get in your map into the button so you could check. Say you have 30 possible item or weapon the player can afford, You have to setup a specific amount of buttons to fit all of these 30 items to check which item the player is holding through the conditional button. Two is that it is not useful when it comes to weapons with projectiles (Like the rocket launcher) because player can switch to another weapon while the rocket launcher projectile is still going forward and register the damage as if it came from the weapon you switched to. Mainly because the projectile takes time to reach to its target