View previous topic :: View next topic |
Author |
Message |
Meatballsub Divine Bovine

Joined: 16 Jun 2003 Posts: 437 Location: Northwest Georgia
|
Posted: Thu Jul 17, 2008 11:21 am Post subject: Restoring timer after loading game? |
|
|
I have a timer that is set in the intro script. Is there a way to "save" the timer information when the user saves so it can be loaded back when you restart your game?
If not, I have a workaround that I can do, but it isn't going to be as pretty as something like this would be. _________________ MOCBJ Software - My Games
The Hamster Wheel - OHRRPGCE Information Database |
|
Back to top |
|
 |
Chenzi User was banned for this post

Joined: 02 Aug 2003 Posts: 190 Location: Grand Rapids, MI
|
Posted: Thu Jul 17, 2008 2:21 pm Post subject: Re: Restoring timer after loading game? |
|
|
Meatballsub wrote: | I have a timer that is set in the intro script. Is there a way to "save" the timer information when the user saves so it can be loaded back when you restart your game?
If not, I have a workaround that I can do, but it isn't going to be as pretty as something like this would be. |
Arn't global variables saved? Try using those. _________________ Allow me to preemptively disclose that I probably hate the person posting below, including myself. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Jul 17, 2008 2:27 pm Post subject: |
|
|
Yes, as Chenzi says, you can use "read timer" to get the current state of your timers and store them in global variables.
The trick is to make sure you save them right before the user saves.
You could replace "Save" in the menu with a menu item that runs a script. The script could do the work of saving the timers, and then it could use the "save menu" command to display the screen to allow the player to save.
Then in your game's on-load script, you can re-start any timers that need restarting. |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Thu Jul 17, 2008 2:31 pm Post subject: |
|
|
It still won't work quite right with timers that count down during menus, but it's not exploitable, either. _________________
|
|
Back to top |
|
 |
Meatballsub Divine Bovine

Joined: 16 Jun 2003 Posts: 437 Location: Northwest Georgia
|
|
Back to top |
|
 |
Chenzi User was banned for this post

Joined: 02 Aug 2003 Posts: 190 Location: Grand Rapids, MI
|
Posted: Thu Jul 17, 2008 5:05 pm Post subject: |
|
|
Any time. _________________ Allow me to preemptively disclose that I probably hate the person posting below, including myself. |
|
Back to top |
|
 |
|