Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Help with a script  (Read 3022 times)

0 Members and 1 Guest are viewing this topic.

chorl41a

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 19
    • View Profile
Help with a script
« on: June 24, 2010, 01:24:02 PM »

Good afternoon.

Aydua need to make a script.

What I seek is:

I have a scene mode colored Day, Evening and Night.

And what I want to make is that the game tell me what time it is to know whether to be the day, evening or night.
In the past I had a script to do the transition but I lost it.

In conclusion, what I seek is to do it in real time.

No Mas.

Thank you so much.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Help with a script
« Reply #1 on: June 24, 2010, 02:09:13 PM »

You mean you want to find the actual time of the day, in real time? You'd use the Date object for it.

Code: WME Script
  1. var CurrentTime = new Date();
  2.  
  3. if (CurrentTime.GetHours() > 6 && CurrentTime.GetHours() < 20) Game.Msg("day");
  4. else if (CurrentTime.GetHours() > 20 && CurrentTime.GetHours() < 23) Game.Msg("evening");
  5. else Game.Msg("night");
  6.  
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

chorl41a

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 19
    • View Profile
Re: Help with a script
« Reply #2 on: June 24, 2010, 03:28:48 PM »

Thank you very much for reply.
Logged
 

Page created in 0.022 seconds with 20 queries.