Jump to content

Lightswitch script


Recommended Posts

i was bouncing around on the web seeing if I could find anything to help you, and I came across something I did almost a year ago to my fallout4custom.ini found in documents/my games/Fallout 4 that didn't even cross my mind, you might want to give this a try and see if its resolves the issue for you:

 

 

  1. go into Documents/My Games/Fallout 4
  2. edit Fallout4Custom.ini
  3. look for [Archive] if its not there add in the following lines, if it is make sure the two lines are as follows:
    [Archive]
    bInvalidateOlderFiles=1
    sResourceDataDirsFinal=
    
  4. if you want to be able to see the papyrus logging information, look for [Papyrus], if its not there, add in the following or make sure the papyrus part reads as follows:

    [Papyrus]
    bEnableLogging=1
    

    I also have some additional settings underneath [Papyrus] that are for logging info, the full papyrus block in mine reads as follows:

    [Papyrus]
    bEnableLogging=1
    bEnableTrace=1
    bLoadDebugInformation=1
    bEnableProfiling=1
    sDefaultLogOverlay=Papyrus
    

I think that may resolve the problems your having, if you turn on the papyrus logging, it can be helpful to track down errors with your scripts, but you'll have to weed through a bunch of other errors that pop up from the default game itself, the log files are found in Documents\My Games\Fallout 4\Logs\Scripts

 

The key lines here are the ones under [Archive], the bInvalidateOlderFiles=1 tells it to look at all the loose files, and the sResourceDataDirsFinal= just tells it to use the default directories under the 'data' folder for loading loose files.

I didn't even think about these two things honestly because most people already have it added in for using mods, and like I said, did this over a year ago to my fallout4custom.ini file.

 

*knocks on wood* hope this works for you.

Link to comment
Share on other sites

Hey caleb ! You're a genius !!

 

That's it. You're goin in my mod. Might need a console help desk dude there somewhere !

 

All those lights work perfectly now. And you're right - it was the Archive lines in in the Custom ini.

 

Nice !!

Link to comment
Share on other sites

sorry i didn't think of it before, like i said, was over a year ago i did that, its only needed to load loose files, so after your done making your mod, what you'd want to do from the main menu in creation kit is go file->Archive

 

It will build a list of all the files it needs for building the ba2 files, and you click okay.

 

When it asks you for the name of the Main ba2 you'll want it to have the same name as your settlement to start with followed with ' - Main.ba2', if it includes textures it will ask you for the name for the textures ba2, same thing, the same name as your mod followed by ' - Textures.ba2' so say... your mod is called MyFirstMod.esp the main ba2 and textures ba2 would be:

 

MyFirstMod - Main.ba2

MyFirstMod - Textures.ba2

 

CaSe is important with the names so make sure the CaSe is the same as your mods name and that textures and main are capitalized, else the ba2 files may get ingored. Then you'd just zip up the files, with no need to include loose files.

 

This also makes it so you can properly deploy it for xbox and ps4 (if it doesn't use custom scripting for ps4)

Link to comment
Share on other sites

  • 5 years later...

Unless I'm missing a specific reason or function you want to use, these scripts seem far more complex than they need to be for just turning lights on and off. This is what I use for all my light switches, and it works on the vanilla toggle and button switches as well:

Scriptname LightToggle extends ObjectReference 

ObjectReference Property LightMarker Auto

Event OnActivate(ObjectReference akActionRef)
	If (LightMarker.IsEnabled())
		LightMarker.disable()
	Else
		LightMarker.enable()
	EndIf
EndEvent

The lights are parented to an EnableMarker or XMarker set to be initially disabled. I have a video tutorial on using the script and getting light switches to work.

Thats what im using that i found in a tutorial...BUT question is : Do i have to have a different script for each set of switch/marker/lights ? I posted this question today. Imagine doing a whole location and needing to do this 15-20 times..

So i asked if there is a Universal script do do them all... Simply add the "universal" script and point it to the "object reference" (marker)...

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...