Difference between revisions of "GetSteamStat"

From The Official Visionaire Studio: Adventure Game Engine Wiki
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%">
+
==getSteamStat==
<b>Command History</b>
 
<div class="mw-collapsible-content">
 
<div style="background:#ebebeb" width="100%">Available since <span style="color:orange">v3.7</span></div>
 
</div></div>
 
  
 +
<div class="command-min-version-info">Available since: <span class="command-min-version">v3.6</span></div>
  
Returns the number of milliseconds since the command was first called - or since the timer was reset! <br/>
+
<div class="command-doc">Returns the requested steam stat.
Use this command for relative time measurements; for example: call getTime() at the beginning of an action & then again when the action has finished to get the time taken to perform said action!
 
<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%">
 
<b>Additional Info</b>
 
<div class="mw-collapsible-content">
 
<div>This command will only work if the steam_api library was included (& successfully loaded) & if a steam account for your game exists!</div>
 
</div></div>
 
  
 +
Note: this command only works if the steam_api library was loaded and if a steam account for your game exists.</div>
  
Syntax:
+
Lua Syntax:
<syntaxhighlight>
+
<pre class="command-syntax">getSteamStat(apiName)</pre>
getTime({flags=1, reset})
+
===Arguments===
</syntaxhighlight>
+
====apiName====
 
+
:'''"string"''' - The name of the requested stat. This is the API name specified in the steam account.
 
+
===Flags===
Example:
+
===Return Values===
<syntaxhighlight>
+
;stat
-- let's store the current time in a variable & then check it against current time!
+
:The integer value of the stat or -1 if the stat could not be retrieved.
local initialTime = getTime()
+
===Examples===
 
+
None.
-- we'll use this function to check current time elapsed & decided what action to perform!
 
function checkTime()
 
if getTime() >= initialTime + 3000 then -- if current time more than equals initial time + 3 seconds then ...  
 
  -- do some action!
 
  getTime({flags=1, reset=true}) -- let's reset timer back to zero!
 
end
 
end
 
 
 
-- the checkTime() function would be most effective, if included in a mainLoop event handler!
 
</syntaxhighlight>
 
 
 
 
 
 
 
<b><u>Arguments</u></b>
 
 
 
none
 
 
 
 
 
<b><u>Flags</u></b>
 
 
 
<b>r/reset</b> <br/>
 
True resets timer back to zero; false does nothing (if no flags are set then reset will be false by default)
 
 
 
 
 
<b><u>Return</u></b>
 
 
 
<b>time</b> <br/>
 
The integer value of the current time (in ms)
 
{{i18n|GetTime}}
 

Latest revision as of 22:27, 30 September 2014

getSteamStat

Available since: v3.6
Returns the requested steam stat. Note: this command only works if the steam_api library was loaded and if a steam account for your game exists.

Lua Syntax:

getSteamStat(apiName)

Arguments

apiName

"string" - The name of the requested stat. This is the API name specified in the steam account.

Flags

Return Values

stat
The integer value of the stat or -1 if the stat could not be retrieved.

Examples

None.