I just discovered that the game crashes when an
automated Lanun work boat tries to use
Pirate Cove ability.
It does not happen when a human player directly orders the work boat to use this ability, or when a work boat belonging to another civilization (which cannot use the ability) is automated.
(I found this first in my modmod, but then confirmed that it also happens in base More Naval AI version 2.4 with the updated DLL.)
If I understood correctly and you just want to store unit information, SDToolkit is probably the right thing. it's found in "SdToolKitCustom.py". Original Thread is
here, advanced version
here. It is used in the Revolution code, if you need examples.
I've looked over this briefly, but frankly do not understand much of what I'm reading. I don't think there is much of a chance that I'll get my modmod working that way in time for my next release. Maybe I can manage it next year.
-----
Edit: I just gifted a Hidden Nationality unit to a rival right after using it to kill one of said rival's units. That seems rather odd.
Edit2: I just noticed that XML.log keeps saying "info type SPELL_WALL_OF_STONE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml"
I removed the Wall of Stone spell from my modmod recently,since the Ring of Warding is a better defensive building and a new spell I call Diligence is generally more useful and betters fits the philosophy of the Earth sphere.
When I used the Find in Files function of PyScripter, it could not find any reference to SPELL_WALL_OF_STONE in my modmod except for the TXT_KEYs in CIV4GameText_FFH2.xml. I couldn't really think of anything that uld be causing the problem.
When I tried searching for SPELL_WALL_OF_STONE using Find in Files in Notepad++, it found it in CIV4GameText_FFH2.xml
and in CvGameCoreDLL.dll.
I really did not know that you could search in a compiled DLL. Most of the file is illegible characters in Notepadd++, but I can make out a few words. SPELL_WALL_OF_STONE is found rather close to SPELL_TEACH_SPELLCASTING,
It seems like there might be some hardcoded reference to the spell. I cannot say for sure, but it might be a problem. I recall at one point years ago there being some problem caused by my modmod not having a SPELL_TEACH_SPELLCASTING or UNIT_VAMPIRE, because Kael had hard coded such references into it in the DLL. I believe he solved this by moving the hardcoded references to instead be set in GlobalDefinesAlt.xml and ignored if nothing is set there. I would probably be best if you avoided such DLL hard coding the same way. (If the Wall of Stone reference helps the AI know to use the spell to defend cities, then I would probably want it to do so for Ring of Warding instead in my modmod.)
SorceForge wouldn't happen to have some sort of Find in Files ability I could use to search through the whole source code of your DLL, would it? I'm trying to see where the hard coding ight be, but have no idea in which files to look.
Edit: Ok, I found it in CvUnitAI.cpp
I see that Kael added the line
if (GC.getDefineINT("SPELL_TEACH_SPELLCASTING") != -1) before
if (canCast(GC.getDefineINT("SPELL_TEACH_SPELLCASTING"),false)) so that the code does not try to see if he spell can be cast or try to force it to be cast if the spell does not even exist. You don't seem to have included such checks for any of the many similar hard coded references to spells you added.
edit: Just in case the missing spell would cause a problem, I have decided to call SPELL_RING_OF_WARDING SPELL_WALL_OF_STONE for now. It isn't like one can see the actual spell type while playing the game anyway.