Could this script be the cause of a crash?

Post » Fri Jul 26, 2013 2:30 am

Well. My usually FCOM has crashed once after adding two mods ( it's disgusting that I actually keep a text log of what I add and remove and crashes and paranoia ), but I isolated the two and tested and ruled them out. The crash happened when I was running away from very strong vampires and my two CM Partners were left behind ( Raewyn and Azazel ). I had created scripted rings and put them in their inventory to deal with the fact that CM Partners always run and get lost all the gd time. It uses moveto to move them back behind me when they are 4096 units away.

SCN MCRRingScript - I am the script on the ring that I give to CM Partners to stay in their inventory at all times.

ref MCRMe - meaning whoever has this ring in their inventory, meant for my two CM Partners
ref MCRMyOpponent - whoever I am fighting
;float MCRCountDown
float MCRMyDistanceFromPlayer - getdistance player

;This block adds an ability to regen health per second

Begin OnAdd
Set MCRMe to GetContainer
If ( MCRMe != Player )
If ( MCRMe.HasSpell MCRAbility == 0 )
MCRMe.Addspell MCRAbility
EndIf
EndIf
End

;Sets MCRMe to whoever has the ring in their inventory

Begin OnLoad
Set MCRMe to GetContainer
If ( MCRMe != Player )
If ( MCRMe.HasSpell MCRAbility == 0 )
MCRMe.Addspell MCRAbility
EndIf
EndIf
End

Begin GameMode

;This is the block that will zap my CM Partners behind me if they wander too far away so they can get lost. No more.

If ( MCRMe != Player )
If ( GetInSameCell Player == 0 )
If ( Player.GetAngle Z >= 0 ) && ( Player.GetAngle Z < 90 )
MCRMe.MoveTo Player, -50, -50, 10
ElseIf ( Player.GetAngle Z >= 90 ) && ( Player.GetAngle Z < 180 )
MCRMe.MoveTo Player, -50, 50, 10
ElseIf ( Player.GetAngle Z >= 180 ) && ( Player.GetAngle Z < 270 )
MCRMe.MoveTo Player, 50, 50, 10
ElseIf ( Player.GetAngle Z >= 270 ) && ( Player.GetAngle Z < 360 )
MCRMe.MoveTo Player, 50, -50, 10
Else
; Do Nothing
EndIf
ElseIf ( GetInSameCell Player == 1 ) && ( MCRMe.GetDistance Player >= 4096 )
If ( Player.GetAngle Z >= 0 ) && ( Player.GetAngle Z < 90 )
MCRMe.MoveTo Player, -50, -50, 10
ElseIf ( Player.GetAngle Z >= 90 ) && ( Player.GetAngle Z < 180 )
MCRMe.MoveTo Player, -50, 50, 10
ElseIf ( Player.GetAngle Z >= 180 ) && ( Player.GetAngle Z < 270 )
MCRMe.MoveTo Player, 50, 50, 10
ElseIf ( Player.GetAngle Z >= 270 ) && ( Player.GetAngle Z < 360 )
MCRMe.MoveTo Player, 50, -50, 10
Else
; Do Nothing
EndIf
EndIf
EndIf

;This block ends their combat with a fleeing target, so that they let it run away. Too bad the combat music still continues.

If ( MCRMe.IsInCombat == 1 )
Set MCRMyOpponent to MCRMe.GetCombatTarget
If ( MCRMyOpponent.GetCurrentAIPackage == 10 ) || ( MCRMyOpponent.GetCurrentAIProcedure == 16 )
MCRMe.StopCombat MCRMyOpponent
; MCRMyOpponent.StopCombat MCRMe
Endif
EndIf

Anyway, I suspect the crash or it feels like the crash happened exactly when one of them would have moveto zapped behind me. But couldn't get it to reoccur in an hour of play. Does anything in that script look a bit CrashyMcWtf here?

User avatar
mishionary
 
Posts: 3414
Joined: Tue Feb 20, 2007 6:19 am

Return to IV - Oblivion