- Joined
- Aug 1, 2013
- Messages
- 4,658
Hi all.
I have a map where I create custom abilities using lua.
I do that using a textmacro that runs the objectmerger.
As you can see, a very simple ability based of the Holy Light ability.
But this one with the given icon and position.
Now as you can see, I have given two RAWCODEs.
The second one will be the rawcode of the ability that will be created.
The first one should be the one that the second one is kind of based of.
I want the new ability to have the same icon and buttonposition as the first one. But I dont want to have to find it in the object editor and copy and paste it over to the trigger editor.
I want to have instead of this script something like the following:
Now this looks exactly like I want to have... with one exception that loadObjectEditorData() doesnt exist.
But you get what I mean.
Is there ANYTHING like this so I can make an ability just like that with one simple runtextmacro for my spell?
I know about tools like the Object Data Extractor but those create JASS functions to access that data. I need LUA functions to access that data because this has to be done compiletime.
Also if you think that I shouldnt be lazy and just write those damned icons... I have to tell you that this is not exactly the script that I need, but I need that loadObjectEditorData() function.
In the actual script, it would save me like... 22 parameters... for like 300 runtextmacros... which is a rough 6600 times copy and pasting... I am lazy, but in this case, I would need this function even if I weren't.
I have a map where I create custom abilities using lua.
I do that using a textmacro that runs the objectmerger.
JASS:
//! textmacro AbilityGenerator takes RAWCODE1, RAWCODE2, ICONPATH, X, Y
//! externalblock extension=lua ObjectMerger $FILENAME$
//! i setobjecttype("abilities")
//! i createobject("AHhb", "$RAWCODE2$")
//! i makechange(current, "aart", "$ICONPATH$")
//! i makechange(current, "abpx", "$X$")
//! i makechange(current, "abpy", "$Y$")
//! endexternalblock
//! endtextmacro
As you can see, a very simple ability based of the Holy Light ability.
But this one with the given icon and position.
Now as you can see, I have given two RAWCODEs.
The second one will be the rawcode of the ability that will be created.
The first one should be the one that the second one is kind of based of.
I want the new ability to have the same icon and buttonposition as the first one. But I dont want to have to find it in the object editor and copy and paste it over to the trigger editor.
I want to have instead of this script something like the following:
JASS:
//! textmacro AbilityGenerator takes RAWCODE1, RAWCODE2
//! externalblock extension=lua ObjectMerger $FILENAME$
//! i setobjecttype("abilities")
//! i createobject("ANss", "$RAWCODE2$")
//! i makechange(current, "aart", loadObjectEditorData($RAWCODE1$, "aart"))
//! i makechange(current, "abpx", loadObjectEditorData($RAWCODE1$, "abpx"))
//! i makechange(current, "abpy", loadObjectEditorData($RAWCODE1$, "abpy"))
//! endexternalblock
//! endtextmacro
But you get what I mean.
Is there ANYTHING like this so I can make an ability just like that with one simple runtextmacro for my spell?
I know about tools like the Object Data Extractor but those create JASS functions to access that data. I need LUA functions to access that data because this has to be done compiletime.
Also if you think that I shouldnt be lazy and just write those damned icons... I have to tell you that this is not exactly the script that I need, but I need that loadObjectEditorData() function.
In the actual script, it would save me like... 22 parameters... for like 300 runtextmacros... which is a rough 6600 times copy and pasting... I am lazy, but in this case, I would need this function even if I weren't.