<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=HPL3%2FSOMA%2FScripting%2FGeneral_Helper</id>
	<title>HPL3/SOMA/Scripting/General Helper - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=HPL3%2FSOMA%2FScripting%2FGeneral_Helper"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Scripting/General_Helper&amp;action=history"/>
	<updated>2026-10-04T04:28:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Scripting/General_Helper&amp;diff=7220&amp;oldid=prev</id>
		<title>TiMan: Add a sourced SOMA guide with explanations and stock-script examples.</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Scripting/General_Helper&amp;diff=7220&amp;oldid=prev"/>
		<updated>2026-10-02T12:10:01Z</updated>

		<summary type="html">&lt;p&gt;Add a sourced SOMA guide with explanations and stock-script examples.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{shortPageTitle}}&lt;br /&gt;
&lt;br /&gt;
The General helper turns a number of seconds into a clock display. This short example prints a clock string so you can see how the format switches work.&lt;br /&gt;
&lt;br /&gt;
== Print a clock string ==&lt;br /&gt;
# Open your mod’s map script. Keep its generated map class and callbacks; see [[HPL3/SOMA/Getting Started/Add Your First Script|Add your first script]].&lt;br /&gt;
# Add this include alongside the other includes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;helpers/helper_general.hps&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Put the following body inside your existing &amp;lt;code&amp;gt;OnStart()&amp;lt;/code&amp;gt; callback:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart()&lt;br /&gt;
{&lt;br /&gt;
    tString clock = String_SecondsToClockDisplay(65.25f, false, true, true, true);&lt;br /&gt;
    cLux_AddDebugMessage(clock);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save and start the map in development mode. If it is already running, press &amp;lt;code&amp;gt;F5&amp;lt;/code&amp;gt; to restart it.&lt;br /&gt;
&lt;br /&gt;
The debug message is &amp;lt;code&amp;gt;01:05:25&amp;lt;/code&amp;gt;: one minute, five seconds and 25 hundredths. The four Boolean arguments select hours, minutes, seconds and hundredths, in that order. Here hours are hidden.&lt;br /&gt;
&lt;br /&gt;
== Change the format ==&lt;br /&gt;
The helper extracts each time component, pads values below 10 with a leading zero and separates enabled components with colons. Changing the last argument to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; hides hundredths and gives &amp;lt;code&amp;gt;01:05&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The seconds component is not the total number of seconds. If you enable only seconds for this input, the result is &amp;lt;code&amp;gt;05&amp;lt;/code&amp;gt;; whole minutes have already been removed.&lt;br /&gt;
&lt;br /&gt;
== A stock use ==&lt;br /&gt;
The stock &amp;lt;code&amp;gt;String_SecondsToClockDisplay&amp;lt;/code&amp;gt; caller formats an ETA with hours and hundredths hidden. You can use the same switches for a minutes-and-seconds display.&lt;br /&gt;
&lt;br /&gt;
== If the message does not appear ==&lt;br /&gt;
Check that you edited the script beside your mod’s map, retained its class and callback structure, and added the include. In development mode, use &amp;lt;code&amp;gt;F1&amp;lt;/code&amp;gt; → '''Show Error List''' or '''Show HPL Log'''.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[HPL3/SOMA/Getting Started/Test Debug and Continue|Test and debug your script]]&lt;br /&gt;
&lt;br /&gt;
[[Category:English]]&lt;/div&gt;</summary>
		<author><name>TiMan</name></author>
		
	</entry>
</feed>