Dinner Anyone Script?

Post » Thu Sep 24, 2015 7:47 pm

I know that there is a way to have meals on the table set to appear/disappear at certain times because I've seen it in a few mods. I'm assuming its a script. Anybody know how its done?

User avatar
I love YOu
 
Posts: 3505
Joined: Wed Aug 09, 2006 12:05 pm

Post » Thu Sep 24, 2015 8:39 pm

give all the foodstuff on the table an enable parent. Then enable that when you want the table set, and disable it when you want it clear. I usually use an xmarker off to the side. You can have several markers, each with different enable children, so you can have flowers and whatnot there when not using the table for meals

If you want the food to disappear during a scene, that's harder, but the same principle.

User avatar
Dewayne Quattlebaum
 
Posts: 3529
Joined: Thu Aug 30, 2007 12:29 pm

Post » Fri Sep 25, 2015 9:51 am

Is there a guide to how to work with enable parent? I have not worked with that. Thanks, Doc.

User avatar
Fam Mughal
 
Posts: 3468
Joined: Sat May 26, 2007 3:18 am

Post » Fri Sep 25, 2015 4:32 am

  • Stick an x-marker next to your table
  • stick a plate on the table
  • double click the food item
  • find the tab in the object reference dialogue that says "enable parent" or some such
  • choose the option to set the enable parent from the render area and click on the x-marker - exactly the same as the link ref
  • now if you disable the xmarker, the plate is disabled too

You can test this by using something visible, like a skull or a flat iron, in place of the xmarker. then you can select it in game and disable it and see if the plate vanishes too

One marker can have lots of enable children, and you can have chains with children having children of their own.

Also you can select a lot of refs in the cell info window and right click to set the enable parent for them all

One last thing - you can set a ref to have the opposite enable state to its parent. So if you want to have either flowers or food, you can make the flowers use the opposite enable state and you'll have either flowers or food depending on the state of the xmarker

User avatar
Marie Maillos
 
Posts: 3403
Joined: Wed Mar 21, 2007 4:39 pm

Post » Fri Sep 25, 2015 11:20 am

Let me see if I can play around with this getting it to work over the next day or so. THANKS!

User avatar
Daddy Cool!
 
Posts: 3381
Joined: Tue Aug 21, 2007 5:34 pm

Post » Thu Sep 24, 2015 9:22 pm

Ok, question right off. From your instructions, where is the appear and disappear of the food set? I was hoping that this could be set automatically to happen at a specific time or times, not something I'd have to click on to work?

User avatar
Spaceman
 
Posts: 3429
Joined: Wed May 23, 2007 10:09 am

Post » Fri Sep 25, 2015 4:18 am

You need a script property pointing at the x-marker, or whatever you use as root. Then just enable it or disable it.

Let me tell you a story: There's a sheltered, hard to find valley in Skyrim, home of the Aleator family estate for countless generations. Centuries ago, an old, faithful retainer would light the lamps every night and put them out the following morning. One night he suffered a heat attack in the middle of his rounds, but such was his loyalty and determination that he finished the circuit, lighting all the lamps before he died.

As he has done every night since.

This is his script. Feel free to adapt it :smile:

Spoiler
Scriptname QAYL_Lamplighter_Script extends ObjectReference  import debugGlobalVariable Property Hour  Auto  ObjectReference Property lamp_toggle  Auto  bool function  is_day()    float h = hour.GetValue()    return h > 5 && h < 20endfunctionEvent OnLoad()    trace("QAYL: Lamplighter: WhhhooooOOOOoooooooOO!")    if is_day()        lamp_off()    else        lamp_on()    endif    RegisterForSingleUpdateGameTime(1.0)EndEventEvent OnUnload()    UnregisterForUpdateGameTime()EndEventEvent OnUpdateGameTime()    if is_day()        lamp_off()    else        lamp_on()    endif    RegisterForSingleUpdateGameTime(1.0)endeventfunction lamp_on()    if !is3dloaded()        return    endif    if lamp_toggle.isEnabled()        return    endif    lamp_toggle.enable()endfunctionfunction lamp_off()    if !is3dloaded()        return    endif    if lamp_toggle.isDisabled()        return    endif    lamp_toggle.disable()endfunction
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Fri Sep 25, 2015 10:55 am

Doc, that is great you are will to share your script, but I have not learned how to script at all yet, so I'm at a loss. Guess I'll have to learn scripting or forget about eating in skyrim.

User avatar
Sophie Louise Edge
 
Posts: 3461
Joined: Sat Oct 21, 2006 7:09 pm

Post » Fri Sep 25, 2015 9:45 am

Well, I can recommend the CK wiki scripting tutorials.

I don't know any way of doing timed events without a script.

User avatar
Sophie Louise Edge
 
Posts: 3461
Joined: Sat Oct 21, 2006 7:09 pm

Post » Fri Sep 25, 2015 2:30 am

Yes, I've been looking at the wiki....its not exactly terribly detailed nor specific. How did you learn it?

User avatar
yermom
 
Posts: 3323
Joined: Mon Oct 15, 2007 12:56 pm

Post » Fri Sep 25, 2015 7:28 am

I started with layout essentials and worked through them all. They're not comprehensive - you need to ask a lot of questions and read a lot of scripts and so on - but they show you how to go about things.

For instance, the scripting tutorials shows you how to attach a script to an object, and how to define and set a property. If you can do that, then you should be able to attach my lamplighter script to a static reference somewhere in the cell where you want the timer. I had a skull for my lamplighter ghost to live in, but anything will do.

After that, point the lamp toggle property at your enable parent and save. When you enter the cell in-game, the OnLoad event will run and the timer will start.

(Hmm... I thought I'd been a bit clever than that about the update loop. It certainly doesn't need to run every second).

User avatar
teeny
 
Posts: 3423
Joined: Sun Feb 25, 2007 1:51 am


Return to V - Skyrim