Karatekid5
Warlord
Except Custom Civs are heavily modded.
I know, though most of the ones we have added aren't complex code-wise.
The first thing I would do is as mentioned earlier. Lace print statements into the code to see if any of them are printed into the lua.log as the last thing before the crash.
As you've currently written your code, however, the owner of the unit can delete their own cities and de-tech themselves if they kill off the unit within their own territory.
One thing I remember causing one of my games a long time ago to become unrecoverable was using IGE to delete an adversary city that had a trade-route starting from that city. It CTD'd when I progressed turns and if I tried to load a save from the turn when I deleted the city.
I'm not concerned about the code firing by deletion since this is just meant to be a joke event for AI-only games, so it's just another comedic possibility.
As for the issue you mentioned regarding deleted cities, that's a very good point, though these crashes are happening before the unit is even expended, and none of the lace statements are in the LUA log right before the game crashes. It just...happens. We'll try running it without the LUA attached to see if anything changes.
EDIT: I tested the Trade Route crash by having the unit delete a city two active caravans were originating from, and so far there haven't been any crashes after 30 turns. I guess whatever caused the crash was fixed in a patch at one point if it was that long ago. In my first Brave New World game I remember nuking a Dom Pedro city that had a trade route coming from it and that crashed the game.
I also noticed that I forgot to add a unit flavor to the Big Chungus unit (even though they can't be built, Musicians, Artists, etc have flavors of 1). Could this have something to do with it?
Last edited: