I am doing some experiments now to try to find out why but has anyone seen this kind of thing happen before?
I do check if the subjects are disabled, so I THINK that s not the issue. If I comment out the GETLOS checks the script no longer CTD!
The CTD happens just at the moment two vampires that were previously disabled are ENABLED in the cell the player is in.
The quest mod I am playing waits for you to pick up a key off a table, as soon as the player picks up the key the vampires are enabled and then WHAM-O the game CTD.
Me is set to container and this script is on a token in the vampires inventory. Me is checked to see if ME is disabled at the top of the script and will issue a RETURN if me is disabled. so that the GETLOS is not run if ME is disabled.
However I have discovered that some commands will still CTD even if a return is issued before the offending command such as a division by zero in the script. I wonder if this is another example of that?
;;;;;;;;;;;;;Vamps can see, smell, and hear youif me == 0set me to GetContainerreturnendifif me != 0if me.getdisabled == 1returnendifendifset smell to -smellif smell < 0me.modav2 sneak smellendifset smell to 0if me.isincombat == 0 && me.GetSleeping != 3 && smelltimer <= 0 && me.GetInSameCell player == 1set smelltimer to 120endif;see you bonus if player moves around and vamp is faceing the player max range of 300 feet.if me.isincombat == 0 && me.getav aggression >= 70 && delaytimer <= 0 if player.iscasting == 1 || player.isattacking == 1 || player.IsDodging == 1 || player.IsMovingForward == 1 || player.IsMovingLeft == 1 || player.IsMovingRight == 1 || player.IsMovingBackward == 1 || player.IsJumping == 1 || player.IsTurningLeft == 1 || player.IsTurningRight == 1 ;if me.getlos player == 1 && smelltimer > 0 <---------------- This will not CTD is this is commented out like so. if me.getdistance player <= 6000 me.say aDPVampAttack me.startcombat player set delaytimer to smelltimer endif ;endif endifendif;smell you bonusif smelltimer > 0;if me.getlos player == 1 <---------------- This will not CTD is this is commented out like so.set smell to 600 - ( ( me.getdistance player / 2 ) ); 60 foot max, each foot takes away 10 points from the smell bonus;endifendifif smell > 0me.modav2 sneak smellendif;;;;timers need to stay here below the restif delaytimer > 0set delaytimer to delaytimer - getsecondspassedendifif smelltimer > 0set smelltimer to smelltimer - getsecondspassedendifif smelltimer <= 0 && onechance == 1set onechance to 0endif
Maybe I am using GETLOS too many times per second here. I have read that that GetLOS command is fast is used on actors and by actors (not objects, if objects then it is a slow command) but it can "get tired" if it is used too often in a short amount of time.