• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

LUA - Accessing Object Editor Fields

Status
Not open for further replies.
Level 11
Joined
Sep 14, 2009
Messages
284
Im trying to access different fields of units in the Object Editor using Lua. But I'm having problems finding the currect raw values.

For example 'ulum' is supposed to be the value of lumber cost for a unit, but when using the following function:

Code:
print(BlzGetUnitIntegerField(udg_StatInfoUnit, ConvertUnitIntegerField(FourCC("ulum"))))

it does not work. The function is correct, since it works for 'ustc', which is the raw value for Strength:

Code:
constant unitintegerfield UNIT_IF_STRENGTH = ConvertUnitIntegerField('ustc')

However, the value for Strength in the Object Editor is 'ustr', which does not work in the above function. My guess is that the lumber cost (along with a bunch of other fields) have different raw values than appears in the Object Editor. Does anyone know where to find these?

And no, they are not in common.j, just a very few of them are.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Unless they are in common.j then chances are access to the field is not supported.

The field names appear unrelated to the slk field names which is what WC3 would use for storing the data. As such one can only assume the integer codes are internal codes used by the game engine data management system and not directly related to the object editor.

One can expect more fields and more natives to be added in future Warcraft III updates.
 
The field names appear unrelated to the slk field names which is what WC3 would use for storing the data. As such one can only assume the integer codes are internal codes used by the game engine data management system and not directly related to the object editor.

You can find the field values by pressing CNTRL + D in the object editor. Whether or not any of the undefined ones work, I don't know.

fields.jpg
 
Status
Not open for further replies.
Top