Turning a Fireplace on/off

Post » Mon Nov 29, 2010 1:02 pm

I'm having trouble making a custom lamp. So, with that said, is there a way to make a fireplace, i.e. I've placed the fireplace in my home and put wood on top. How can I light it up and turn it off again when I click it?

Anyone know? Thanks
User avatar
Sierra Ritsuka
 
Posts: 3506
Joined: Mon Dec 11, 2006 7:56 am

Post » Tue Nov 30, 2010 2:43 am

Try this...
1. Go to "Lights" in the Object Window
2. Find a suitable Fire effect, and move it into position.
3. Double-click on it, and in the top box give it a Unique ID
4. Create a new Activator
5. Use this Script:
Short FireStateBegin OnActivate  If ( FireState == 1 ) ; On    Set FireState to 0    [FireRef].Disable  ElseIf ( FireState == 0 ) ; Off    Set FireState to 1    [FireRef].Enable  EndIfEnd

6. Attach that to the Activator
7. Place the Activator

That should do it-- I'd suggest using either an invisible collisionbox activator, or the actual wood for the fire as the controler :)
User avatar
Tamara Primo
 
Posts: 3483
Joined: Fri Jul 28, 2006 7:15 am

Post » Mon Nov 29, 2010 8:17 pm

A perfect script, works flawlessly. Thanks.

btw, how did you come by this info? And do you know how you'd make this work for light switches?
User avatar
Lucy
 
Posts: 3362
Joined: Sun Sep 10, 2006 4:55 am

Post » Mon Nov 29, 2010 2:03 pm

You can make it work for a light-switch exactly the same, just attaching the script to the switch, more-or-less; the main issue would be what you use as a light (if memory serves, there are lit and unlit Lamps/lights, and others that don't actually give off light at all, despite looking like they would...). But the general pricipal is the same-- just toggling a variable, and using the current value to decide whether to enable/disable a light-reference.
User avatar
Philip Lyon
 
Posts: 3297
Joined: Tue Aug 14, 2007 6:08 am

Post » Mon Nov 29, 2010 8:01 pm

So would 'firestate' be useful for a lightswitch? Shouldn't it be 'lightstate' instead? Or does it work differently?
User avatar
Anthony Diaz
 
Posts: 3474
Joined: Thu Aug 09, 2007 11:24 pm

Post » Tue Nov 30, 2010 1:11 am

It wouldn't matter: "FireState" is just a Variable name-- it doesn't mean anything to Oblivion, beyond indicating that there is a Variable there (so it's like saying "something goes here")-- the name can be literally anything you want, but should be something you'll understand/remember.

i.e., common practice is to have a "Run Once" check be called something like "DoOne" or "Once", et cetera, but could easily be "DoAMillionTimes", because the writing is just a label for you, whilst Oblivion sees it differently (don't ask me HOW Oblivion sees it, however, since I have no idea...). The only thing is to be careful not to use the same Variable Name in the same script (but you can have ten scripts with the same Variable ID once each).
User avatar
Portions
 
Posts: 3499
Joined: Thu Jun 14, 2007 1:47 am

Post » Tue Nov 30, 2010 12:51 am

Ok, thanks
User avatar
Jinx Sykes
 
Posts: 3501
Joined: Sat Jan 20, 2007 11:12 pm


Return to IV - Oblivion