Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Light Dim Script help


darkranger85
 Share

Recommended Posts

Hey,

Just to preface this, this script will be for Fallout 3 not oblivion.

I'm looking to make lights that dim at night and then go back to normal in the morning.

I don't want to be given a script that does it, I want to discover it on my own but, as the only experience I have so far is completing the second scripting lesson here I don't know where to begin. I know I'm going to have to reference the lights but I don't know how and I also don't know all the commands I would need.

So, can someone point me in the right direction to get me started?

Or, is this a script that is out of my expertise right now and I should try something else?

Thanks guys!

Link to comment
Share on other sites

Lights do not dim in the game, nor do they fade.

But you can sort of simulate the effect using the command 'disable' and 'enable'. If the player is in the cell when the scripted light change occurs, its rather obvious that it happened.

You set how many lights you want. For example, day, night, perhaps evening and morning. You then script using 'GameHour' which lights you want enabled.

Since you don't want the script written for you, I will leave it like this for now. Its such an easy script that an example would be writing it for you. :lmao:

float myHour
begin GameMode
set myHour to GameHour
if myHour < 5 && myHour > 20[/code]

Link to comment
Share on other sites

Ok, I did a little research on the enable and disable commands.

So, picking apart the script.

Storing the current game time in the variable and then checking to see if it is less than 5 or greater than 20.

Now, my first question would be what do 5 and 20 convert to in time? Is it going on a 24 hour clock?

Now, as for the next part of the script I'm going out on a limb here but I'm going to assume I would put in the light source ref and then .disable?

Then I'm going to also assume that to turn the lights back on you simply reverse the process?

Am I on the right track or just making an idiot out of myself? lol

Link to comment
Share on other sites

You store the current game hour because its slightly quicker to call that function once instead of several times.

5 is before 5am, and 20 is after 8pm. Yes, its military time.

Yes, the 'reference id name' you gave either the one light source, or the 'parent object' is used as a preface to the enable or disable command.

Daylight hours:

myLight01REF.enable
Nighttime hours:
myLight01REF.disable

You can use the 'else' to turn the lights on. So if the current hour is NOT before 5am and its NOT after 8am, then you would 'enable' the lights because its daytime.

Link to comment
Share on other sites

:dizzy::clap::wicket::woohoo: YAY! I'm learning!! :woot::wicket::clap::dizzy:

I didn't think the script would be that simple. My view of scripting and coding is that if it's something I want to do it must inherently be too complicated for me to understand lol.

Could you enlighten me a little about parent objects and stuff. I've seen it talked about but I don't really understand what it means.

Edited by darkranger85
Link to comment
Share on other sites

It sounds like you need to take the CS Basics classes. The first lesson talkes about the 'reference' window.

The script is very easy compared to, say, my solar scorcher weapons' recharge script.

Here is how a reference ID would be used.

gallery_85_79_8484.jpg

You see the 'reference window' on the bottom right? It contains an 'Enable Parent' tab. That is used to have that object point to another object. All these children objects will enable or disable depending on the state of the parent object.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...