• 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.

Methods to prevent this hardcoding?

Status
Not open for further replies.
Level 4
Joined
Aug 7, 2010
Messages
77
Hello all. i am a noob in trigger and wanted to ask how to change it using a variable. Because of this "hardcoding" units that are on the map, once i've moved on to create a new map, the trigger will turn out to be like this(Because the following trigger is unable to find the unit on the map since i've yet to put them).. i have to manually create the units and put them on the map to fix this issue.

"gg_unit_h016_0087" is the paladin thats in the previous map
"gg_unit_h017_0088" is the dummy unit thats in the previous map

  • holyPulseActive
    • Events
      • Unit - gg_unit_h016_0087 Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Pulse
    • Actions
      • Unit - Order gg_unit_h017_0088 to Night Elf Warden - Fan Of Knives
Is there any method such as i can set the "gg_unit_h016_0087" to the paladin and "gg_unit_h017_0088" the dummy unit thats available in the object editor such that this following trigger will not causing the same error when i moved on to my next map?
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Well, specific units can't exist in multiple maps.
However, you can scale this thing up and it'll be easier to make it work in any map.

How?
Save both units into a variable at map init. Use the variables instead, this is especially useful if you need to use them in many places, as you only need to change 1 variable per unit.
 
Status
Not open for further replies.
Top