April 24, 2024, 08:47:41 AM
Welcome,
Guest
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Forum rules
-
please read before posting, it can save you a lot of time.
Home
Help
Search
Calendar
Login
Register
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
Help with a script
« previous
next »
Pages: [
1
]
Print
Author
Topic: Help with a script (Read 3037 times)
0 Members and 1 Guest are viewing this topic.
chorl41a
Lurker
Karma: 0
Offline
Posts: 19
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
Gender:
Posts: 5683
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
var
CurrentTime
=
new
Date
(
)
;
if
(
CurrentTime
.
GetHours
(
)
>
6
&&
CurrentTime
.
GetHours
(
)
<
20
)
Game
.
Msg
(
"day"
)
;
else
if
(
CurrentTime
.
GetHours
(
)
>
20
&&
CurrentTime
.
GetHours
(
)
<
23
)
Game
.
Msg
(
"evening"
)
;
else
Game
.
Msg
(
"night"
)
;
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum.
chorl41a
Lurker
Karma: 0
Offline
Posts: 19
Re: Help with a script
«
Reply #2 on:
June 24, 2010, 03:28:48 PM »
Thank you very much for reply.
Logged
Print
Pages: [
1
]
« previous
next »
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
Help with a script