I've made an action for something I expect to do several times in my triggers. Everything works fine in the GUI, but I am receiving an "Invalid Parameter List" error when I try to save, and I do not know what I have done wrong. If anyone can point out how to eliminate this error, I would appreciate it.
Trigger Editor:
ModifyIncomeOptions:ActionReturnType:(None)ParametersPlayer=0<Integer>Operator=+<ArithmeticOperator>Amount=0.0<Real>GrammarText:ModifyincomeofplayerPlayerbyOperatorAmount.HintText:Modifiesthespecifiedplayer's income. Custom Script Code Local Variables Actions Variable - Set Income[Player] = (Max((Income[Player] Operator Amount), 0.0))
Error Box:
# | Error | Line | File1|InvalidParameterList|60|Global58voidgf_ModifyIncome(intlp_player,intlp_operator,fixedlp_amount){59// Implementation60gv_income[lp_player]=MaxF((gv_income[lp_player]lp_operatorlp_amount),0.0);61}
By replacing parameters, I have deduced that the parameter that is causing problems is the operator. How do I use the operator parameter in such a way that it will work?
The operator variable type seems to be messed up entirely. In Gui, I can set it to + - x /, but the resulting script will just set it to these signs, even though the base type is an integer:
intlv_myOperator=+;
This is obviously no valid galaxy code, since + is not an integer, so it throws a syntax error.
I would just get rid of the operator alltogether. If you want to substract, just use a negative value. If you want to support multiplication/division, use an integer variable and a switch.
I've made an action for something I expect to do several times in my triggers. Everything works fine in the GUI, but I am receiving an "Invalid Parameter List" error when I try to save, and I do not know what I have done wrong. If anyone can point out how to eliminate this error, I would appreciate it.
Trigger Editor:
Error Box:
By replacing parameters, I have deduced that the parameter that is causing problems is the operator. How do I use the operator parameter in such a way that it will work?
Okay, I've figured out a way to fix the problem, though it is a rather inelegant solution.
First I created a new "Operator Parameter" type:
Then, I duplicated the functionality of the "Arithmetic Operation" function:
Finally, I used my new arithmetic function in the action I was trying to create, and all similar actions:
Edit: Nevermind, but it is interesting that it's not possible to use an 'Arithmetic Operator' Variable in this case.
The operator variable type seems to be messed up entirely. In Gui, I can set it to + - x /, but the resulting script will just set it to these signs, even though the base type is an integer:
This is obviously no valid galaxy code, since + is not an integer, so it throws a syntax error.
I would just get rid of the operator alltogether. If you want to substract, just use a negative value. If you want to support multiplication/division, use an integer variable and a switch.
€ exactly what you did :)