having something like this will still screw things up:The root cause of this bug is that functions don't like being passed attributes as integer arguments. I didn't know that until I tracked down this one, and judging by the lines which were fixed, neither did some other modders. Expect it to happen again when someone else who doesn't know this writes, or copies, a line with a function call which does it.
There are two ways to solve this. One is to check every existing function call and add conversions such as 'sti', then check every new mod and make sure its function calls don't pass attributes without conversions. Another is to make the functions do the conversion themselves. The latter has the advantage of only needing to be done once. It's probably not necessary to check every function; you'll know if the problem is happening because it generates reports in "error.log". I don't recall exactly what it said, something or other about variable type, but that was what led me to the problem and the fix. So, if there's an obscure bug and an error log about variables, that's the time to see about adding something to the function.
Code:
string a = 1;
string b = 2;
int sum = getsum(a, b);
logit(a+" + "+a+" = "+sum);
int getsum(int val1, int val2)
{
int v1 = sti(val1);
int v2 = sti(val2);
return v1+v2;
}
You can run it in the console. I think it will still act weird
Last edited: