Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] In-game clock not working
DanielRand47 Away
Member

Posts: 109
Threads: 16
Joined: Mar 2012
Reputation: 3
#4
RE: In-game clock not working

(09-22-2016, 03:23 AM)Romulator Wrote: Try putting your Global Vars into a file called global.hps in your /maps directory, with this code.

PHP Code: (Select All)
void OnGameStart()
{
    
SetGlobalVarInt("Hours"gameHours);
    
SetGlobalVarInt("Minutes"gameMinutes);
    
SetGlobalVarFloat("TimeScale"timeScale);


Then remove the SetGlobalVars in your OnLeave();.

You should also start a new game when testing this, since OnGameStart() is only called when you click "New Game" from the menu.

Alright thanks. I'll do that!

(09-22-2016, 03:28 AM)Mudbill Wrote: One thing you can try is to

PHP Code: (Select All)
int gameHours;
int gameMinutes;
float timeScale;

void OnEnter() {
    
gameHours GetGlobalVarInt("Hours");
    
gameMinutes GetGlobalVarInt("Minutes");
    
timeScale GetGlobalVarInt("TimeScale");


Perhaps that will fix, if not all but some of the problems.

Another thing is I don't think timers run across maps, so your "Stop" timer from OnLeave might not run in the second map, but rather wait until you return to the original map. Not 100% sure here though.

Your solution works! Thanks for this advice! Now to do as Romulator suggested and put them into a global.hps file.
(This post was last modified: 09-22-2016, 03:46 AM by DanielRand47.)
09-22-2016, 03:45 AM
Find


Messages In This Thread
RE: In-game clock not working - by Romulator - 09-22-2016, 03:23 AM
RE: In-game clock not working - by DanielRand47 - 09-22-2016, 03:45 AM
RE: In-game clock not working - by Mudbill - 09-22-2016, 03:28 AM



Users browsing this thread: 1 Guest(s)