• Unfortunately I have no other custom functionalities to track this, all I had was target.Battle.AttackedByCombatant += this.NotifyAttack;
    I tried using the health stat's change:

    public void Start()
    {
    combatant = ORKComponentHelper.GetCombatant(this.gameObject);
    if (combatant != null) combatant.Status[ORK.StatusValues.GUIDToIndex(ORKGUIDs.statusValue_health)].ValueChanged += this.NotifyStatusValue;
    }

    public virtual void NotifyStatusValue(Combatant combatant, StatusValue statusValue, int change)
    {
    // Do my things
    }

    and while I get a notification when a specific combatant gets damaged, I couldn't find any way to obtain info on the combatant which is causing the damage..
  • You can pass on the target's game object as a parameter and get the combatant from the game object:
    Combatant target = ORKComponentHelper.GetCombatant(gameObject);
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited August 2022
    I think that would only give me the information on the combatant whose health changed ( defender ), but not on the combatant who dealt the damage ( attacker ), which is what I am looking for...
    Post edited by ChimpLogik on
  • You can also pass on the attacker (or both).
    Schematics animating your abilities/items naturally have the user available, so you can pass it on.
    When using status value change schematics, those also have the user that caused the change available as the Machine Object (and the one who's stats change is the Starting Object) - but only if the change came from something with a source, e.g. an ability or item.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited August 2022
    I tried that approach and added a Battle Animation to all player's abilities and it worked, but unfortunately only on single target abilities.
    The schematic in the Battle Animation calls a function GetAttackerDefender with 2 arguments: Machine Object and Starting Object

    public static void GetAttackerDefender(GameObject attacker, GameObject defender)
    {
    //do my things
    }

    but when it comes to AOE abilties, while the attacker is correctly identified as "Player", the defender is "_RayCastTargetPosition", which does make sense since they're raycast abilities.
    That said, I tried different game Object parameters but I wasn't able to get the game objects damaged by the ability..
    Post edited by ChimpLogik on
  • In that case, you can use a Schematic status change, which uses a schematic for each hit target. Again, the user is the Machine Object, the target the Starting Object of the schematic.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • It worked like magic! I didn't even realize you could use a Schematic for status changes on combatants until you explained it.
    The more I learn about ORK, the more I am blown away by it...
  • In case you ever need some special thing for the status changes, you can even extend it with custom code :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Oh man, that's next level! :O
  • Can I get screenshot for this?

    In that case, you can use a Schematic status change, which uses a schematic for each hit target. Again, the user is the Machine Object, the target the Starting Object of the schematic.
  • Not much to show there - simply add a status change to your ability/item target changes and use the change type Schematic (e.g. instead of Status Value).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.