- Joined
- Aug 7, 2013
- Messages
- 1,338
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).
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).