So I have this method I'm using to make my spells do what I want them to do which is basically using a string and reading the "words" from it to determine the actions of the spell.
IE: "DS 100 CS 4019 CA 1111" should be
"DS"- Deal Spell Damage (100)
"CS"- Cast Spell ID(4019)
and the last part is "CA"- Custom Action 1111
Now what I want to do is convert the 1111 directly into a call(or function? i dunno...) filling in the 2 data points like gf_ca_1111(source, target)
Is there a way to do this without making a custom action to associate each string value with the custom action?
As another way of looking at it I want to convert the string value "1111" into something like:
gf_ca_"string value"(source, target).
I really want to make it a separate action for each "Custom Action" call and not one universal with a massive if then else or switch (seeing as how switches just seem to be more complicated if then elses anyways)
As Motive said.
If you want to pass parameters (like the damage) to triggers then you have to store the data in global variables and let the trigger read them.
Dang, I'm not sure how I could honestly do that without passing it values, with how I want it to work at least these actions will be called too often to allow it to read from a global value.
Like I have to pass it the players ID# and the ID# of the target :(
On a side note I want to execute actions I have pre-defined but use a variable in the NAME as opposed to a parameter. Does that change anything? Maybe I am misreading the explanations given though.
With the result in the actual script being:
"DP 1 CS 4019 AS 1526"
Again, the problem I am having is the "Effect <String+>" portion always defaults to a blank string. I want it to default to the [Abilities] Effect function instead. If i set this function as the default it shows up as "Effect = (Deal/Heal/Shield Damage (%) 0) <String+>" but the default effect is in black and cant be changed and it still defaults to a blank string.
This is more a quality of life deal as I have to just select the effect function but i do have to scroll through a list for it. And yes I know it seems like a lot of work for the end result to be "DP 1 CS 4019 AS 1526" but visually it looks better and is easier (for me at least) to build spells this way as I tend to typo a lot when writing out scripts "by hand".
edit: I know this probably doesn't belong in this section but I figured I'd add it here.
edit2: I just remade this as a post in the triggers section since my guess is it's more appropriate there.
So I have this method I'm using to make my spells do what I want them to do which is basically using a string and reading the "words" from it to determine the actions of the spell.
IE: "DS 100 CS 4019 CA 1111" should be
"DS"- Deal Spell Damage (100)
"CS"- Cast Spell ID(4019)
and the last part is "CA"- Custom Action 1111
Now what I want to do is convert the 1111 directly into a call(or function? i dunno...) filling in the 2 data points like gf_ca_1111(source, target)
Is there a way to do this without making a custom action to associate each string value with the custom action?
As another way of looking at it I want to convert the string value "1111" into something like:
gf_ca_"string value"(source, target).
I really want to make it a separate action for each "Custom Action" call and not one universal with a massive if then else or switch (seeing as how switches just seem to be more complicated if then elses anyways)
@Sneakervek: Go
Yes, if you use a trigger as your action definiton/function.
It would be as simple as doing:
Keep in mind there can be no parameters passed to this trigger.You'll have to provide your own helpers functions to figure out the source and target.
@MotiveMe: Go
As Motive said.
If you want to pass parameters (like the damage) to triggers then you have to store the data in global variables and let the trigger read them.
@MotiveMe: Go
Dang, I'm not sure how I could honestly do that without passing it values, with how I want it to work at least these actions will be called too often to allow it to read from a global value.
Like I have to pass it the players ID# and the ID# of the target :(
On a side note I want to execute actions I have pre-defined but use a variable in the NAME as opposed to a parameter. Does that change anything? Maybe I am misreading the explanations given though.
Also I would like to know if it's possible to make default function in an allow multiple function?
Basically I have a custom function that returns a string by combining multiple strings with presets over the top so it basically looks nicer.
IE:
The effect I want to default every time I add a new one to:
The result of this is something like this:
With the result in the actual script being:
"DP 1 CS 4019 AS 1526"
Again, the problem I am having is the "Effect <String+>" portion always defaults to a blank string. I want it to default to the [Abilities] Effect function instead. If i set this function as the default it shows up as "Effect = (Deal/Heal/Shield Damage (%) 0) <String+>" but the default effect is in black and cant be changed and it still defaults to a blank string.
This is more a quality of life deal as I have to just select the effect function but i do have to scroll through a list for it. And yes I know it seems like a lot of work for the end result to be "DP 1 CS 4019 AS 1526" but visually it looks better and is easier (for me at least) to build spells this way as I tend to typo a lot when writing out scripts "by hand".
edit: I know this probably doesn't belong in this section but I figured I'd add it here.
edit2: I just remade this as a post in the triggers section since my guess is it's more appropriate there.