Is this possible? Global countdown in the middle of the game

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Is this possible? Global countdown in the middle of the game

Postby buxton » Thu Oct 11, 2007 4:16 am

Hi!

I am making a game where I wish to have a countdown from a paticular event, the global countdown works well, but I wonder if there is a way to make it start from an action in the middle of the game? and then to stop it once the task has been completed (over multiple frames). I am new to scripting but I wonder if it isn't possible to link the timer to the action with code?

I would really appreciate any thoughts you might have

Thanks
Buxton
buxton
Junior Member
 
Posts: 10
Joined: Mon Jul 31, 2006 12:11 pm

Postby Mystery » Sat Oct 13, 2007 6:09 pm

I think that it should be possible, however I've never tried it and I'm not sure either how to do it without trying it out myself.

Hopefully GM or ShadowHunter can help us with that question :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby buxton » Sat Oct 13, 2007 9:59 pm

Thank you for your reply Mystery,

I daresay I'm being overly ambitious :oops: but it would make all the difference to the game if I could somehow manage it :)

Buxton
buxton
Junior Member
 
Posts: 10
Joined: Mon Jul 31, 2006 12:11 pm

Postby jeffer012 » Sun Oct 14, 2007 3:42 am

i havent tried it but i would think that you could:
1. start the timer in the frame you need, then
2. when the user clicks a hotspot to go to another frame, save the timers time to a variable, then
3. In the new hotspot, read the timers variable and start a new timer from there and keep repeating step 2 and 3 until the final frame.
User avatar
jeffer012
Games Page Administrator
 
Posts: 50
Joined: Fri Nov 10, 2006 2:23 am
Location: Maryland

Postby GM-Support » Sun Oct 14, 2007 12:17 pm

You can also slightly modify the tutorial of the following URL ("How to create a global countdown") to make it start in the middle of the game instead of the beginning:
http://www.adventuremaker.com/help/vbsc ... #countdown

To do so, SKIP the step 4 of the tutorial, and execute the following code when you want to start the timer (in other words, add the following code to the "Advanced" tab of the Hotspot Properties that correspond to the place where the timer should start):

Code: Select all
Counter = 123
Action.GoToFrame Action.GetCurrentFrameName


The first line sets the initial value of the counter, in seconds (replace 123 with any value). The second line reloads the current frame so that the timer is created.

GM-Support
GM-Support
Forum Admin and Games Page admin
 
Posts: 2221
Joined: Thu Jun 05, 2003 7:52 pm

Postby buxton » Sun Oct 14, 2007 1:11 pm

Thank you so much! :D ,

and thank you to whoever changed the title to my post, I belatedly realised that was a silly title to give it, sorry :oops:

I will be trying this later today and will let you know how it goes :)

Buxton
buxton
Junior Member
 
Posts: 10
Joined: Mon Jul 31, 2006 12:11 pm

Postby buxton » Tue Oct 16, 2007 5:16 pm

A little update :)

Thank you GM-Support! The way you describe works perfectly,

I have used a single space instead of the 'Time is up text' under Sub ShowCounter to avoid having anything showing up on the screen during the earlier part of the game and the necesary graphics to make the score pretty set with a variable to spring into life as soon as the counter starts up, it looks good :D

And is just what I had in mind, thank you all for your help with this

Buxton
buxton
Junior Member
 
Posts: 10
Joined: Mon Jul 31, 2006 12:11 pm

Postby blacktrix » Fri Apr 18, 2008 1:27 pm

Hi, Sorry to revive an old thread and borrowing it for a while.
I used the method above to make my global timer in the middle of the game, but the only problem is, how do I make it stop?

Example:
The user has to find 3 items and deliver it to a location before the timer runs out. If the timer runs out, it goes to a "Game Over" Screen.

Once I delivered, I want the timer to stop (thus NOT going to the game over screen) AND go to a Win Screen.......

I know it's possible, but the coding is giving me a headache already....

Thank you in advance!

EDIT
Nevermind...... Figured it out......
I just set the counter to -999 on my win frame. Thanks.
blacktrix
Junior Member
 
Posts: 6
Joined: Mon Dec 11, 2006 3:55 am


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests