Jump to content


Photo

Tutorial 3: Day and Night Cycle


  • Please log in to reply
3 replies to this topic

#1 The Best Guest

The Best Guest

    Herald of Kane.....

  • Division Admins
  • 2,048 posts
  • Location:USA
  • Projects:Revora, {IP}
  •  Varied
  • Division:C&C Guild
  • Job:PR Admin

Posted 20 June 2010 - 01:50 PM

Here is the Day/Night script used in wars of Arda; I've used it myself in personal maps and they work quite nicely. Credit to DigitalGeneral

*** IF ***
True.
*** THEN ***
Set timer 'timechangego' to expire in 1200.00 seconds.

Explanation: Here you are just setting up the timer for setting up the cycle

*** IF ***
Timer 'timechangego' has expired.
*** THEN ***
Enable Script 'Script_4'.

Explanation: Saying if timer has expired, start the script that changes the light back to normal day (script 4)

In script Properties you must click evaluate script every 1200 Seconds.
*** IF ***
True.
*** THEN ***
Gradually interpolate all the scene lights to the color, red:0.05 green: 0.05. blue: 0.05 over 1200.00

Explanation: Script_3 is tricky to play around with, my best guess is that this is the percentage of light you have originally set. In addition this makes the light turn to day this is about the perfect mix of colors to make it appear dark but still able to see.

In script Properties you must click evaluate script every 1200 Seconds and make this script inactive.
*** IF ***
True.
*** THEN ***
Gradually interpolate all the scene lights to normal Time-Of-Day color, over:1200.00 seconds:
or you can add this script: Gradually interpolate all the scene lights to the color, red:1 green: 1. blue: 1 over 1200.00

Explanation:This script activates when the timer has expired and slowly returns the light to daylight. Ok basically, if 1200 seconds = 20 minutes, so if you want to change night and day to change to say 5 minutes you will need to do some quick math. [5minutes X 60SecondsInAMinute = 300 Seconds] so now you know 300 seconds is 5 minutes. Last thing to do is change any number that is 1200 to 300 in each script.

Edited by The Best Guest, 21 June 2010 - 03:16 AM.

mrbar.jpg
SEE-Team_MapEditor.jpg

#2 Puppeteer

Puppeteer

    title available

  • Global Moderators
  • 2,947 posts
  • Location:United Kingdom
  •  Faute de Mieux
  • Division:Community
  • Job:Magazine Staff/Global Moderator

Posted 20 June 2010 - 05:11 PM

I'm not going to pin this (or let someone else pin this) until you embellish it. So far it's only a quote for a script - that's not a tutorial. I've started you off with an agreeable format; you need to explain each script (what it does [be explicit], how changing the values changes the effect, where the scripts can be found). Until then, this is not a tutorial.
Also - are you sure the scripts work? I don't think it creates a cycle.

Edited by Puppeteer, 20 June 2010 - 05:15 PM.


#3 _Haldir_

_Haldir_

    Mapper

  • Project Team
  • 1,203 posts
  • Location:Australia
  • Projects:The Dwarf Holds, The Elven Alliance: Community Edition
  •  T3A Team Chamber Member

Posted 21 June 2010 - 01:45 AM

Very cool, though perhaps a quick note on where you can find the various scripts would be useful :thumbsupsmiley:
And i think Pup's right, wouldn't you need a script along the lines of:

**IF** Timer has expired **THEN** Activate Script 4 ..?

Screens would be nice too :good:
I haven't started my next tutorial yet, but i'll hopefully have it done the next day or so.

Posted Image Posted Image


#4 The Best Guest

The Best Guest

    Herald of Kane.....

  • Division Admins
  • 2,048 posts
  • Location:USA
  • Projects:Revora, {IP}
  •  Varied
  • Division:C&C Guild
  • Job:PR Admin

Posted 21 June 2010 - 03:12 AM

Yes it definitely works because the script is being evaluated every set period. Added the explanations too and haldir the script that does that is script 2 :good:
mrbar.jpg
SEE-Team_MapEditor.jpg




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users