Guys, i can't catch how can i return variable equal from the function?
I call function in the trigger thats process with parameter, but this parameter always returns equaling "0"
Then i assign lp_level, and wish to return this parameter from function "Accumulating" to use it in other function "gf_Clap"
But level equal = 0, although i assign 5 in "Accumulating" function.
Let your Accumulating function return the level or use global variables:
[code=perl]
int Accumulating (...){
return level
}
level = Accumulating(p,level);
I haven't English galaxy version, so GUI scripts wouldn't be understandable.
Could you explain, how can I do this operation using GUI?
You can create functions, which can return a value in Gui. Set this value to integer, return the level and set the level variable in the main action to this function.
Or just use a global variable for the level, which gets modified by your other function.
Guys, i can't catch how can i return variable equal from the function? I call function in the trigger thats process with parameter, but this parameter always returns equaling "0"
Can you post a screenshot of what you're on about
void gf_Waterspells (int lp_p, point lp_target) {
Variable Declarations
fixed lv_power;
int lv_level;
Variable Initialization
lv_power = 0.0;
lv_level = 0;
Implementation
if ((gv_elementType[lp_p][1] == "fire") && (gv_elementType[lp_p][2] == "fire")) {
}
else if ((gv_elementType[lp_p][1] == "wind") && (gv_elementType[lp_p][2] == "wind")) {
}
else if ((gv_elementType[lp_p][1] == "water") && (gv_elementType[lp_p][2] == "water")) {
lv_power = 50.0;
gv_statement[lp_p] = "accumulating";
gf_Accumulating(lp_p, lv_level);
gf_Clap(lp_p, lv_power, lv_level, 2.0);
}
}
In this trigger I call gf_Accumulating, that proceed with lv_level parameter.
void gf_Accumulating (int lp_p, int lp_level) {
Variable Declarations
int lv_loopA;
Variable Initialization
lv_loopA = 0;
Implementation
UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringExternal("Param/Value/1539CCF2"));
lp_level = 5;
}
Then i assign lp_level, and wish to return this parameter from function "Accumulating" to use it in other function "gf_Clap"
But level equal = 0, although i assign 5 in "Accumulating" function.
PS - Sorry for my poor English.
Let your Accumulating function return the level or use global variables:
If you happen to use Gui triggers, you can mark them, right click and use Copy as text btw, so you don't need to post the converted script.
Let your Accumulating function return the level or use global variables:
[code=perl]
int Accumulating (...){
return level
}
level = Accumulating(p,level);
I haven't English galaxy version, so GUI scripts wouldn't be understandable.
Could you explain, how can I do this operation using GUI?
You can create functions, which can return a value in Gui. Set this value to integer, return the level and set the level variable in the main action to this function.
Or just use a global variable for the level, which gets modified by your other function.
@Kueken531: Go Thank you very much! Now i see how to use this feature.