- Joined
- Mar 27, 2012
- Messages
- 3,232
I am not particularly fond of having to write out long pieces of code for each ability that I create in lua. Thus, I created a master function called ModifyObject that can make every single object data change to an ability in just 1 line. It supports formulas(exactly as much as lua supports them), changing all levels of an ability and variable amounts of parameters.
Considering how powerful it is and how little time it took to make, I'm actually wondering why no one thought of this before.
I will not post the code in this post, because first I want to find out if there's any interest for such a thing.
However, here is a teaser.
This creates an ability based on Channel, with 'ABIL' as the rawcode.
The last line makes all those changes:
Sets the name of the ability to "lulz".
Sets the levels of the ability to 10-3=7.
Changes the Options parameter of level 1 to "visible".
Changes the cooldown of each level to level*2. (2,4,6,8,10...)
Considering how powerful it is and how little time it took to make, I'm actually wondering why no one thought of this before.
I will not post the code in this post, because first I want to find out if there's any interest for such a thing.
However, here is a teaser.
Code:
require "lua\\ModifyObject"
setobjecttype("abilities")
createobject("ANcl","ABIL")
ModifyObject(current,{anam="'lulz'-f",alev="10-3-f",Ncl31="1",amcs0="Gn*2-f"})
This creates an ability based on Channel, with 'ABIL' as the rawcode.
The last line makes all those changes:
Sets the name of the ability to "lulz".
Sets the levels of the ability to 10-3=7.
Changes the Options parameter of level 1 to "visible".
Changes the cooldown of each level to level*2. (2,4,6,8,10...)