FALLOUT 3
Script for automatic nightvision sunglasses by anterobs
Fallout 3 » Gameplay Effects and Changes
Added: 04/01/2009 - 09:10PM
Updated: 16/12/2010 - 06:15PM

9 Endorsements

Latest version

288 Unique D/Ls

345 Total D/Ls

10,377 Total Views

Uploaded by anterobs

Description

Last updated at 18:15, 16 Dec 2010 Uploaded at 21:10, 4 Jan 2009

Script for automation of Lost Cosmonaut's Night-vision Sunglasses
http://www.fallout3nexus.com/downloads/file.php?id=1566

Recommended in conjunction with Daknights mod by taylorsd:
http://www.fallout3nexus.com/downloads/file.php?id=422

Basically, the night vision won't work outdoors from 5:00 am to 8:00 pm. And you won't be prompted for activation when equipping the sunglasses.

Indoors it's not time-dependent. I've chosen to enable it outdoors from 8:00pm to 5:00am, but the ideal time may vary depending on how dark is the night in your game.

Outdoors it will activate/deactivate automatically if the sunglasses are equipped.

You need to replace the script in the original mod with the script below (it's ugly but should work).

The script is based on the original one by Lost Cosmonaut (there may even be some parts not used, that were in the original one and I forgot to remove).

[EDIT]The indents missing aren't my fault. I've pasted the text indented, but the comment system messed them. But the game won't check indents anyway, so don't worry.[/EDIT]

[EDIT2]To replace the script:
-Open the "night vision sunglasses.esp" file with G.E.C.K (setting it as the "active file").
-Open the menu "gameplay" in main G.E.C.K. window.
-Select "edit scripts".
-Click the "open" icon in the script editor window.
-Locate the script named "AAASunglassesScript" - should be at the beginning of list, if alphabetically sorted.
-Delete everything and paste the new script over.
-Click the "save" button (still in script editor).
-Close script editor.
-Save the mod in main G.E.C.K. window.
-Load your game with the mod active.
-You may need to unequip and re-equip the sunglasses to get it to work.[/EDIT2]

[EDIT3]
You are free to use this script in your mods. Just give me the credits if you do. ;)
[/EDIT3]

[EDIT4]
Just to make it clear, this script is NOTHING without a night-vision spell effect...
[/EDIT4]

===============V=====SCRIPT=BELOW======V======================




scn AAASunglassesScript

;Short Button
Short ControlVar
; Make it so it knows the effect has been activated

;Make the nightvision "smart"

;----------------------------------------------------------------------

Begin OnEquip

; Begins script when you activate (use) equipment

set ControlVar to 1

;check if you are outdoors and if is night
If IsInInterior == 0
If (GameHour > 20) || (GameHour < 5)
player.addspell, AAASunglassesFX
EndIf
EndIf

;check if you are indoors
If IsInInterior == 1
player.addspell, AAASunglassesFX
;EndIf
EndIf

End

;----------------------------------------------------------------------

Begin OnUnEquip

; Now we need it to cancel the effect once the equipment is removed

if ( ControlVar == 1 )
set ControlVar to 0
player.removespell, AAASunglassesFX
endif

End

;----------------------------------------------------------------------

;"dynamic" nightvision

Begin gamemode

;remove if going outdoors at daytime

if ( ControlVar == 1 )
If IsInInterior == 0
If (GameHour < 20) && (GameHour > 5)
player.removespell, AAASunglassesFX
EndIf
EndIf
EndIf

;activate if going indoors while equiped

if ( ControlVar == 1 )
If IsInInterior == 1
player.addspell, AAASunglassesFX
EndIf
EndIf

;check if you are equiped, outdoors and if is night

if ( ControlVar == 1 )
If IsInInterior == 0
If (GameHour > 20) || (GameHour < 5)
player.addspell, AAASunglassesFX
EndIf
EndIf
Endif

End