Another ugly topic: Stray arguments.
The original compiler did not check for additional arguments. For example the addSpell instruction takes a single ID as argument, but in some scripts you can find things like:
player -> addSpell "fire_bite", 645
Vanilla MW would just ignore the 645.
Now our compiler does check for extra arguments. It wasn't build for letting crap through without producing error messages. Changing that would be a large amount of work and we would lose a lot of the scripting advantages we already have in 0.31. Frankly, I don't wanna do it.
The workaround we have applied so far is adding optional ignored arguments to the argument lists of instructions and functions where this kind of stray arguments typically show up.
* x A single string or name
* X A numerical expression.
* z Either a string or name or a single numerical value.
For example we have:
Code: Select all
extensions.registerInstruction("face", "llX", opcodeFace, opcodeFaceExplicit);
That means the face instruction takes two integer values as arguments, but can take an additional numeric expression that then will be thrown away.
Now we need to figure out to which functions and instructions we need to add those optional arguments. I presume there is some kind of pattern. People have not added stray arguments randomly to their scripts. These are probably the result of some mental lapse or a misunderstanding how a function/instruction works.
To find these patterns we need to look at a large selection of content files, which means we need the help of our community.