April 28, 2024, 09:09:29 AM
Welcome,
Guest
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
For WME related articles and tutorials visit
WME Resource Center
.
Home
Help
Search
Calendar
Login
Register
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
Time doesn't run out
« previous
next »
Pages: [
1
]
Print
Author
Topic: Time doesn't run out (Read 2598 times)
0 Members and 1 Guest are viewing this topic.
Catacomber
Supporter
Frequent poster
Karma: 0
Offline
Gender:
Posts: 443
I love mice.
Time doesn't run out
«
on:
February 15, 2009, 06:09:33 AM »
I have a timed scene which works fine as long as you finish before the time doesn't run out. The problem is that the time just doesn't run out--the timer doesn't work.
Code: WME Script
var
timer=
6
;
timer = timer
-1
;
{
if
(
!
(
timer ==
0
)
)
{
Game
.
Msg
(
"Countdown: "
+ timer
)
;
Sleep
(
1000
)
;
}
else
{
if
(
timer ==
0
)
{
Sleep
(
50
)
;
Game
.
ChangeScene
(
"scenes\Vacation_House\Vacation_House.scene"
)
;
}
}
}
I don't get any script error but the scene doesn't change when the time runs down.
Logged
http://www.catacomber.com/
Code: WME Script
Mnemonic is wonderful.
Catacomber
Supporter
Frequent poster
Karma: 0
Offline
Gender:
Posts: 443
I love mice.
Re: Time doesn't run out
«
Reply #1 on:
February 15, 2009, 06:30:12 AM »
If I use this code:
Code: WME Script
for
(
var
timer=
50
;timer>
-1
;timer = timer
-1
)
{
Game
.
Msg
(
"Countdown: "
+ timer
)
;
}
if
(
timer=
0
)
{
Sleep
(
50
)
;
Game
.
ChangeScene
(
"scenes\Vacation_House\Vacation_House.scene"
)
;
}
Everything works the way I'd like it to but I get a script error asking me why I didn't use == instead of = in the bit if(timer=0).
Logged
http://www.catacomber.com/
Code: WME Script
Mnemonic is wonderful.
Catacomber
Supporter
Frequent poster
Karma: 0
Offline
Gender:
Posts: 443
I love mice.
Re: Time doesn't run out
«
Reply #2 on:
February 15, 2009, 06:53:24 AM »
Well, I got this to work perfectly:
: )
Code: WME Script
for
(
var
timer=
50
;timer>=
1
;timer = timer
-1
)
{
Game
.
Msg
(
"Countdown: "
+ timer
)
;
Sleep
(
3000
)
;
}
if
(
timer==
0
)
{
Sleep
(
50
)
;
Game
.
StopMusic
(
)
;
Game
.
PlayMusicChannel
(
0
,
"Music\IngridVictoria'sTheme.ogg"
,
true
)
;
Game
.
SetMusicChannelVolume
(
0
,
90
)
;
Game
.
ChangeScene
(
"scenes\Vacation_House\Vacation_House.scene"
)
;
}
: )
You cannot imagine how happy I was. : )
Logged
http://www.catacomber.com/
Code: WME Script
Mnemonic is wonderful.
Print
Pages: [
1
]
« previous
next »
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
Time doesn't run out