Enabling a complicated Actor - How to prevent the crash?

Post » Fri Feb 18, 2011 11:51 pm

I've developed a few shape-shifting animal forms for my Druid Mod, and the casting of these spells has a possibility of a CTD, especially when cast outdoors because of all the processing going on already by the game engine for guard patrols, wolves chasing deer, the bandit killing the boar half a mile away, etc. etc. My animal form has a pretty big GameMode script attached to it, and I'm guessing that this is the problem (I don't know what else it could be). While debugging, I've found I can eliminate the CTDs by placing a message box right before I Enable the animal form in the spell script.

I suppose this allows the game engine some kind of a breather before it enables the animal form. Of course, I'd rather not have this message box in the finished product. Is there a way accomplish the same thing without an ugly message box every time I cast the spell?
User avatar
Richus Dude
 
Posts: 3381
Joined: Fri Jun 16, 2006 1:17 am

Post » Sat Feb 19, 2011 9:05 am

You could try the suggestion in this thread : http://www.gamesas.com/index.php?/topic/1165156-anyway-to-force-a-messagebox-closed/page__p__17135687__fromsearch__1#entry17135687

I asked about forcing a message-box closed; in the end, I decided to use a different method, but perhaps the information TheNiceOne provided will be useful for you-- you could open it and then close it, without bothering the Player too much.
User avatar
Maria Garcia
 
Posts: 3358
Joined: Sat Jul 01, 2006 6:59 am

Post » Sat Feb 19, 2011 2:00 am

You could try the suggestion in this thread : http://www.gamesas.com/index.php?/topic/1165156-anyway-to-force-a-messagebox-closed/page__p__17135687__fromsearch__1#entry17135687

I asked about forcing a message-box closed; in the end, I decided to use a different method, but perhaps the information TheNiceOne provided will be useful for you-- you could open it and then close it, without bothering the Player too much.


Thanks, CDM_! I think this has helped. Although I suspect a regular message box helps prevent a CTD more because it takes more time for it to clear (because it waits for the Player input) and therefore gives the game engine more elbow room to get things done before it stresses itself out, cries, and runs home to Desktop. Don't know though. I just discovered the PurgeCellBuffer function. There are two places in my script that are susceptible to CTD, and I've found that placing this right before the first does a LOT to prevent a crash. Doesn't seem to make sense to use it twice in a row though, because if you purged cell buffers two seconds ago, then there's nothing new to purge. That is, if I understand it correctly.
User avatar
Kari Depp
 
Posts: 3427
Joined: Wed Aug 23, 2006 3:19 pm


Return to IV - Oblivion