Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: TIME game Mechanic  (Read 7119 times)

0 Members and 1 Guest are viewing this topic.

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
TIME game Mechanic
« on: May 23, 2006, 11:57:39 AM »

Hi,
     Has anyone done or been abale to do a proper time mechanic in their project.

What I mean is this - The player starts a level and has a specified amount of time to complete te level and escape.

The player should be able to save/load and the TIMER freeze and start respectively.

The TIMER can be set and reset for different levels, harder ones need more time etc etc.


I want to create an animated hour glass as a window that animates in the scene and I want the sprite to reflect the time left by the timer.

So if there is only say 5 mins left the hour glass animates and empties to that point. Like a real hour glass would do if you were timed with it whilst you did a task.


If anyone has any ideas or test scripts in order to do this I would be really grateful.


Cheers


Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: TIME game Mechanic
« Reply #1 on: May 23, 2006, 03:54:36 PM »

Game.CurrentTime is all you need. It's paused when the game is frozen, it gets saved and restored. To "start a timer", simply remember the starting time in some global variable. And by comparing the starting time with Game.CurrentTime you get the elapsed time.
You'll probably need to create some script which will be periodically checking the elapsed time and updating the hourglass graphics appropriately.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TIME game Mechanic
« Reply #2 on: May 24, 2006, 01:46:24 PM »

Thanks Mnemonic, have you or anyone got any example cripts on how this can be achieved, I can set the global up but its the peridoic checking and ipdating the windows graphics thats getting me puzzled.


 ::beer
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TIME game Mechanic
« Reply #3 on: May 24, 2006, 02:15:54 PM »

I do not think the Game.CurrentTime idea will work, because I only want a timer to be running in certain levels, the Game.CurrentTime command could be at any value when the player starts one of these timed levels. So I cannot specify an exact time that the player needs to finish the level in.

What I need is either a timer that increments and when it gets to a certain number the player has lost - run out of time.

I know this timer would not be frozen when saved and started when a save game is reloaded, but because this is a end of game level I was thinking the player would not be able to save whist playing it.

Can the Save task be stopped for a certain level (number of scenes) so the player cannot save the game??

If so how?

and how would a timer that is set update window graphics to represent, 100% ,75%,50%,25%,0% time left??


This is the last piece of coding I need to sort out on my project but it is crucial to the 7 endings.


Many thanks
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: TIME game Mechanic
« Reply #4 on: May 24, 2006, 02:37:11 PM »

Well, when the puzzle starts put the Game.CurrentTime into a variable. And then just check Game.CurrentTime with a loop and just do something like "Game.CurrentTime - TimePuzzleStarted". (This is NO real code) and you'll get the time the player is actually playing the puzzle.
« Last Edit: May 24, 2006, 03:05:38 PM by odnorf »
Logged
fl*p

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: TIME game Mechanic
« Reply #5 on: May 24, 2006, 02:39:32 PM »

Can the Save task be stopped for a certain level (number of scenes) so the player cannot save the game??

If so how?

Disable the "save" button in the scenes you want.
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: TIME game Mechanic
« Reply #6 on: May 24, 2006, 04:08:33 PM »

I do not think the Game.CurrentTime idea will work, because I only want a timer to be running in certain levels, the Game.CurrentTime command could be at any value when the player starts one of these timed levels. So I cannot specify an exact time that the player needs to finish the level in.
Of course you can. You'll be using the *elapsed* time since some point in time (the time when the puzzle started; it's absolutely irrelevant what the actual time was).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TIME game Mechanic
« Reply #7 on: May 24, 2006, 05:28:34 PM »

Thanks for your input but I am not a scripter or programmer I am a Visuals and game designer, I can work out the mechanics and design scenes and any graphics you can think of, 2D and 3D, animate, story line etc etc but I cannot for the life of me script.


If there is anyone out there that can do this and email me or post some test code that would put me out of my misery.  ;D

Many thanks




Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: TIME game Mechanic
« Reply #8 on: May 25, 2006, 10:20:30 AM »

I have gone down a different route with this now, I am going to stop SAVE in these end sequences and also setup a step design, where the player has only so many steps before the hour glass graphic empties a section.

This way it will be more specific to the level, number of scenes and puzzles.

Many thanks for your input
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS
 

Page created in 0.042 seconds with 24 queries.