The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tracking playing time
Akasu Offline
Member

Posts: 62
Threads: 6
Joined: Aug 2010
Reputation: 2
#1
Tracking playing time

I was wondering if there is a smart way to track the time someone has played a certain custom story and display it when the player interacts with, for example, a clock entity in game.

The tracking could probably happen like this:
void OnStart()
{
AddGlobalVarInt("time", 0);
AddTimer("timer", 60, "tracker");
}

void tracker (string& asName)
{
SetGlobalVarInt("time", GetGlobalVarInt("time")+1; // don't know if it works like this. gotta test
AddTimer("timer", 60, "tracker");
}

This would track the game time every minute but the problem is how to display it... One way to do this is trough a debug message:
AddDebugMessage("Time played: "+GetGlobalVarInt("time"), false);
but the player would need to have debug mode on for it to show.

If it was done trough SetMessage I'd need to make lots of entries in the lang file which would be pretty time consuming.
So what would be the smartest way to do this?
08-09-2011, 04:28 PM
Find


Messages In This Thread
Tracking playing time - by Akasu - 08-09-2011, 04:28 PM
RE: Tracking playing time - by Your Computer - 08-09-2011, 04:40 PM
RE: Tracking playing time - by Apjjm - 08-09-2011, 06:21 PM
RE: Tracking playing time - by Phoroneus - 08-09-2011, 08:08 PM



Users browsing this thread: 1 Guest(s)