• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

A simple command in a custom script

Level 8
Joined
Apr 16, 2025
Messages
160
How to access the selected unit via custom script?
I really have no idea where to find this information. I would be grateful if you could help a fool.
Here is a trigger to call the damage text, but instead of "udg_DamageEventTarget" I need to access the selected unit.

call ArcingTextTag.createEx(udg_DmgStr, udg_DamageEventTarget, udg_DmgDuration, udg_DmgSize, GetLocalPlayer())

We are talking about Selecting units within a small area
 
It can be referenced by setting the selected unit to a variable and using that variable to reference the unit for the custom script.
Ex:
  • Set VariableSet SelectedUnit = (Triggering unit)
  • Custom script: call ArcingTextTag.createEx(udg_DmgStr, udg_SelectedUnit, udg_DmgDuration, udg_DmgSize, GetLocalPlayer())
The equivalent jass event response can also be used. There is a list here in this guide containing the code for unit event responses: Things You Should Know When Using Triggers / GUI
Ex:
  • Custom script: call ArcingTextTag.createEx(udg_DmgStr, GetTriggerUnit(), udg_DmgDuration, udg_DmgSize, GetLocalPlayer())
 
It can be referenced by setting the selected unit to a variable and using that variable to reference the unit for the custom script.
Ex:
  • Set VariableSet SelectedUnit = (Triggering unit)
  • Custom script: call ArcingTextTag.createEx(udg_DmgStr, udg_SelectedUnit, udg_DmgDuration, udg_DmgSize, GetLocalPlayer())
The equivalent jass event response can also be used. There is a list here in this guide containing the code for unit event responses: Things You Should Know When Using Triggers / GUI
Ex:
  • Custom script: call ArcingTextTag.createEx(udg_DmgStr, GetTriggerUnit(), udg_DmgDuration, udg_DmgSize, GetLocalPlayer())
This worked great, thank you very much!
 
Back
Top