Maniac3020 Posted November 10, 2010 Share Posted November 10, 2010 Once again, I edit this post. :tongue: I've gotten doors to autoclose with a simple script I found on the Geck help pages, I've even managed to integrate it with a door that already had scripts running, but this door, unless I take out the script that the door already had, won't auto-close. Can someone who has scripting knowledge take a look at it and tell me why it's not working? (The script in green is what I added) scn NVEcvDoorBG01SCRIPT ref rUser ;This script is to prevent AI from following you between HiddenValley02 and HiddenValley01 so we don't overload on NPCs. Begin OnActivate set rUser to GetActionRef if (rUser == Player) Activate else ;Only check the door between HiddenValley01 and 02 if (GetSelf == vHVLevel02MainDoorREF) || (GetSelf == vHVLevel01DownstairsDoorREF) ;Check if they are in combat if (rUser.IsInCombat) ;If they are, stop combat and don't let them use the door. rUser.StopCombat return else ;They aren't, so let them go. activate endif else Activate endif endif End ;OnActivate float doorTimershort closeDoor Begin GameModeif closeDoor == 1if doorTimer > 0set doorTimer to doorTimer - getSecondsPassedelseif GetOpenState == 1 ; if the door is still openSetOpenState 0 ; close the doorset closeDoor to 0endifendifEnd Begin OnActivateif GetOpenState == 3 ; if the door is closed set doorTimer to 5set closeDoor to 1 endifActivateEnd Link to comment Share on other sites More sharing options...
WastelandAssassin Posted November 10, 2010 Share Posted November 10, 2010 well, just saw your updatesorry for the comment after you updated hope this works for you Link to comment Share on other sites More sharing options...
Maniac3020 Posted November 12, 2010 Author Share Posted November 12, 2010 Can someone please help me? Link to comment Share on other sites More sharing options...
Zaldir Posted November 14, 2010 Share Posted November 14, 2010 Try this:(I haven't tested it myself yet, as I'm not on a PC at the moment.) float doorTimershort closeDoor Begin GameModeif closeDoor == 1if doorTimer > 0set doorTimer to doorTimer - getSecondsPassedelseif GetOpenState == 1 ; if the door is still openSetOpenState 0 ; close the doorset closeDoor to 0endifendifEnd Begin OnActivate set rUser to GetActionRef if (rUser == Player) Activate else ;Only check the door between HiddenValley01 and 02 if (GetSelf == vHVLevel02MainDoorREF) || (GetSelf == vHVLevel01DownstairsDoorREF) ;Check if they are in combat if (rUser.IsInCombat) ;If they are, stop combat and don't let them use the door. rUser.StopCombat return else ;They aren't, so let them go. activate endif else Activate endif endifif GetOpenState == 3 ; if the door is closed set doorTimer to 5set closeDoor to 1endifActivate End ;OnActivate Link to comment Share on other sites More sharing options...
Maniac3020 Posted November 14, 2010 Author Share Posted November 14, 2010 There is something wrong with that script, the editor won't let me save it. Link to comment Share on other sites More sharing options...
Zaldir Posted November 15, 2010 Share Posted November 15, 2010 Okay, I will try fixing it after school today, hopefully I can get it working. :) Link to comment Share on other sites More sharing options...
Maniac3020 Posted November 15, 2010 Author Share Posted November 15, 2010 Okay, here's another question. How do I delete a script? I know, it sounds stupid, but I've tried everything I can think of and I can't delete the script! All I can do is make the script blank, so it doesn't do anything! :wallbash: :wallbash: Link to comment Share on other sites More sharing options...
Zaldir Posted November 15, 2010 Share Posted November 15, 2010 Open the Script Editor, click the Red Cross, and double-click the script you want to delete. It may look like it does nothing, but the next time you load your mod, it should be gone. :) Link to comment Share on other sites More sharing options...
Maniac3020 Posted November 17, 2010 Author Share Posted November 17, 2010 Any luck getting that script to work? Link to comment Share on other sites More sharing options...
Zaldir Posted November 17, 2010 Share Posted November 17, 2010 The odd thing is, it works in Oblivion, but not in Fallout.^^ Apparently there's something wrong with Fallout itself, not the script... Link to comment Share on other sites More sharing options...
Recommended Posts