<?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%2FPlayer_States</id>
	<title>HPL3/SOMA/Scripting/Player States - 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%2FPlayer_States"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Scripting/Player_States&amp;action=history"/>
	<updated>2026-10-04T05:22:14Z</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/Player_States&amp;diff=7262&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/Player_States&amp;diff=7262&amp;oldid=prev"/>
		<updated>2026-10-02T12:22:25Z</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;
Player states select the current player interaction or control mode. SOMA registers normal control, grab, push, terminal interaction, conversation and custom-controls states, among others. The custom-controls helper installs named callbacks for look, movement, actions and leaning before changing the player state.&lt;br /&gt;
&lt;br /&gt;
== States ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! ScriptFile !! ScriptClass&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Normal&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Normal.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Normal&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_Grab&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_Grab.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_Grab&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_Push&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_Push.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_Push&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_Wheel&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_Wheel.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_Wheel&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_Slide&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_Slide.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_Slide&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_SwingDoor&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_SwingDoor.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_SwingDoor&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_Lever&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_Lever.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_Lever&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_Tear&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_Tear.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_Tear&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_Terminal&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_Terminal.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_Terminal&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_HandheldTerminal&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_HandheldTerminal.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_HandheldTerminal&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_Read&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_Read.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_Read&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_MovingButton&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_MovingButton.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_MovingButton&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Ladder&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Ladder.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Ladder&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_ClimbLedge&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_ClimbLedge.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_ClimbLedge&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_InteractiveCameraAnimation&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_InteractiveCameraAnimation.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_InteractiveCameraAnimation&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Sit&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Sit.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Sit&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Conversation&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Conversation.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Conversation&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Dead&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Dead.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Dead&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Interact_ZoomArea&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Interact_ZoomArea.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Interact_ZoomArea&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_CustomControls&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_CustomControls.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_CustomControls&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;State_Null&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;player/PlayerState_Null.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrPlayerState_Null&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MoveStates ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! ScriptFile !! ScriptClass&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MoveState_Normal&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;main/MoveState_Normal.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrMoveState_Normal&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MoveState_Climb&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;main/MoveState_Climb.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrMoveState_Climb&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MoveState_Dead&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;main/MoveState_Dead.hps&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cScrMoveState_Dead&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Before you start ==&lt;br /&gt;
# Open the map script inside your own mod. Keep its generated includes, &amp;lt;code&amp;gt;cScrMap : iScrMap&amp;lt;/code&amp;gt; class and callback structure. See [[HPL3/SOMA/Getting Started/Add Your First Script|Add your first script]] if you have not edited a map script yet.&lt;br /&gt;
# Add the helper include shown below alongside the script’s other includes.&lt;br /&gt;
# Read the stock example before copying its calls: named entities, voice subjects, materials and callbacks must belong to the map or resources you are using.&lt;br /&gt;
&lt;br /&gt;
== Follow the stock example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;helpers/helper_player.hps&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Player_ChangeStateToCustomControls ===&lt;br /&gt;
Changes the player state so that the normal controls are used for something else.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asLookInputCallback&amp;lt;/code&amp;gt; || Overrides look controls. If false is returned, normal controls are overridden. Syntax: bool F(const cVector2f &amp;amp;in avLookAmount)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asMoveInputCallback&amp;lt;/code&amp;gt; || Overrides move controls. If false is returned, normal controls are overridden. Syntax: bool F(const cVector2f &amp;amp;in avMoveAmount)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asActionInputCallback&amp;lt;/code&amp;gt; || Overrides action input. If false is returned, normal controls are overridden. Syntax: bool F(int alAction, bool abPressed)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asLeanInputCallback&amp;lt;/code&amp;gt; || Overrides lean input. If false is returned, normal controls are overridden. Syntax: bool F(float afAmount)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;maps/chapter05/05_01_phi_inside/05_01_phi_inside.hps&amp;lt;/code&amp;gt;, SOMA calls &amp;lt;code&amp;gt;Player_ChangeStateToCustomControls&amp;lt;/code&amp;gt; as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
Player_ChangeStateToCustomControls(&amp;quot;LoaderArm_Look&amp;quot;, &amp;quot;LoaderArm_Move&amp;quot;, &amp;quot;LoaderArm_Action&amp;quot;, &amp;quot;LoaderArm_Lean&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter !! Value in this stock call&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asLookInputCallback&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;amp;quot;LoaderArm_Look&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asMoveInputCallback&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;amp;quot;LoaderArm_Move&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asActionInputCallback&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;amp;quot;LoaderArm_Action&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asLeanInputCallback&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;amp;quot;LoaderArm_Lean&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is an excerpt from that stock script; its referenced names and variables belong to that script.&lt;br /&gt;
&lt;br /&gt;
[[Category:English]]&lt;/div&gt;</summary>
		<author><name>TiMan</name></author>
		
	</entry>
</feed>