OBSE function CTD problem

Post » Wed Mar 30, 2011 7:42 am

This script, using GetFirst/GetNextRef is causing a CTD about 3 seconds after I load the game.

Set rActor to GetFirstRef 69        Label 10        If rActor.GetInSameCell Player == 1                Set fDistanceFrom to rActor.GetDistance Player                PrintC "NPC %n Distance %.2f", rActor, fDistanceFrom                Set rActor to GetNextRef                GoTo 10        EndIf


I've narrowed it down, through trial and error, to the functions GetFirstRef andf GetNextRef.
If those functions are present in my script, CTD. If they aren't present, no problems.

I'm quite the noob. Is there something I'm not doing that is causing the CTD?
User avatar
Mandi Norton
 
Posts: 3451
Joined: Tue Jan 30, 2007 2:43 pm

Post » Tue Mar 29, 2011 10:11 pm

Check your thread in the CS forum. Some really good responses there. (that, and the mods section isn't really the place for these kinds of questions. :D)
User avatar
Phoenix Draven
 
Posts: 3443
Joined: Thu Jun 29, 2006 3:50 am

Post » Wed Mar 30, 2011 5:42 am

Yeah, you're right. I shouldn't be posting those kind of questions here. But, there are some excellent scripters that visit these pages regularly, and not the CS forums.

Either way, I corrected the CTD with the help of people.

I still can't get an NPC to stagger, but at least my script doesn't cause a CTD. A CTD is worse than not achieving the desired effect.

Thanks again, 'ol reliable.
User avatar
Rachie Stout
 
Posts: 3480
Joined: Sun Jun 25, 2006 2:19 pm


Return to IV - Oblivion