[General] Get Unit Model String

Status
Not open for further replies.
Level 4
Joined
Feb 2, 2023
Messages
28
Is it possible, I'm trying to make an ability where a devoured unit can be "spit up" to a target point, and would like to change the missile art to the devoured unit if possible, if not I suppose a slide would work, but getting the model name would certainly be easier.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
As far as I know there's no easy way to do it, but this method works well. Go through all of your different Units in the Object Editor that can be devoured and change their Art - Target field to be equal to their Model path.

Then you can reference this field in triggers like so:
  • Model Example
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • Set VariableSet ModelUnit = (Triggering unit)
      • Custom script: set udg_ModelPath = GetAbilityEffectById(GetUnitTypeId(udg_ModelUnit), EFFECT_TYPE_TARGET, 0)
      • Special Effect - Create a special effect at (Center of (Playable map area)) using ModelPath
ModelUnit = Unit variable
ModelPath = String variable
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
GetAbilityEffectById(GetUnitTypeId(udg_ModelUnit), EFFECT_TYPE_TARGET, 0)
Uh. So we can trick the game into returning a data field that isn't even used by the object by pretending it's another type of object that does use that field... but we can't just check the most fundamental field possible for a unit? Come on, Blizzard, holy shit.
 
Level 14
Joined
Jan 10, 2023
Messages
247
Uh. So we can trick the game into returning a data field that isn't even used by the object by pretending it's another type of object that does use that field... but we can't just check the most fundamental field possible for a unit? Come on, Blizzard, holy shit.
What does the 'Art - Target' field do? Does it literally do nothing? Must be something right?

If not, I'm actually happy because this looks like an opportunity as long as Blizzard never smartens up
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
What does the 'Art - Target' field do? Does it literally do nothing? Must be something right?
Two default units have something set there, everything else has it blank. Gryphon Rider and Glaive Thrower both have different model paths that actually point to the same effect in both these fields. I could not figure out what it plays for or cause it to play in any capacity. I changed them to be more obvious models that also didn't have any named animations, but they never appeared on themselves or units these units targeted.
 
Level 14
Joined
Jan 10, 2023
Messages
247
Two default units have something set there, everything else has it blank. Gryphon Rider and Glaive Thrower both have different model paths that actually point to the same effect in both these fields. I could not figure out what it plays for or cause it to play in any capacity. I changed them to be more obvious models that also didn't have any named animations, but they never appeared on themselves or units these units targeted.
I know what useless model data field I'll be playing with tonight!
 
Status
Not open for further replies.
Top