elseif vActor.GetDetectionLevel PlayerRef == 3 && vActor.GetLineOfSight PlayerRef == 1 let vCastYN := 0
His research further indicated the following:
When called on a disabled actor, it crashes the game. May CTD if GetLOS is called by an actor that was disabled in the previous frame. A delay of a few frames after the actor is enabled will solve this issue.
However, only a few lines up, I already check to see if the calling actor is disabled, and then the script is supposed to exit out early:
; Early Exits if NPC ref falls into following categoriesBegin GameMode if IsFormValid vActor != 1 || vIni != 1 || vActor.IsActor == 0 || vActor.GetDead == 1 || vActor.GetDisabled == 1 || vActor.GetProcessLevel > 0 return endifEnd
So I'm trying to figure out what might going on, and could use some help here. A couple of possibilities come to mind:
1. I have different chunks of code, each in their own separate GameMode blocks. "Return" is only exiting out of that block not the script, although the description I have of "Return" is that it halts further processing of the entire script, not just the block. So maybe the description is wrong.
2. The crash was happening when the player was leaving the IC Market district and going to the exterior road/path that leads to the prison. Presumably there was something hanging around outside that was disabled. However, according to my code above, the script should have exited out early. Is it possible that the PlayerRef was temporarily disabled during the transition, and that caused the crash? Should I add in something like "PlayerRef.GetDisabled == 1" into the very beginning of the script header so that if the player is disabled for some reason, the NPCs don't do anything? Is something like that even possible?
This is a real head scratcher, because it *seems* like I've already done everything right and I'd love to solve this ASAP before more reports of crashing come down the turnpike. But I don't want to guess wrong and just make something up and cause more problems. So any help would be greatly appreciated.