Hello.
I have been meaning to implement a damage detection system in my map that is Hero centric; i.e every player will have 1 Hero, and only damage dealt to the Heroes or their targets will trigger the event. I am not good at Jass Coding or any of the sort, I just use it whenever I need to (removing leaks, etc), so bear with me.
So the rough idea is that every time a Hero is ordered targeting an enemy unit (or automatically acquires one through AI, though not yet implemented in the trigger to come), that target of issued order will added as an "Event - Specific unit (target of issued order) takes damage" to a brand new trigger newly created (HeroAttack...). This trigger HeroAttack... will be destroyed when the same Hero is issued an order targeting a new unit. This is to prevent an endless amount of event stacking on top of a single damage detection event.
However, I am running into issues creating the actions for the new HeroAttack... trigger. The actions should essentially be the following:
All I want for this event is to set which target is attacked and who is the attacker. The trigger "Hero Attack Damage" is then run with the variables already set, where the actual damage bonuses/mitigation happens.
However, I just can't seem to get the function names right, or I get whatever other error there is from messing around with the custom script. If it is possible to add the actions of "Damage Detect Pre" to the newly created "HeroAttack[GetConvertedPlayerId(GetOwningPlayer(GetOrderedUnit()))])" through custom scripts in "Target", this would make it come together. But I don't know Jass.
Here was one attempt, which lead to a Syntax Error:
I appreciate any help, and I hope I've explained my intentions and issues well enough.
I have been meaning to implement a damage detection system in my map that is Hero centric; i.e every player will have 1 Hero, and only damage dealt to the Heroes or their targets will trigger the event. I am not good at Jass Coding or any of the sort, I just use it whenever I need to (removing leaks, etc), so bear with me.
So the rough idea is that every time a Hero is ordered targeting an enemy unit (or automatically acquires one through AI, though not yet implemented in the trigger to come), that target of issued order will added as an "Event - Specific unit (target of issued order) takes damage" to a brand new trigger newly created (HeroAttack...). This trigger HeroAttack... will be destroyed when the same Hero is issued an order targeting a new unit. This is to prevent an endless amount of event stacking on top of a single damage detection event.

However, I am running into issues creating the actions for the new HeroAttack... trigger. The actions should essentially be the following:

All I want for this event is to set which target is attacked and who is the attacker. The trigger "Hero Attack Damage" is then run with the variables already set, where the actual damage bonuses/mitigation happens.
However, I just can't seem to get the function names right, or I get whatever other error there is from messing around with the custom script. If it is possible to add the actions of "Damage Detect Pre" to the newly created "HeroAttack[GetConvertedPlayerId(GetOwningPlayer(GetOrderedUnit()))])" through custom scripts in "Target", this would make it come together. But I don't know Jass.
Here was one attempt, which lead to a Syntax Error:

I appreciate any help, and I hope I've explained my intentions and issues well enough.