• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[General] Reference Object Data from Triggers

Status
Not open for further replies.
Level 1
Joined
Dec 16, 2017
Messages
3
Hi, I actually have 2 questions. First: Is it possible to reference object data from triggers? For example, suppose I wanted to reference the damage value of the Death Knight's level 1 death coil: Ideally I'd envision this as a little custom script snippet that stores the value in a variable by looking up the ability ID "AUdc" and referencing the field "DataA1". Can this be done?

Second, is there a way to reference the "level" of a hero ability in response to an event like "A unit begins the effect of an ability"?

Thanks for any help you can provide!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
1) yes, if tou know how to use Memory hack
Does this work with 1.28 latest version? If not then pointless mentioning it.
Can this be done?
Not currently as far as I am aware. One can write some compile time scripts to convert object editor data into arrays or hash table entries initialized at map initialization. This is also one of the requested natives.
Second, is there a way to reference the "level" of a hero ability in response to an event like "A unit begins the effect of an ability"?
Yes, one can get the level of the ability as an integer. The native used is GetUnitAbilityLevel but it also has a GUI integer function wrapper.
JASS:
native GetUnitAbilityLevel takes unit whichUnit,integer abilcode returns integer
 
Level 1
Joined
Dec 16, 2017
Messages
3
Thanks very much for the info folks.

One can write some compile time scripts to convert object editor data into arrays or hash table entries initialized at map initialization.

That sounds exactly like what I would need, though I wouldn't have the first clue how to start. I've never really used JASS, but if I learned the language do you think this would be very difficult to do? You seem like you probably have a lot of experience with JASS, so I'm wondering how the problem looks if you were thinking about doing it yourself. Would you think: "Yes, definitely possible to do, and probably not too time consuming." Or would you think: "Not possible, or not worth the insane amount of time it would take." I wouldn't want to spend more than a few hours coding just the object data hash table. What do you think?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
I am unsure how to do it anymore. One used to be able to run a LUA script at compile time to get the values but last I heard that was broken.

Apparently the Wurst language and build system for Warcraft III maps supports compile time object editor lookup and even programmatic object type creation at compile time.
 
Status
Not open for further replies.
Top