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

Question about target triggers

Status
Not open for further replies.
Level 29
Joined
Sep 26, 2009
Messages
2,595
Yes, it is possible to some degree.

You need to use the "Unit - Set Unit integer field" action
  • Unit - Set Unit: Peasant 0002 <gen>'s Integer Field: Targeted as ('utar') to Value: X
As to which value to use instead of "X", see the table below

From common.j
Code:
    // Target Flag
    constant targetflag     TARGET_FLAG_NONE                = ConvertTargetFlag(1)
    constant targetflag     TARGET_FLAG_GROUND              = ConvertTargetFlag(2)
    constant targetflag     TARGET_FLAG_AIR                 = ConvertTargetFlag(4)
    constant targetflag     TARGET_FLAG_STRUCTURE           = ConvertTargetFlag(8)
    constant targetflag     TARGET_FLAG_WARD                = ConvertTargetFlag(16)
    constant targetflag     TARGET_FLAG_ITEM                = ConvertTargetFlag(32)
    constant targetflag     TARGET_FLAG_TREE                = ConvertTargetFlag(64)
    constant targetflag     TARGET_FLAG_WALL                = ConvertTargetFlag(128)
    constant targetflag     TARGET_FLAG_DEBRIS              = ConvertTargetFlag(256)
    constant targetflag     TARGET_FLAG_DECORATION          = ConvertTargetFlag(512)
    constant targetflag     TARGET_FLAG_BRIDGE              = ConvertTargetFlag(1024)


So for example to change unit to be targeted as air unit, find in the table above the flag "TARGET_FLAG_AIR". The flag's value is 4 so setting 4 in place of "X" will make your unit to be targeted as Air.

A few things to note:
  • The action sets a value, it does not add to existing values. So for example if your unit is targeted as Ground and you use the action above with value 4, then the unit will be targeted as Air only. If you want the unit to be targeted as both ground and air, you need to use value 6 (TARGET_FLAG_GROUND + TARGET_FLAG_AIR --> 2 + 4 = 6)
  • You may notice that many options (like ancient, hero, non-hero, non-acient, etc.) are missing. Not sure how to set those
 
Status
Not open for further replies.
Top