Page 1 of 1

Spawning Anomalies, the Bane of My Existance

Posted: 14 Aug 2017, 21:06
by DoctorX
Still trying to get my Dynamic Anomalies addon to actually randomly spawn and delete anomalies with each blowout, and still keep running into a random crash situation which corrupts the save.

I'm starting to think every now and then one of the anomalies that is spawned is invalid, and the crash comes when I try to delete the invalid obbject.

My question is what is the best way to test for an invalid object, specifically with an anomaly? Right now I do check for a nil return on creation, but is there a "magic number" object id range I should be testing for or anything like that?

Re: Spawning Anomalies, the Bane of My Existance

Posted: 14 Aug 2017, 21:19
by Alundaio
Not really a way to check it.

The usual technique that other people are using for dynamic anomalies, is already using all the existing ones in the level, but just changing their position. You can try that approach if you feel you have reached a dead end.

Might want to litter the anomaly binders (and server entity class binders) with print statments. Make sure each function starts and ends. Sometimes undefined errors in engine cause script to just quit executing, that is why I have alun_utils.debug_write everywhere marking start and end. This particular error is especially bad if it happens to a script function bound to engine, such as the action planner, because it will call script over and over causing a stack overflow. Then you can just either manually look in log to inspect it's correct or use a clever regex in NPP or write a custom parser to detect such a thing in the log.

Place to start would definitely be anomaly save/load. If load is silently failing then object will be broken for sure. If there is no update, object is broken. etc.

Re: Spawning Anomalies, the Bane of My Existance

Posted: 15 Aug 2017, 05:34
by DoctorX
Awesome. Thanks Alundaio!