Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Restoring timer after loading game?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Meatballsub
Divine Bovine




Joined: 16 Jun 2003
Posts: 437
Location: Northwest Georgia

PostPosted: Thu Jul 17, 2008 11:21 am    Post subject: Restoring timer after loading game? Reply with quote

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
View user's profile Send private message Visit poster's website
Chenzi
User was banned for this post




Joined: 02 Aug 2003
Posts: 190
Location: Grand Rapids, MI

PostPosted: Thu Jul 17, 2008 2:21 pm    Post subject: Re: Restoring timer after loading game? Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Thu Jul 17, 2008 2:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Thu Jul 17, 2008 2:31 pm    Post subject: Reply with quote

It still won't work quite right with timers that count down during menus, but it's not exploitable, either.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Meatballsub
Divine Bovine




Joined: 16 Jun 2003
Posts: 437
Location: Northwest Georgia

PostPosted: Thu Jul 17, 2008 4:30 pm    Post subject: Reply with quote

Works like a charm. Much appreciated folks.
_________________
MOCBJ Software - My Games
The Hamster Wheel - OHRRPGCE Information Database
Back to top
View user's profile Send private message Visit poster's website
Chenzi
User was banned for this post




Joined: 02 Aug 2003
Posts: 190
Location: Grand Rapids, MI

PostPosted: Thu Jul 17, 2008 5:05 pm    Post subject: Reply with quote

Any time.
_________________
Allow me to preemptively disclose that I probably hate the person posting below, including myself.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group