Thanks for sending the files. Here is what I found:
1. In Atarlost_Utility.xml line 471: There is a extra closing paren, so the setq looks like it has 3 parameters (which it complains about).
2. The same line complains that singleMax is not an identifier (string). This is because:
Code: Select all
(if (objGetStaticData theShip singleMax) ...
singleMax is a number, not a string. I'm not sure what your intent is here. Do you mean (if (not singleMax)... ?
3. Line 470 has an extra quote at the end of maxDeviceMass:
Code: Select all
(objGetStaticData theShip 'maxDeviceMass')
should be:
(objGetStaticData theShip 'maxDeviceMass)
This should have raised an error, so I fixed the code to do so.
4. Line 512 is the culprit:
Code: Select all
(CobjCanInstallItem (theShip theDevice))
Notice that it's trying to call a function named "theShip". Unfortunately, due to a bug in the parser, it did not generate an error there but only much later, which is why you got the strange error that you did. I've fixed that bug so the parser outputs the proper error.
5. Unfortunately, once I fix those bugs there is a fundamental problem that I cannot fix easily:
Code: Select all
(setq CobjCanInstallItem objCanInstallItem)
The above call sets CobjCanInstallItem to objCanInstallItem. Your intent is clearly to remember the original value of the function. Unfortunately, due to new code in the betas, <Globals> gets run multiple times in a game. This is to handle the case where two extensions define the same global. We need to make sure that the selected extensions get executed just before the game is created/loaded.
The problem is that the second time through, CobjCanInstallItem gets set to the redefined objCanInstallItem; this leads to an infinite recursion (that eventually crashes).
Ideally, I would fix this by resetting the global state every time we start a new game. I tried to do that but it got more complicated than I expected, so I'm going to defer that until later.
In the next release, I've implemented <CanInstallItem> on ship classes. I hope you'll be able to use that instead of redefining the functions.
Either way, thanks for trying this--I've found lots of good bugs in the engine.
EDIT: Try the following:
Code: Select all
(if (iserror CobjCanInstallItem)
(setq CobjCanInstallItem objCanInstallItem)
)
That should define CobjCanInstallItem only if it is NOT already defined. That will avoid the infinite recursion.