• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[LUA] Mass generating levelable abilities

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
Hi,

Using a Lua object generation script, it is possible to write to any field (even non-existent ones) for an ability, as discussed in this thread: http://www.hiveworkshop.com/forums/world-editor-help-zone-98/lua-writing-wrong-fields-252634/

While whatever interfaces between the Lua script and the wc3 map does type checking (e.g. if a field asks for an integer it will produce an error when trying to write a real to it), it does not actually check whether a field exists for a given ability (e.g. blizzard, rain of fire have a field for number of waves, but this is not true for most other abilities), allowing one to write to non-existent fields, possibly producing disastrous data errors.

Thus I ask if there is a way to know what fields an ability has and does not have, and furthermore, return those fields which are levelable, e.g. change their value each level of the ability.

So for Blizzard, the function would work like this:

Function(Blizzard) --> (damage per wave, number of waves, number of shards per wave, damage per second)

while Sleep, which is a relatively impoverished spell only has a single field to it:

Function(Sleep) --> (stun time)

(stun time is the period where a unit can't be awoken).

Note I leave out some other fields: area of effect, range, cast time, duration, etc. because all abilities have these, and from their initial values it's obvious whether they actually play a role in the ability at all, e.g. Sleep has a 0 area of effect, so no need to level this up.

Also note that what would really be returned are the raw code names for the fields, e.g. "Usl1" instead of "Sleep - stun duration."

If there is such a function, it would save a lot of time in making levelable abilities, as otherwise I have to look up the name and type of each field by hand, which humans are notoriously inefficient at (a computer doing table look up is much faster).
 
There is no inherent way to retrieve that. You can make your own functions for that (since lua allows you to declare functions), but Lua was implemented with very little reading potential. It doesn't really allow you to read data from an existing object, it only allows writing.

Perhaps someone could write a preprocessor for it. It could read from the slk files to perform some field-checking, and it could correct errors. If that existed, Lua would be far easier to work with. :p
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
You mean the Object Merger provides no reading functions. Which fields an ability possesses and if the field uses levels is determined by the Units\AbilityMetaData.slk. The common attributes like mana, area range etc. are not limited even if not all abilities actually use them. Does not matter to set those fields though. Building mass object modification data is not good for both the editor (as you have already observed the object editor is not stable) and the game (very slow to load). Mass variations of an object are not to be edited manually, which is why it's better to be realized via custom slks.
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
Wait you're saying making many custom objects slows down map loading time?

I've only got 600 or so. What are the benchmarks...?

As old as WC3 is, I'd be shocked if it slowed anything down until I got to the millions...
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
the more "purple" values in object editor, the longer the map loads. For integers this is not significant, but for strings(ability tooltips) this is a killer. Try creating few 100 level abilities and you will see yourself.

Xonok I think was the one that benchmarked a lot of this
 
Status
Not open for further replies.
Top