Difference between revisions of "HoursToSeconds"

From NWN Lexicon
Jump to: navigation, search
m (Wikified article formatting)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
 
 
 
=HoursToSeconds(int)=
 
 
 
This function calculates the number of actual seconds in n game hour(s).
 
This function calculates the number of actual seconds in n game hour(s).
  
 
<nwscript>
 
<nwscript>
[[float | float ]] HoursToSeconds(
+
float HoursToSeconds(
    [[int | int ]] nHours
+
    int nHours
);
+
);
 
</nwscript>
 
</nwscript>
  
====Parameters====
+
===Parameters===
 
+
; nHours
''nHours''
+
: The number of hours to turn into seconds.
 
 
The number of hours to turn into seconds.
 
 
 
<br />
 
 
 
====Description====
 
  
 +
===Description===
 
Converts nHours into a number of seconds. The result will depend on how many minutes there are per hour, configured in the advanced properties of the module (default is 2 minutes per hour, so the default settings would return 120 seconds if nHours were 1).
 
Converts nHours into a number of seconds. The result will depend on how many minutes there are per hour, configured in the advanced properties of the module (default is 2 minutes per hour, so the default settings would return 120 seconds if nHours were 1).
  
<br /><br />
+
===Version===
 +
1.28
  
====Version====
+
===Example===
 +
<nwscript>
 +
// Delay a speakstring command for 1 hour (executed on the object that calls it)
 +
void main()
 +
{
 +
    // Declare the variables
 +
    string sHello = "Hello";
 +
    float fSeconds = HoursToSeconds(1);
 +
    // Delay the speakstring
 +
    DelayCommand(fSeconds, SpeakString(sHello));
 +
}
  
1.28
 
  
====Example====
 
 
<nwscript>
 
// Delay a speakstring command for 1 hour (executed on the object that calls it)
 
void main()
 
{
 
    // Declare the variables
 
    string sHello = "Hello";
 
    float fSeconds = HoursToSeconds(1);
 
    // Delay the speakstring
 
    DelayCommand(fSeconds, SpeakString(sHello));
 
}
 
 
 
 
</nwscript>
 
</nwscript>
  
====See Also====
+
===See Also===
 
 
 
{| class="seealso"
 
{| class="seealso"
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
|
+
| [[SetTime]]
[[ SetTime  | SetTime ]]
 
|-
 
 
|}
 
|}
  
<br />
 
 
----
 
----
<font color="gray">  author: Charles Feduke, editor: Jasperre, additional contributor(s): Lilac Soul</font><br />  <br />
+
<font color="gray">  author: Charles Feduke, editor: Jasperre, additional contributor(s): Lilac Soul</font>
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Time_Functions]]
 
[[Category:Time_Functions]]
 +
{{DISPLAYTITLE:HoursToSeconds(int)}}

Latest revision as of 10:37, 30 December 2020

This function calculates the number of actual seconds in n game hour(s).

float HoursToSeconds(
    int nHours
);

Parameters

nHours
The number of hours to turn into seconds.

Description

Converts nHours into a number of seconds. The result will depend on how many minutes there are per hour, configured in the advanced properties of the module (default is 2 minutes per hour, so the default settings would return 120 seconds if nHours were 1).

Version

1.28

Example

// Delay a speakstring command for 1 hour (executed on the object that calls it)
void main()
{
    // Declare the variables
    string sHello = "Hello";
    float fSeconds = HoursToSeconds(1);
    // Delay the speakstring
    DelayCommand(fSeconds, SpeakString(sHello));
}

See Also

functions:  SetTime

 author: Charles Feduke, editor: Jasperre, additional contributor(s): Lilac Soul