Jump to content

Extinguishable Candles (Modders Resource!)


Recommended Posts

Posted

Extinguishable Candles (Modders Resource!)

View File

Light- and Extinguishable Candles

 

A simple script and CK guide to create candles that can be lit and extinguished by the player.

 

Attention: This is NOT a playable mod!

It's a modder's resource which you will need to install to your own mod in the Creation Kit. You need a basic understanding of Papyrus and world building in the CK in order to use this. It only works for candles which you place new in a mod; it will not affect existing candles in the game world.

 

With that out of the way, let's get to business:

 

How to Create Extinguishable Candles in the Skyrim CK (LE/SE)

 

Step 1: Activators

 

Create two activators, one for the lit candle and one for the unlit candle. You can use existing candle objects from the base game (the Nordic Ruins candles come in lit- and unlit versions).

 

Add the script from the download section to both activators. Do not fill their properties!

Don't forget to compile the script.

 

See the screenshot from the CK above for a recommended setup, including two sound effects that work well in my opinion.

 

Step 2: World Placement

 

1) Place the unlit activator in your scene.

2) Place the lit activator nearby and set it disabled by default.

3) Fill the script property "LinkedCandle" on both placed activators with the other candle (i.e., fill the unlit candle into the lit candle's property and vice versa).

4) Place a light bulb. Set the lit activator as its enable parent so that it only becomes visible when the lit candle is, too.

5) Move the two activators so that they overlap completely.

 

And you're done!

 

Next time you visit this room in the game, your unlit candle will be there and you should be able to activate it. If you've set up everything correctly, clicking on it will light it, and clicking on it again will extinguish it.

 

Credits

This was created adapting ideas and script snippets from the Creation Kit Wiki. I can't claim any credit for this idea nor the script.

 

Please feel free to use this script or derivatives of it in any way you like. This should also work in other Papyrus-based Beth games.


 

Posted

Thank you for this.  Modder's resources are valuable.

 

Just a question for my own understanding.  Why two activators?  I've seen "light switches" in house mods that do it with one, such as in the example script below (not my script), which seems a little quicker and easier to set up.  EnableMarker is the object reference to be enabled & disabled.

 

Spoiler

Event OnInit()
 
    If (EnableMarker.IsDisabled())
        GoToState("LightsOff")
    Else
        GoToState("LightsOn")
    EndIf
 
EndEvent
 
State LightsOff
 
    Event OnBeginState()
        EnableMarker.Disable()
    EndEvent
 
    Event OnActivate(ObjectReference akActionRef)
        GoToState("LightsOn")
    EndEvent
 
EndState
 
State LightsOn
 
    Event OnBeginState()
        EnableMarker.Enable()
    EndEvent
 
    Event OnActivate(ObjectReference akActionRef)
        GoToState("LightsOff")
    EndEvent
 
EndState

 

Posted
1 hour ago, Hex Bolt said:

Why two activators?

Because this script here is switching out the entire candle object, instead of just the lightsource. Not the most elegant solution, but an easier one if you cannot separate the flame/actual lightsource from the candle object.
If you do know how to tinker with nifs, the single script lightswitch is the better solution.

Posted
1 hour ago, Pamatronic said:

Because this script here is switching out the entire candle object, instead of just the lightsource. Not the most elegant solution, but an easier one if you cannot separate the flame/actual lightsource from the candle object.
If you do know how to tinker with nifs, the single script lightswitch is the better solution.

Got it, thanks!  I figured there was something that I'd overlooked.

Posted (edited)

The other point is that this is generic for any lit/unlit items. If you modify the lit candle .nif so it has an "animation" to light/extinguish it then you'd need to make the same change to any other light source using a different model, as the operation becomes part of the mesh itself. The game provides quite a few matched lit/unlit pairs, so in some ways the single script IS the elegant solution.

Edited by ghastley
typos
Posted

Thanks for the comments!

 

The solution might not be elegant, but it is really fast to set up (not more than five minutes for everything) and it's also a very simple script which, as a bonus, you can use on any other "paired" objects you can think of. Not sure what is there in the existing game files that one could use for that, but perhaps something like filled/empty buckets, flower pots, etc. It should also be possible to chain more than two activators together with this script (cycling through light colors, or something like that)

 

My lack of .nif editing skills was indeed one of the reasons for setting it up it this way. :)

 

There's another aspect, too: Thanks to the fade-in/out of the objects that happens by default on .Disable() and .Enable(), you barely notice the object swap and it looks fairly believable. The light isn't on/off in an instant.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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