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: Game.Reset() and the timer  (Read 1664 times)

0 Members and 1 Guest are viewing this topic.

Dan Peach

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 100
    • View Profile
    • Viperante - Game Development
Game.Reset() and the timer
« on: November 07, 2012, 11:56:41 PM »

Hello,

Just a quick question about the Game.Reset(); method - it says in the docs that it sets the timer to zero, however when playing in debug mode, the "timer" that is displayed in green on the right is NOT reset to zero when I call Game.Reset();

Is this right? Is there another timer in the game that gets reset to zero? It doesn't matter either way - I would just like to know, so that I know my "reset" is working properly.  :)

Thanks.

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile
Re: Game.Reset() and the timer
« Reply #1 on: November 08, 2012, 08:28:38 AM »

Hi,

I have the same issue, so it needs to use some tricks to "zeroing" timer.

Hello,

Just a quick question about the Game.Reset(); method - it says in the docs that it sets the timer to zero, however when playing in debug mode, the "timer" that is displayed in green on the right is NOT reset to zero when I call Game.Reset();

Is this right? Is there another timer in the game that gets reset to zero? It doesn't matter either way - I would just like to know, so that I know my "reset" is working properly.  :)

Thanks.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: Game.Reset() and the timer
« Reply #2 on: November 23, 2012, 09:06:58 AM »

The documentation is wrong. Reset() doesn't zero the timer because it would break some vital stuff.
You should be able to create a script that will periodically update some global variable, creating your own private timer.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Dan Peach

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 100
    • View Profile
    • Viperante - Game Development
Re: Game.Reset() and the timer
« Reply #3 on: November 24, 2012, 12:24:00 PM »

Thanks guys. I'm not actually using the timer for anything. I just noticed that it wasn't set to zero, and wanted to make sure that was correct. :)
 

Page created in 0.148 seconds with 23 queries.