OK, this is REALLY infuriating. I'm JUST trying to write a function in the trigger editor, but it is like the map editor is trying to run my expressions IN THE MAP EDITOR using the DEFAULT values (WTF?!). First, I discovered that I couldn't even do any math using the parameters I am passing in or I would get the "Error initializing variable" error. So, I added local variables that were initialized to junk values (like zero) and then set equal to the passed parameters just so the map editor would shut up and allow me to use the passed in values in an expression. Now, I'm trying to just divide two numbers by each other, but the map editor thinks I'm trying to divide by zero. This screenshot sums it up perfectly:
innerRadius and outerRadius are VARIABLES so why the [email protected]#$ does the map editor think this is a divide by zero? Why is it even CHECKING if it's a divide by zero, did the programmers not understand the definition of VARIABLE?!
Actually, this behavior seems to have changed. I went and opened an older map (about a year old) and it gives me errors when I try to edit the expressions. Could a recent patch have introduced a bug, or is there some awful setting I have enabled somewhere on the map editor?
You should just move onto using galaxy script instead of gui. But here's a work around to defeating the problem of it not allowing you to edit the expression. Set your local variables that your passing into the expression greater than zero. Once the expression is created/modified, set your locals to zero.
Alternative is to just use ArithmeticInt or ArithmeticReal functions instead of an expression if you can.