<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.soldat2.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AL</id>
	<title>Soldat2 Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.soldat2.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AL"/>
	<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Special:Contributions/AL"/>
	<updated>2026-05-05T15:48:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=120</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=120"/>
		<updated>2023-02-10T13:43:21Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Type type;&lt;br /&gt;
public string nick;&lt;br /&gt;
public ushort id;&lt;br /&gt;
public bool rcon;&lt;br /&gt;
public int ping;&lt;br /&gt;
public bool levelLoaded;&lt;br /&gt;
public bool waitingForSpawn;&lt;br /&gt;
public SyncedProperties props;&lt;br /&gt;
public object userData;&lt;br /&gt;
protected float timeOnJoin;&lt;br /&gt;
protected float timeOnPing;&lt;br /&gt;
public float timeOnDeath;&lt;br /&gt;
public float timeOnSpawn;&lt;br /&gt;
public Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt; votes = new Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;();&lt;br /&gt;
public bool muted;&lt;br /&gt;
public bool IsLocal();&lt;br /&gt;
public bool IsBot();&lt;br /&gt;
public bool IsRemote();&lt;br /&gt;
public float GetPlayTime();&lt;br /&gt;
public float GetTimeSinceLastPing();&lt;br /&gt;
public float GetTimeSinceDeath();&lt;br /&gt;
public float GetTimeSinceRespawn();&lt;br /&gt;
public bool IsDead();&lt;br /&gt;
public int GetTeam();&lt;br /&gt;
public bool IsSpectator();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.input.GetPointer(Pointer.AimWorld)&amp;lt;/code&amp;gt; returns a Vector3 of the position of the player's cursor (in world coordinates)&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_SetHealth(float hp, Player p = null, NetworkObject unknown = null)&amp;lt;/code&amp;gt; set player health, only works if executed on the server&lt;br /&gt;
Can potentially set up a listener for whenever a specific player's health changes: &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().HealthChanged.AddListener(cb)&amp;lt;/code&amp;gt;, where the callback function cb takes a single float as its argument (how much it changed by)&lt;br /&gt;
&lt;br /&gt;
=== Math ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Math&amp;lt;/code&amp;gt; class contains some potentially useful functions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static bool IsNearlyEqual(float value1, float value2, float epsilon = 0.0001f);&lt;br /&gt;
public static Vector2 CloserPosition(Vector2 point, Vector2 a, Vector2 b);&lt;br /&gt;
public static bool IsWithin(this int value, int minimum, int maximum);&lt;br /&gt;
public static bool IsWithin(this float value, float minimum, float maximum);&lt;br /&gt;
public static bool IsValid(this float value);&lt;br /&gt;
public static float Normalize(ref Vector2 v);&lt;br /&gt;
public static float Normalize(ref Vector3 v);&lt;br /&gt;
public static float Angle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p1, Vector2 p2);&lt;br /&gt;
public static Vector3 RotatePointAroundPivot(Vector3 point, Vector3 pivot, Vector3 angles);&lt;br /&gt;
public static Vector3 RotateVector(Vector3 vector, float angle);&lt;br /&gt;
public static void InitRandom(int seed);&lt;br /&gt;
public static int Random(int max);&lt;br /&gt;
public static float Random(float max);&lt;br /&gt;
public static int RandomRange(int min, int max);&lt;br /&gt;
public static float RandomRange(float min, float max);&lt;br /&gt;
public static Vector3 GetRandomVector(Vector3 v);&lt;br /&gt;
public static Vector2 GetRandomVector(Vector2 v);&lt;br /&gt;
public static bool CirclesCollide(Vector3 pos1, Vector3 pos2, float radius1, float radius2);&lt;br /&gt;
public static bool LineSegmentsIntersecting(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4);&lt;br /&gt;
public static Vector2 LineIntersectionPoint(Vector2 l1s, Vector2 l1e, Vector2 l2s, Vector2 l2e);&lt;br /&gt;
public static bool IsPointBetweenLine(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static bool AreLinesIntersecting(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2, bool shouldIncludeEndPoints);&lt;br /&gt;
public static bool AreLinesParallel(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static bool AreLinesSame(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static float ClampRotation(float rotation);&lt;br /&gt;
public static Quaternion MirrorRotation(Quaternion q);&lt;br /&gt;
public static bool IsStraight(Vector2 p1, Vector2 p2, Vector2 p3, float factor = 0.9f);&lt;br /&gt;
public static float GetStraightness(Vector2 p1, Vector2 p2, Vector2 p3);&lt;br /&gt;
public static bool IsTurningLeft(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static Vector2 NearestPointOnLineSegment(Vector2 origin, Vector2 end, Vector2 point);&lt;br /&gt;
public static bool IsCountourInteresecting(Vector3[] v);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;UnityEngine.Time.timeScale&amp;lt;/code&amp;gt; can be used to change the speed at which the game runs, 1=normal, 2=double speed, 0.5=half speed, etc&lt;br /&gt;
* &amp;lt;code&amp;gt;RespawningCommon.KillAllRespawnAll()&amp;lt;/code&amp;gt; kill all players&lt;br /&gt;
* &amp;lt;code&amp;gt;GetComponent&amp;lt;StandardRespawning&amp;gt;().allowRespawning&amp;lt;/code&amp;gt; set to false to control whether players can automatically respawn&lt;br /&gt;
* &amp;lt;code&amp;gt;GamesCycle.instance.game.rules&amp;lt;/code&amp;gt; the name of the current rules set being used (ie gamemode)&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=119</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=119"/>
		<updated>2023-02-10T13:30:37Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Type type;&lt;br /&gt;
public string nick;&lt;br /&gt;
public ushort id;&lt;br /&gt;
public bool rcon;&lt;br /&gt;
public int ping;&lt;br /&gt;
public bool levelLoaded;&lt;br /&gt;
public bool waitingForSpawn;&lt;br /&gt;
public SyncedProperties props;&lt;br /&gt;
public object userData;&lt;br /&gt;
protected float timeOnJoin;&lt;br /&gt;
protected float timeOnPing;&lt;br /&gt;
public float timeOnDeath;&lt;br /&gt;
public float timeOnSpawn;&lt;br /&gt;
public Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt; votes = new Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;();&lt;br /&gt;
public bool muted;&lt;br /&gt;
public bool IsLocal();&lt;br /&gt;
public bool IsBot();&lt;br /&gt;
public bool IsRemote();&lt;br /&gt;
public float GetPlayTime();&lt;br /&gt;
public float GetTimeSinceLastPing();&lt;br /&gt;
public float GetTimeSinceDeath();&lt;br /&gt;
public float GetTimeSinceRespawn();&lt;br /&gt;
public bool IsDead();&lt;br /&gt;
public int GetTeam();&lt;br /&gt;
public bool IsSpectator();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.input.GetPointer(Pointer.AimWorld)&amp;lt;/code&amp;gt; returns a Vector3 of the position of the player's cursor (in world coordinates)&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_SetHealth(float hp, Player p = null, NetworkObject unknown = null)&amp;lt;/code&amp;gt; set player health, only works if executed on the server&lt;br /&gt;
Can potentially set up a listener for whenever a specific player's health changes: &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().HealthChanged.AddListener(cb)&amp;lt;/code&amp;gt;, where the callback function cb takes a single float as its argument&lt;br /&gt;
&lt;br /&gt;
=== Math ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Math&amp;lt;/code&amp;gt; class contains some potentially useful functions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static bool IsNearlyEqual(float value1, float value2, float epsilon = 0.0001f);&lt;br /&gt;
public static Vector2 CloserPosition(Vector2 point, Vector2 a, Vector2 b);&lt;br /&gt;
public static bool IsWithin(this int value, int minimum, int maximum);&lt;br /&gt;
public static bool IsWithin(this float value, float minimum, float maximum);&lt;br /&gt;
public static bool IsValid(this float value);&lt;br /&gt;
public static float Normalize(ref Vector2 v);&lt;br /&gt;
public static float Normalize(ref Vector3 v);&lt;br /&gt;
public static float Angle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p1, Vector2 p2);&lt;br /&gt;
public static Vector3 RotatePointAroundPivot(Vector3 point, Vector3 pivot, Vector3 angles);&lt;br /&gt;
public static Vector3 RotateVector(Vector3 vector, float angle);&lt;br /&gt;
public static void InitRandom(int seed);&lt;br /&gt;
public static int Random(int max);&lt;br /&gt;
public static float Random(float max);&lt;br /&gt;
public static int RandomRange(int min, int max);&lt;br /&gt;
public static float RandomRange(float min, float max);&lt;br /&gt;
public static Vector3 GetRandomVector(Vector3 v);&lt;br /&gt;
public static Vector2 GetRandomVector(Vector2 v);&lt;br /&gt;
public static bool CirclesCollide(Vector3 pos1, Vector3 pos2, float radius1, float radius2);&lt;br /&gt;
public static bool LineSegmentsIntersecting(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4);&lt;br /&gt;
public static Vector2 LineIntersectionPoint(Vector2 l1s, Vector2 l1e, Vector2 l2s, Vector2 l2e);&lt;br /&gt;
public static bool IsPointBetweenLine(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static bool AreLinesIntersecting(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2, bool shouldIncludeEndPoints);&lt;br /&gt;
public static bool AreLinesParallel(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static bool AreLinesSame(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static float ClampRotation(float rotation);&lt;br /&gt;
public static Quaternion MirrorRotation(Quaternion q);&lt;br /&gt;
public static bool IsStraight(Vector2 p1, Vector2 p2, Vector2 p3, float factor = 0.9f);&lt;br /&gt;
public static float GetStraightness(Vector2 p1, Vector2 p2, Vector2 p3);&lt;br /&gt;
public static bool IsTurningLeft(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static Vector2 NearestPointOnLineSegment(Vector2 origin, Vector2 end, Vector2 point);&lt;br /&gt;
public static bool IsCountourInteresecting(Vector3[] v);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;UnityEngine.Time.timeScale&amp;lt;/code&amp;gt; can be used to change the speed at which the game runs, 1=normal, 2=double speed, 0.5=half speed, etc&lt;br /&gt;
* &amp;lt;code&amp;gt;RespawningCommon.KillAllRespawnAll()&amp;lt;/code&amp;gt; kill all players&lt;br /&gt;
* &amp;lt;code&amp;gt;GetComponent&amp;lt;StandardRespawning&amp;gt;().allowRespawning&amp;lt;/code&amp;gt; set to false to control whether players can automatically respawn&lt;br /&gt;
* &amp;lt;code&amp;gt;GamesCycle.instance.game.rules&amp;lt;/code&amp;gt; the name of the current rules set being used (ie gamemode)&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=118</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=118"/>
		<updated>2023-02-10T13:30:12Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Type type;&lt;br /&gt;
public string nick;&lt;br /&gt;
public ushort id;&lt;br /&gt;
public bool rcon;&lt;br /&gt;
public int ping;&lt;br /&gt;
public bool levelLoaded;&lt;br /&gt;
public bool waitingForSpawn;&lt;br /&gt;
public SyncedProperties props;&lt;br /&gt;
public object userData;&lt;br /&gt;
protected float timeOnJoin;&lt;br /&gt;
protected float timeOnPing;&lt;br /&gt;
public float timeOnDeath;&lt;br /&gt;
public float timeOnSpawn;&lt;br /&gt;
public Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt; votes = new Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;();&lt;br /&gt;
public bool muted;&lt;br /&gt;
public bool IsLocal();&lt;br /&gt;
public bool IsBot();&lt;br /&gt;
public bool IsRemote();&lt;br /&gt;
public float GetPlayTime();&lt;br /&gt;
public float GetTimeSinceLastPing();&lt;br /&gt;
public float GetTimeSinceDeath();&lt;br /&gt;
public float GetTimeSinceRespawn();&lt;br /&gt;
public bool IsDead();&lt;br /&gt;
public int GetTeam();&lt;br /&gt;
public bool IsSpectator();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.input.GetPointer(Pointer.AimWorld)&amp;lt;/code&amp;gt; returns a Vector3 of the position of the player's cursor (in world coordinates)&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_SetHealth(float hp, Player p = null, NetworkObject unknown = null)&amp;lt;/code&amp;gt; set player health, only works if executed on the server&lt;br /&gt;
Can potentially set up a listener for whenever a specific player's health changes: &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().HealthChanged.AddListener(cb)&amp;lt;/code&amp;gt;, where the callback function cb takes a single float as its argument&lt;br /&gt;
&lt;br /&gt;
=== Math ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Math&amp;lt;/code&amp;gt; class contains some potentially useful functions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static bool IsNearlyEqual(float value1, float value2, float epsilon = 0.0001f);&lt;br /&gt;
public static Vector2 CloserPosition(Vector2 point, Vector2 a, Vector2 b);&lt;br /&gt;
public static bool IsWithin(this int value, int minimum, int maximum);&lt;br /&gt;
public static bool IsWithin(this float value, float minimum, float maximum);&lt;br /&gt;
public static bool IsValid(this float value);&lt;br /&gt;
public static float Normalize(ref Vector2 v);&lt;br /&gt;
public static float Normalize(ref Vector3 v);&lt;br /&gt;
public static float Angle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p1, Vector2 p2);&lt;br /&gt;
public static Vector3 RotatePointAroundPivot(Vector3 point, Vector3 pivot, Vector3 angles);&lt;br /&gt;
public static Vector3 RotateVector(Vector3 vector, float angle);&lt;br /&gt;
public static void InitRandom(int seed);&lt;br /&gt;
public static int Random(int max);&lt;br /&gt;
public static float Random(float max);&lt;br /&gt;
public static int RandomRange(int min, int max);&lt;br /&gt;
public static float RandomRange(float min, float max);&lt;br /&gt;
public static Vector3 GetRandomVector(Vector3 v);&lt;br /&gt;
public static Vector2 GetRandomVector(Vector2 v);&lt;br /&gt;
public static bool CirclesCollide(Vector3 pos1, Vector3 pos2, float radius1, float radius2);&lt;br /&gt;
public static bool LineSegmentsIntersecting(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4);&lt;br /&gt;
public static Vector2 LineIntersectionPoint(Vector2 l1s, Vector2 l1e, Vector2 l2s, Vector2 l2e);&lt;br /&gt;
public static bool IsPointBetweenLine(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static bool AreLinesIntersecting(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2, bool shouldIncludeEndPoints);&lt;br /&gt;
public static bool AreLinesParallel(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static bool AreLinesSame(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static float ClampRotation(float rotation);&lt;br /&gt;
public static Quaternion MirrorRotation(Quaternion q);&lt;br /&gt;
public static bool IsStraight(Vector2 p1, Vector2 p2, Vector2 p3, float factor = 0.9f);&lt;br /&gt;
public static float GetStraightness(Vector2 p1, Vector2 p2, Vector2 p3);&lt;br /&gt;
public static bool IsTurningLeft(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static Vector2 NearestPointOnLineSegment(Vector2 origin, Vector2 end, Vector2 point);&lt;br /&gt;
public static bool IsCountourInteresecting(Vector3[] v);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;br /&gt;
* &amp;lt;code&amp;gt;UnityEngine.Time.timeScale&amp;lt;/code&amp;gt; can be used to change the speed at which the game runs, 1=normal, 2=double speed, 0.5=half speed, etc&lt;br /&gt;
* &amp;lt;code&amp;gt;RespawningCommon.KillAllRespawnAll()&amp;lt;/code&amp;gt; kill all players&lt;br /&gt;
* &amp;lt;code&amp;gt;GetComponent&amp;lt;StandardRespawning&amp;gt;().allowRespawning&amp;lt;/code&amp;gt; set to false to control whether players can automatically respawn&lt;br /&gt;
* &amp;lt;code&amp;gt;GamesCycle.instance.game.rules&amp;lt;/code&amp;gt; the name of the current rules set being used (ie gamemode)&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=106</id>
		<title>Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=106"/>
		<updated>2023-02-02T14:03:11Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The main method for reacting to gameplay events in Soldat 2 scripting is by registering ''listeners''. This is done by calling the &amp;lt;code&amp;gt;AddListener()&amp;lt;/code&amp;gt; function, usually on the &amp;lt;code&amp;gt;Eventor&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Eventor Events ==&lt;br /&gt;
In the case of Eventor listeners, you will need to specify both the event type to listen for, as well as a function to be called when the event occurs. Callback functions should have the signature &amp;lt;code&amp;gt;void cb_func(IGameEvent)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The event types that are used with Eventor are defined by the &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt; enum, which currently contains:&lt;br /&gt;
* None&lt;br /&gt;
* New_Connection&lt;br /&gt;
* Created&lt;br /&gt;
* Destroyed&lt;br /&gt;
* Died&lt;br /&gt;
* Add_Player&lt;br /&gt;
* Remove_Player&lt;br /&gt;
* Player_Joined&lt;br /&gt;
* Player_Assigned&lt;br /&gt;
* Player_Left&lt;br /&gt;
* Player_Changed_Team&lt;br /&gt;
* Player_Unassigned&lt;br /&gt;
* Level_Loaded&lt;br /&gt;
* Rules_Loaded&lt;br /&gt;
* Impacted&lt;br /&gt;
* Weapon_Selected&lt;br /&gt;
* Trigger&lt;br /&gt;
* Match_Waiting&lt;br /&gt;
* Match_Warmup&lt;br /&gt;
* Match_Started&lt;br /&gt;
* Match_Ended&lt;br /&gt;
* Hit&lt;br /&gt;
* Camera_Target_Changed&lt;br /&gt;
* Camera_Created&lt;br /&gt;
* Powerup_Started&lt;br /&gt;
* Powerup_Ended&lt;br /&gt;
* Bullet_Created&lt;br /&gt;
* Bot_Assigned&lt;br /&gt;
* Flag_Captured&lt;br /&gt;
* Flag_Returned&lt;br /&gt;
* Flag_Grabbed&lt;br /&gt;
* Use_Weapon&lt;br /&gt;
* Construct_AddBody&lt;br /&gt;
* Construct_RemoveBody&lt;br /&gt;
* Properties_Changed&lt;br /&gt;
* Item_Dropped&lt;br /&gt;
* Item_Picked&lt;br /&gt;
* AssignedNetworkId&lt;br /&gt;
* Changed_Team&lt;br /&gt;
* Request_Spawn&lt;br /&gt;
* End_Condition&lt;br /&gt;
* Reserved&lt;br /&gt;
&lt;br /&gt;
A full example of an AddListener call is &amp;lt;code&amp;gt;Eventor.AddListener(Events.Died, OnPlayerDied)&amp;lt;/code&amp;gt;. These calls are usually placed within the &amp;lt;code&amp;gt;Awake()&amp;lt;/code&amp;gt; function of the script, which is executed when the script is loaded. Note that each AddListener call should be paired with a RemoveListener call (usually in the &amp;lt;code&amp;gt;OnDestroy()&amp;lt;/code&amp;gt; function) to ensure that the script does not continue to respond to events after it has been disabled. See the Unity manual entry for the [https://docs.unity3d.com/2020.1/Documentation/ScriptReference/MonoBehaviour.html MonoBehaviour] class for other special functions.&lt;br /&gt;
&lt;br /&gt;
== Other Events ==&lt;br /&gt;
Not all necessary game events are currently accessible with just the Eventor object, methods for adding listeners to other useful events are listed below:&lt;br /&gt;
* Player chat events: &amp;lt;code&amp;gt;GameChat.instance.OnChat.AddListener()&amp;lt;/code&amp;gt;, only takes a callback function as an argument, required signature for callback is &amp;lt;code&amp;gt;void cb_func(Player, string)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an event is not available for a specific gameplay element you are interested in responding to, it is also possible to use a polling approach to detect that event by using either the &amp;lt;code&amp;gt;Update()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;FixedUpdate()&amp;lt;/code&amp;gt; functions which are called periodically by the engine. For example, something equivalent to this is used in the official &amp;lt;code&amp;gt;Climb.cs&amp;lt;/code&amp;gt; script to detect when any player gets within 1.5 range of a checkpoint:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C#&amp;quot;&amp;gt;&lt;br /&gt;
void FixedUpdate() // runs 10 times per second&lt;br /&gt;
{&lt;br /&gt;
    for (int i = checkpoints.Count - 1; i &amp;gt;= 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        foreach (Player player in Players.Get.GetAlive())&lt;br /&gt;
        {&lt;br /&gt;
            // for each (player,checkpoint) pair, check if the distance between them is less than 1.5&lt;br /&gt;
            if ((player.controlled.transform.position - checkpoints[i].transform.position).magnitude &amp;lt; 1.5f)&lt;br /&gt;
            {&lt;br /&gt;
                checkpoints.RemoveAt(i);&lt;br /&gt;
                lastCheckpointPlayer = player;&lt;br /&gt;
                break;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=105</id>
		<title>Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=105"/>
		<updated>2023-02-02T14:02:28Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The main method for reacting to gameplay events in Soldat 2 scripting is by registering ''listeners''. This is done by calling the &amp;lt;code&amp;gt;AddListener()&amp;lt;/code&amp;gt; function, usually on the &amp;lt;code&amp;gt;Eventor&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Eventor Events ==&lt;br /&gt;
In the case of Eventor listeners, you will need to specify both the event type to listen for, as well as a function to be called when the event occurs. Callback functions should have the signature &amp;lt;code&amp;gt;void cb_func(IGameEvent)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The event types that are used with Eventor are defined by the &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt; enum, which currently contains:&lt;br /&gt;
* None&lt;br /&gt;
* New_Connection&lt;br /&gt;
* Created&lt;br /&gt;
* Destroyed&lt;br /&gt;
* Died&lt;br /&gt;
* Add_Player&lt;br /&gt;
* Remove_Player&lt;br /&gt;
* Player_Joined&lt;br /&gt;
* Player_Assigned&lt;br /&gt;
* Player_Left&lt;br /&gt;
* Player_Changed_Team&lt;br /&gt;
* Player_Unassigned&lt;br /&gt;
* Level_Loaded&lt;br /&gt;
* Rules_Loaded&lt;br /&gt;
* Impacted&lt;br /&gt;
* Weapon_Selected&lt;br /&gt;
* Trigger&lt;br /&gt;
* Match_Waiting&lt;br /&gt;
* Match_Warmup&lt;br /&gt;
* Match_Started&lt;br /&gt;
* Match_Ended&lt;br /&gt;
* Hit&lt;br /&gt;
* Camera_Target_Changed&lt;br /&gt;
* Camera_Created&lt;br /&gt;
* Powerup_Started&lt;br /&gt;
* Powerup_Ended&lt;br /&gt;
* Bullet_Created&lt;br /&gt;
* Bot_Assigned&lt;br /&gt;
* Flag_Captured&lt;br /&gt;
* Flag_Returned&lt;br /&gt;
* Flag_Grabbed&lt;br /&gt;
* Use_Weapon&lt;br /&gt;
* Construct_AddBody&lt;br /&gt;
* Construct_RemoveBody&lt;br /&gt;
* Properties_Changed&lt;br /&gt;
* Item_Dropped&lt;br /&gt;
* Item_Picked&lt;br /&gt;
* AssignedNetworkId&lt;br /&gt;
* Changed_Team&lt;br /&gt;
* Request_Spawn&lt;br /&gt;
* End_Condition&lt;br /&gt;
* Reserved&lt;br /&gt;
&lt;br /&gt;
A full example of an AddListener call is &amp;lt;code&amp;gt;Eventor.AddListener(Events.Died, OnPlayerDied)&amp;lt;/code&amp;gt;. These calls are usually placed within the &amp;lt;code&amp;gt;Awake()&amp;lt;/code&amp;gt; function of the script, which is executed when the script is loaded. Note that each AddListener call should be paired with a RemoveListener call (usually in the &amp;lt;code&amp;gt;OnDestroy()&amp;lt;/code&amp;gt; function) to ensure that the script does not continue to respond to events after it has been disabled. See the Unity manual entry for the [https://docs.unity3d.com/2020.1/Documentation/ScriptReference/MonoBehaviour.html MonoBehaviour] class for other special functions.&lt;br /&gt;
&lt;br /&gt;
== Other Events ==&lt;br /&gt;
Not all necessary game events are currently accessible with just the Eventor object, methods for adding listeners to other useful events are listed below:&lt;br /&gt;
* Player chat events: &amp;lt;code&amp;gt;GameChat.instance.OnChat.AddListener()&amp;lt;/code&amp;gt;, only takes a callback function as an argument, required signature for callback is &amp;lt;code&amp;gt;void cb_func(Player, string)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an event is not available for a specific gameplay element you are interested in responding to, it is also possible to use a polling approach to detect that event by using either the &amp;lt;code&amp;gt;Update()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;FixedUpdate()&amp;lt;/code&amp;gt; functions which are called periodically by the engine. For example, something equivalent to this is used in the official &amp;lt;code&amp;gt;Climb.cs&amp;lt;/code&amp;gt; script to detect when any player gets within 1.5 range of a checkpoint:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C#&amp;quot;&amp;gt;&lt;br /&gt;
void FixedUpdate() // runs 10 times per second&lt;br /&gt;
{&lt;br /&gt;
    for (int i = checkpoints.Count - 1; i &amp;gt;= 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        foreach (Player player in Players.Get.GetAlive())&lt;br /&gt;
        {&lt;br /&gt;
            // for each (player,checkpoint) pair, check if the distance is less than 1.5&lt;br /&gt;
            if ((player.controlled.transform.position - checkpoints[i].transform.position).magnitude &amp;lt; 1.5f)&lt;br /&gt;
            {&lt;br /&gt;
                checkpoints.RemoveAt(i);&lt;br /&gt;
                lastCheckpointPlayer = player;&lt;br /&gt;
                break;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=102</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=102"/>
		<updated>2023-02-02T13:33:07Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under &amp;lt;code&amp;gt;Soldat2/Scripts/&amp;lt;/code&amp;gt; and there needs to be a ruleset that specifies that script in the &amp;lt;i&amp;gt;GameScript&amp;lt;/i&amp;gt; object in its json - for example, see &amp;lt;code&amp;gt;Soldat2/Rules/Standard/Climb.json&amp;lt;/code&amp;gt;. The script can be tested by starting a game that uses that ruleset.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scripting Resources ==&lt;br /&gt;
The Soldat 2 engine uses Unity, so it may be useful to familiarise yourself with the [https://docs.unity3d.com/2020.1/Documentation/Manual/index.html Unity Manual].&lt;br /&gt;
&lt;br /&gt;
There is some [https://soldat2.com/docs/ preliminary documentation] for the Soldat 2 engine, however it is currently rather limited.&lt;br /&gt;
&lt;br /&gt;
Some examples of scripts can be found in your Soldat 2 game directory under the path &amp;lt;code&amp;gt;Soldat2/Scripts/Standard/&amp;lt;/code&amp;gt;. Some unofficial examples are available at [[Scripting Examples]].&lt;br /&gt;
&lt;br /&gt;
See [[:Category:Scripting]] for a list of all pages on this wiki related to scripting.&lt;br /&gt;
&lt;br /&gt;
== Using Scripts ==&lt;br /&gt;
&lt;br /&gt;
A script can be applied to a match via [[Modifiers]] or via a [[Game Mode]] (&amp;quot;Rules&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== In a modifier ===&lt;br /&gt;
Example of a modifier &amp;lt;code&amp;gt;Modifiers/Custom/FlagIsPoison.json&amp;lt;/code&amp;gt; applying the &amp;lt;code&amp;gt;Scripts/Custom/FlagIsPoison.cs&amp;lt;/code&amp;gt; script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JSON&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Objects&amp;quot;: {&lt;br /&gt;
    &amp;quot;Rules&amp;quot;: {&lt;br /&gt;
      &amp;quot;FlagIsPoison&amp;quot;: {&lt;br /&gt;
        &amp;quot;FlagDamagePerSecond&amp;quot;: 3.0&lt;br /&gt;
      }&lt;br /&gt;
    }   &lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;Meta&amp;quot;: {&lt;br /&gt;
    &amp;quot;Description&amp;quot;: &amp;quot;(applies the FlagIsPoison script)&amp;quot;,&lt;br /&gt;
    &amp;quot;Author&amp;quot;: &amp;quot;noerw&amp;quot;,&lt;br /&gt;
    &amp;quot;Version&amp;quot;: 1.0&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A script can be parametrized, where the parameters are defined in the modifier or rule definition. In the above example the &amp;lt;code&amp;gt;FlagDamagePerSecond&amp;lt;/code&amp;gt; parameter is applied when the script class contains a &amp;lt;code&amp;gt;JsonProperty&amp;lt;/code&amp;gt; with a default value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C#&amp;quot;&amp;gt;&lt;br /&gt;
[JsonProperty(&amp;quot;FlagDamagePerSecond&amp;quot;)] public float flagDPS = 5.0;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== In a rule / game mode ===&lt;br /&gt;
&lt;br /&gt;
Add the script name to the &amp;lt;code&amp;gt;GameRules&amp;lt;/code&amp;gt; section of the rule definition in &amp;lt;code&amp;gt;Rules/Custom/YourGameMode.json&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JSON&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Objects&amp;quot;: {&lt;br /&gt;
    &amp;quot;YourGameMode&amp;quot;: {&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;GameScript&amp;quot;: {&lt;br /&gt;
        &amp;quot;Scripts&amp;quot;: [&lt;br /&gt;
          ... potentially other scripts ...,&lt;br /&gt;
          &amp;quot;YourScriptName&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* TODO: check if parameters can be passed in this syntax too (eg &amp;lt;code&amp;gt;&amp;quot;Scripts&amp;quot;: [{ &amp;quot;YourScriptName&amp;quot;: { MyParam: false } }]&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=101</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=101"/>
		<updated>2023-02-02T13:27:09Z</updated>

		<summary type="html">&lt;p&gt;AL: /* Using Scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under &amp;lt;code&amp;gt;Soldat2/Scripts/&amp;lt;/code&amp;gt; and there needs to be a ruleset that specifies that script in the &amp;lt;i&amp;gt;GameScript&amp;lt;/i&amp;gt; object in its json - for example, see &amp;lt;code&amp;gt;Soldat2/Rules/Standard/Climb.json&amp;lt;/code&amp;gt;. The script can be tested by starting a game that uses that ruleset.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scripting Resources ==&lt;br /&gt;
The Soldat 2 engine uses Unity, so it may be useful to familiarise yourself with the [https://docs.unity3d.com/2020.1/Documentation/Manual/index.html Unity Manual].&lt;br /&gt;
&lt;br /&gt;
There is some [https://soldat2.com/docs/ preliminary documentation] for the Soldat 2 engine, however it is currently rather limited.&lt;br /&gt;
&lt;br /&gt;
Some examples of scripts can be found in your Soldat 2 game directory under the path &amp;lt;code&amp;gt;Soldat2/Scripts/Standard/&amp;lt;/code&amp;gt;. Some unofficial examples are available at [[Scripting Examples]].&lt;br /&gt;
&lt;br /&gt;
More documentation is added to this wiki under [[:Category:Scripting]].&lt;br /&gt;
&lt;br /&gt;
== Using Scripts ==&lt;br /&gt;
&lt;br /&gt;
A script can be applied to a match via [[Modifiers]] or via a [[Game Mode]] (&amp;quot;Rules&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== In a modifier ===&lt;br /&gt;
Example of a modifier &amp;lt;code&amp;gt;Modifiers/Custom/FlagIsPoison.json&amp;lt;/code&amp;gt; applying the &amp;lt;code&amp;gt;Scripts/Custom/FlagIsPoison.cs&amp;lt;/code&amp;gt; script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JSON&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Objects&amp;quot;: {&lt;br /&gt;
    &amp;quot;Rules&amp;quot;: {&lt;br /&gt;
      &amp;quot;FlagIsPoison&amp;quot;: {&lt;br /&gt;
        &amp;quot;FlagDamagePerSecond&amp;quot;: 3.0&lt;br /&gt;
      }&lt;br /&gt;
    }   &lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;Meta&amp;quot;: {&lt;br /&gt;
    &amp;quot;Description&amp;quot;: &amp;quot;(applies the FlagIsPoison script)&amp;quot;,&lt;br /&gt;
    &amp;quot;Author&amp;quot;: &amp;quot;noerw&amp;quot;,&lt;br /&gt;
    &amp;quot;Version&amp;quot;: 1.0&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A script can be parametrized, where the parameters are defined in the modifier or rule definition. In the above example the &amp;lt;code&amp;gt;FlagDamagePerSecond&amp;lt;/code&amp;gt; parameter is applied when the script class contains a &amp;lt;code&amp;gt;JsonProperty&amp;lt;/code&amp;gt; with a default value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C#&amp;quot;&amp;gt;&lt;br /&gt;
[JsonProperty(&amp;quot;FlagDamagePerSecond&amp;quot;)] public float flagDPS = 5.0;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== In a rule / game mode ===&lt;br /&gt;
&lt;br /&gt;
Add the script name to the &amp;lt;code&amp;gt;GameRules&amp;lt;/code&amp;gt; section of the rule definition in &amp;lt;code&amp;gt;Rules/Custom/YourGameMode.json&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JSON&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Objects&amp;quot;: {&lt;br /&gt;
    &amp;quot;YourGameMode&amp;quot;: {&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;GameScript&amp;quot;: {&lt;br /&gt;
        &amp;quot;Scripts&amp;quot;: [&lt;br /&gt;
          ... potentially other scripts ...,&lt;br /&gt;
          &amp;quot;YourScriptName&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* TODO: check if parameters can be passed in this syntax too (eg &amp;lt;code&amp;gt;&amp;quot;Scripts&amp;quot;: [{ &amp;quot;YourScriptName&amp;quot;: { MyParam: false } }]&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=100</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=100"/>
		<updated>2023-02-02T13:26:49Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under &amp;lt;code&amp;gt;Soldat2/Scripts/&amp;lt;/code&amp;gt; and there needs to be a ruleset that specifies that script in the &amp;lt;i&amp;gt;GameScript&amp;lt;/i&amp;gt; object in its json - for example, see &amp;lt;code&amp;gt;Soldat2/Rules/Standard/Climb.json&amp;lt;/code&amp;gt;. The script can be tested by starting a game that uses that ruleset.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scripting Resources ==&lt;br /&gt;
The Soldat 2 engine uses Unity, so it may be useful to familiarise yourself with the [https://docs.unity3d.com/2020.1/Documentation/Manual/index.html Unity Manual].&lt;br /&gt;
&lt;br /&gt;
There is some [https://soldat2.com/docs/ preliminary documentation] for the Soldat 2 engine, however it is currently rather limited.&lt;br /&gt;
&lt;br /&gt;
Some examples of scripts can be found in your Soldat 2 game directory under the path &amp;lt;code&amp;gt;Soldat2/Scripts/Standard/&amp;lt;/code&amp;gt;. Some unofficial examples are available at [[Scripting Examples]].&lt;br /&gt;
&lt;br /&gt;
More documentation is added to this wiki under [[:Category:Scripting]].&lt;br /&gt;
&lt;br /&gt;
== Using Scripts ==&lt;br /&gt;
&lt;br /&gt;
A script can be applied to a match via [[Modifiers]] or via a [[Game Mode]] (&amp;quot;Rules&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== In a modifier ===&lt;br /&gt;
Example of a modifier &amp;lt;code&amp;gt;Modifiers/Custom/FlagIsPoison.json&amp;lt;/code&amp;gt; applying the &amp;lt;code&amp;gt;Scripts/Custom/FlagIsPoison.cs&amp;lt;/code&amp;gt; script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JSON&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Objects&amp;quot;: {&lt;br /&gt;
    &amp;quot;Rules&amp;quot;: {&lt;br /&gt;
      &amp;quot;FlagIsPoison&amp;quot;: {&lt;br /&gt;
        &amp;quot;FlagDamagePerSecond&amp;quot;: 3.0&lt;br /&gt;
      }&lt;br /&gt;
    }   &lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;Meta&amp;quot;: {&lt;br /&gt;
    &amp;quot;Description&amp;quot;: &amp;quot;(applies the FlagIsPoison script)&amp;quot;,&lt;br /&gt;
    &amp;quot;Author&amp;quot;: &amp;quot;noerw&amp;quot;,&lt;br /&gt;
    &amp;quot;Version&amp;quot;: 1.0&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A script can be parametrized, where the parameters are defined in the modifier or rule definition. In the above example the &amp;lt;code&amp;gt;FlagDamagePerSecond&amp;lt;/code&amp;gt; parameter is applied when the script class contains a &amp;lt;code&amp;gt;JsonProperty&amp;lt;/code&amp;gt; with a default value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C#&amp;quot;&amp;gt;&lt;br /&gt;
[JsonProperty(&amp;quot;FlagDamagePerSecond&amp;quot;)] public float flagDPS = 5.0;&lt;br /&gt;
&amp;lt;/syntaxhighliight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== In a rule / game mode ===&lt;br /&gt;
&lt;br /&gt;
Add the script name to the &amp;lt;code&amp;gt;GameRules&amp;lt;/code&amp;gt; section of the rule definition in &amp;lt;code&amp;gt;Rules/Custom/YourGameMode.json&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JSON&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Objects&amp;quot;: {&lt;br /&gt;
    &amp;quot;YourGameMode&amp;quot;: {&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;GameScript&amp;quot;: {&lt;br /&gt;
        &amp;quot;Scripts&amp;quot;: [&lt;br /&gt;
          ... potentially other scripts ...,&lt;br /&gt;
          &amp;quot;YourScriptName&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* TODO: check if parameters can be passed in this syntax too (eg &amp;lt;code&amp;gt;&amp;quot;Scripts&amp;quot;: [{ &amp;quot;YourScriptName&amp;quot;: { MyParam: false } }]&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=99</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=99"/>
		<updated>2023-02-02T13:23:00Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under &amp;lt;code&amp;gt;Soldat2/Scripts/&amp;lt;/code&amp;gt; and there needs to be a ruleset that specifies that script in the &amp;lt;i&amp;gt;GameScript&amp;lt;/i&amp;gt; object in its json - for example, see &amp;lt;code&amp;gt;Soldat2/Rules/Standard/Climb.json&amp;lt;/code&amp;gt;. The script can be tested by starting a game that uses that ruleset.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scripting Resources ==&lt;br /&gt;
The Soldat 2 engine uses Unity, so it may be useful to familiarise yourself with the [https://docs.unity3d.com/2020.1/Documentation/Manual/index.html Unity Manual].&lt;br /&gt;
&lt;br /&gt;
There is some [https://soldat2.com/docs/ preliminary documentation] for the Soldat 2 engine, however it is currently rather limited.&lt;br /&gt;
&lt;br /&gt;
Some examples of scripts can be found in your Soldat 2 game directory under the path &amp;lt;code&amp;gt;Soldat2/Scripts/Standard/&amp;lt;/code&amp;gt;. Some unofficial examples are available at [[Scripting Examples]].&lt;br /&gt;
&lt;br /&gt;
More documentation is added to this wiki under [[:Category:Scripting]].&lt;br /&gt;
&lt;br /&gt;
== Using Scripts ==&lt;br /&gt;
&lt;br /&gt;
A script can be applied to a match via [[Modifiers]] or via a [[Game Mode]] (&amp;quot;Rules&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== In a modifier ===&lt;br /&gt;
Example of a modifier &amp;lt;code&amp;gt;Modifiers/Custom/FlagIsPoison.json&amp;lt;/code&amp;gt; applying the &amp;lt;code&amp;gt;Scripts/Custom/FlagIsPoison.cs&amp;lt;/code&amp;gt; script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Objects&amp;quot;: {&lt;br /&gt;
    &amp;quot;Rules&amp;quot;: {&lt;br /&gt;
      &amp;quot;FlagIsPoison&amp;quot;: {&lt;br /&gt;
        &amp;quot;FlagDamagePerSecond&amp;quot;: 3.0&lt;br /&gt;
      }&lt;br /&gt;
    }   &lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;Meta&amp;quot;: {&lt;br /&gt;
    &amp;quot;Description&amp;quot;: &amp;quot;(applies the FlagIsPoison script)&amp;quot;,&lt;br /&gt;
    &amp;quot;Author&amp;quot;: &amp;quot;noerw&amp;quot;,&lt;br /&gt;
    &amp;quot;Version&amp;quot;: 1.0&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A script can be parametrized, where the parameters are defined in the modifier or rule definition. In the above example the &amp;lt;code&amp;gt;FlagDamagePerSecond&amp;lt;/code&amp;gt; parameter is applied when the script class contains a &amp;lt;code&amp;gt;JsonProperty&amp;lt;/code&amp;gt; with a default value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[JsonProperty(&amp;quot;FlagDamagePerSecond&amp;quot;)] public float flagDPS = 5.0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== In a rule / game mode ===&lt;br /&gt;
&lt;br /&gt;
Add the script name to the &amp;lt;code&amp;gt;GameRules&amp;lt;/code&amp;gt; section of the rule definition in &amp;lt;code&amp;gt;Rules/Custom/YourGameMode.json&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Objects&amp;quot;: {&lt;br /&gt;
    &amp;quot;YourGameMode&amp;quot;: {&lt;br /&gt;
&lt;br /&gt;
      &amp;quot;GameScript&amp;quot;: {&lt;br /&gt;
        &amp;quot;Scripts&amp;quot;: [&lt;br /&gt;
          ... potentially other scripts ...,&lt;br /&gt;
          &amp;quot;YourScriptName&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* TODO: check if parameters can be passed in this syntax too (eg &amp;lt;code&amp;gt;&amp;quot;Scripts&amp;quot;: [{ &amp;quot;YourScriptName&amp;quot;: { MyParam: false } }]&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Examples&amp;diff=98</id>
		<title>Scripting Examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Examples&amp;diff=98"/>
		<updated>2023-02-02T13:21:23Z</updated>

		<summary type="html">&lt;p&gt;AL: Created page with &amp;quot;This page contains a selection of unofficial scripts to demonstrate the usage of various aspects of Soldat 2's scripting API.  == Team Balancer == &amp;lt;syntaxhighlight lang=&amp;quot;C#&amp;quot;&amp;gt; // a basic team-balancing script to illustrate how to implement simple // chat-commands using S2 scripting  // 'using' directives let you omit namespacing // eg: Player rather than the full Teal.Player using System.Collections; using System.Collections.Generic; using UnityEngine; using Teal;  [Disal...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains a selection of unofficial scripts to demonstrate the usage of various aspects of Soldat 2's scripting API.&lt;br /&gt;
&lt;br /&gt;
== Team Balancer ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C#&amp;quot;&amp;gt;&lt;br /&gt;
// a basic team-balancing script to illustrate how to implement simple&lt;br /&gt;
// chat-commands using S2 scripting&lt;br /&gt;
&lt;br /&gt;
// 'using' directives let you omit namespacing&lt;br /&gt;
// eg: Player rather than the full Teal.Player&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using Teal;&lt;br /&gt;
&lt;br /&gt;
[DisallowMultipleComponent]&lt;br /&gt;
&lt;br /&gt;
// the class name as defined here is what you need to refer to in any json&lt;br /&gt;
// config files, NOT the name of this script file. Case sensitive.&lt;br /&gt;
public class Balance : MonoBehaviour&lt;br /&gt;
{&lt;br /&gt;
    // called when the script is loaded&lt;br /&gt;
    private void Awake()&lt;br /&gt;
    {&lt;br /&gt;
        // this registers a function (OnPlayerChat in this case) to be called&lt;br /&gt;
        // whenever a player chat event occurs&lt;br /&gt;
        // for other types of events, check in the modding channel on S2 discord&lt;br /&gt;
        GameChat.instance.OnChat.AddListener(OnPlayerChat);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // called before the script is unloaded, probably when the server closes/restarts&lt;br /&gt;
    private void OnDestroy()&lt;br /&gt;
    {&lt;br /&gt;
        // presumably important to prevent your script from continuing to respond&lt;br /&gt;
        // to events after it gets removed/disabled&lt;br /&gt;
        GameChat.instance.OnChat.RemoveListener(OnPlayerChat);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // user-defined function for handling chat events - the name can be any&lt;br /&gt;
    // (valid) identifier, only the signature is important&lt;br /&gt;
    void OnPlayerChat(Player p, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        // we are only implementing a single command in this example, but if&lt;br /&gt;
        // you want to have multiple commands a switch/case statement is probably&lt;br /&gt;
        // more appropriate&lt;br /&gt;
        if( msg == &amp;quot;!bal&amp;quot; || msg == &amp;quot;!balance&amp;quot; )&lt;br /&gt;
        {&lt;br /&gt;
            // first we grab a list of the players on each team&lt;br /&gt;
            List&amp;lt;Player&amp;gt; t0 = MonoSingleton&amp;lt;Players&amp;gt;.Get.GetPlayersOfTeam(0);&lt;br /&gt;
            List&amp;lt;Player&amp;gt; t1 = MonoSingleton&amp;lt;Players&amp;gt;.Get.GetPlayersOfTeam(1);&lt;br /&gt;
&lt;br /&gt;
            // integer division rounds down, so we will only do something if teams&lt;br /&gt;
            // are unbalanced by more than one player&lt;br /&gt;
            int hdiff = (t0.Count-t1.Count)/2;&lt;br /&gt;
            if( hdiff &amp;gt; 0 )&lt;br /&gt;
            { // more players on team 0, move half the difference to team 1&lt;br /&gt;
                for( int i=0; i&amp;lt;hdiff; i++ ) t0[i].props[&amp;quot;team&amp;quot;] = 1;&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
            else if( hdiff &amp;lt; 0 )&lt;br /&gt;
            { // more players on team 1, move half the difference to team 0&lt;br /&gt;
                for( int i=0; i&amp;lt;-hdiff; i++ ) t1[i].props[&amp;quot;team&amp;quot;] = 0;&lt;br /&gt;
                return;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Main_Page&amp;diff=97</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Main_Page&amp;diff=97"/>
		<updated>2023-02-02T13:08:39Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Welcome to the Soldat 2 Wiki&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contents ==&lt;br /&gt;
&lt;br /&gt;
* [[Weapons]]&lt;br /&gt;
* [[Ranked]]&lt;br /&gt;
* [[Movement|Movement Guide]]&lt;br /&gt;
* [[:Category:Modding]]&lt;br /&gt;
** [[Mapping|Mapping Guide]]&lt;br /&gt;
** [[Scripting Introduction]]&lt;br /&gt;
** [[Scripting Events]]&lt;br /&gt;
** [[Scripting Examples]]&lt;br /&gt;
* [[Server Hosting]]&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
* [https://store.steampowered.com/app/474220/Soldat_2/ Soldat 2 on STEAM]&lt;br /&gt;
* [https://oczki.pl/s2-players Active Player Dashboard]&lt;br /&gt;
* [https://stats.soldat2.com/ Ranked Ladder Statistics &amp;amp; Leaderboards]&lt;br /&gt;
* [https://tms2.jrgp.org/ The Soldat 2 Mapping Showcase]&lt;br /&gt;
* [https://kreis.uber.space/soldat2/mapview/ Map Search &amp;amp; Overview]&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=96</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=96"/>
		<updated>2023-01-24T12:24:21Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Type type;&lt;br /&gt;
public string nick;&lt;br /&gt;
public ushort id;&lt;br /&gt;
public bool rcon;&lt;br /&gt;
public int ping;&lt;br /&gt;
public bool levelLoaded;&lt;br /&gt;
public bool waitingForSpawn;&lt;br /&gt;
public SyncedProperties props;&lt;br /&gt;
public object userData;&lt;br /&gt;
protected float timeOnJoin;&lt;br /&gt;
protected float timeOnPing;&lt;br /&gt;
public float timeOnDeath;&lt;br /&gt;
public float timeOnSpawn;&lt;br /&gt;
public Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt; votes = new Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;();&lt;br /&gt;
public bool muted;&lt;br /&gt;
public bool IsLocal();&lt;br /&gt;
public bool IsBot();&lt;br /&gt;
public bool IsRemote();&lt;br /&gt;
public float GetPlayTime();&lt;br /&gt;
public float GetTimeSinceLastPing();&lt;br /&gt;
public float GetTimeSinceDeath();&lt;br /&gt;
public float GetTimeSinceRespawn();&lt;br /&gt;
public bool IsDead();&lt;br /&gt;
public int GetTeam();&lt;br /&gt;
public bool IsSpectator();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_SetHealth(float hp, Player p = null, NetworkObject unknown = null)&amp;lt;/code&amp;gt; set player health, only works if executed on the server&lt;br /&gt;
Can potentially set up a listener for whenever a specific player's health changes: &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().HealthChanged.AddListener(cb)&amp;lt;/code&amp;gt;, where the callback function cb takes a single float as its argument&lt;br /&gt;
&lt;br /&gt;
=== Math ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Math&amp;lt;/code&amp;gt; class contains some potentially useful functions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static bool IsNearlyEqual(float value1, float value2, float epsilon = 0.0001f);&lt;br /&gt;
public static Vector2 CloserPosition(Vector2 point, Vector2 a, Vector2 b);&lt;br /&gt;
public static bool IsWithin(this int value, int minimum, int maximum);&lt;br /&gt;
public static bool IsWithin(this float value, float minimum, float maximum);&lt;br /&gt;
public static bool IsValid(this float value);&lt;br /&gt;
public static float Normalize(ref Vector2 v);&lt;br /&gt;
public static float Normalize(ref Vector3 v);&lt;br /&gt;
public static float Angle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p1, Vector2 p2);&lt;br /&gt;
public static Vector3 RotatePointAroundPivot(Vector3 point, Vector3 pivot, Vector3 angles);&lt;br /&gt;
public static Vector3 RotateVector(Vector3 vector, float angle);&lt;br /&gt;
public static void InitRandom(int seed);&lt;br /&gt;
public static int Random(int max);&lt;br /&gt;
public static float Random(float max);&lt;br /&gt;
public static int RandomRange(int min, int max);&lt;br /&gt;
public static float RandomRange(float min, float max);&lt;br /&gt;
public static Vector3 GetRandomVector(Vector3 v);&lt;br /&gt;
public static Vector2 GetRandomVector(Vector2 v);&lt;br /&gt;
public static bool CirclesCollide(Vector3 pos1, Vector3 pos2, float radius1, float radius2);&lt;br /&gt;
public static bool LineSegmentsIntersecting(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4);&lt;br /&gt;
public static Vector2 LineIntersectionPoint(Vector2 l1s, Vector2 l1e, Vector2 l2s, Vector2 l2e);&lt;br /&gt;
public static bool IsPointBetweenLine(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static bool AreLinesIntersecting(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2, bool shouldIncludeEndPoints);&lt;br /&gt;
public static bool AreLinesParallel(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static bool AreLinesSame(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static float ClampRotation(float rotation);&lt;br /&gt;
public static Quaternion MirrorRotation(Quaternion q);&lt;br /&gt;
public static bool IsStraight(Vector2 p1, Vector2 p2, Vector2 p3, float factor = 0.9f);&lt;br /&gt;
public static float GetStraightness(Vector2 p1, Vector2 p2, Vector2 p3);&lt;br /&gt;
public static bool IsTurningLeft(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static Vector2 NearestPointOnLineSegment(Vector2 origin, Vector2 end, Vector2 point);&lt;br /&gt;
public static bool IsCountourInteresecting(Vector3[] v);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;br /&gt;
* &amp;lt;code&amp;gt;UnityEngine.Time.timeScale&amp;lt;/code&amp;gt; can be used to change the speed at which the game runs, 1=normal, 2=double speed, 0.5=half speed, etc&lt;br /&gt;
* &amp;lt;code&amp;gt;RespawningCommon.KillAllRespawnAll()&amp;lt;/code&amp;gt; kill all players&lt;br /&gt;
* &amp;lt;code&amp;gt;GetComponent&amp;lt;StandardRespawning&amp;gt;().allowRespawning&amp;lt;/code&amp;gt; set to false to control whether players can automatically respawn&lt;br /&gt;
* &amp;lt;code&amp;gt;GamesCycle.instance.game.rules&amp;lt;/code&amp;gt; the name of the current rules set being used (ie gamemode)&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=95</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=95"/>
		<updated>2023-01-22T08:49:27Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Type type;&lt;br /&gt;
public string nick;&lt;br /&gt;
public ushort id;&lt;br /&gt;
public bool rcon;&lt;br /&gt;
public int ping;&lt;br /&gt;
public bool levelLoaded;&lt;br /&gt;
public bool waitingForSpawn;&lt;br /&gt;
public SyncedProperties props;&lt;br /&gt;
public object userData;&lt;br /&gt;
protected float timeOnJoin;&lt;br /&gt;
protected float timeOnPing;&lt;br /&gt;
public float timeOnDeath;&lt;br /&gt;
public float timeOnSpawn;&lt;br /&gt;
public Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt; votes = new Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;();&lt;br /&gt;
public bool muted;&lt;br /&gt;
public bool IsLocal();&lt;br /&gt;
public bool IsBot();&lt;br /&gt;
public bool IsRemote();&lt;br /&gt;
public float GetPlayTime();&lt;br /&gt;
public float GetTimeSinceLastPing();&lt;br /&gt;
public float GetTimeSinceDeath();&lt;br /&gt;
public float GetTimeSinceRespawn();&lt;br /&gt;
public bool IsDead();&lt;br /&gt;
public int GetTeam();&lt;br /&gt;
public bool IsSpectator();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_SetHealth(float hp, Player p = null, NetworkObject unknown = null)&amp;lt;/code&amp;gt; set player health, only works if executed on the server&lt;br /&gt;
Can potentially set up a listener for whenever a specific player's health changes: &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().HealthChanged.AddListener(cb)&amp;lt;/code&amp;gt;, where the callback function cb takes a single float as its argument&lt;br /&gt;
&lt;br /&gt;
=== Math ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Math&amp;lt;/code&amp;gt; class contains some potentially useful functions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static bool IsNearlyEqual(float value1, float value2, float epsilon = 0.0001f);&lt;br /&gt;
public static Vector2 CloserPosition(Vector2 point, Vector2 a, Vector2 b);&lt;br /&gt;
public static bool IsWithin(this int value, int minimum, int maximum);&lt;br /&gt;
public static bool IsWithin(this float value, float minimum, float maximum);&lt;br /&gt;
public static bool IsValid(this float value);&lt;br /&gt;
public static float Normalize(ref Vector2 v);&lt;br /&gt;
public static float Normalize(ref Vector3 v);&lt;br /&gt;
public static float Angle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p1, Vector2 p2);&lt;br /&gt;
public static Vector3 RotatePointAroundPivot(Vector3 point, Vector3 pivot, Vector3 angles);&lt;br /&gt;
public static Vector3 RotateVector(Vector3 vector, float angle);&lt;br /&gt;
public static void InitRandom(int seed);&lt;br /&gt;
public static int Random(int max);&lt;br /&gt;
public static float Random(float max);&lt;br /&gt;
public static int RandomRange(int min, int max);&lt;br /&gt;
public static float RandomRange(float min, float max);&lt;br /&gt;
public static Vector3 GetRandomVector(Vector3 v);&lt;br /&gt;
public static Vector2 GetRandomVector(Vector2 v);&lt;br /&gt;
public static bool CirclesCollide(Vector3 pos1, Vector3 pos2, float radius1, float radius2);&lt;br /&gt;
public static bool LineSegmentsIntersecting(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4);&lt;br /&gt;
public static Vector2 LineIntersectionPoint(Vector2 l1s, Vector2 l1e, Vector2 l2s, Vector2 l2e);&lt;br /&gt;
public static bool IsPointBetweenLine(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static bool AreLinesIntersecting(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2, bool shouldIncludeEndPoints);&lt;br /&gt;
public static bool AreLinesParallel(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static bool AreLinesSame(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static float ClampRotation(float rotation);&lt;br /&gt;
public static Quaternion MirrorRotation(Quaternion q);&lt;br /&gt;
public static bool IsStraight(Vector2 p1, Vector2 p2, Vector2 p3, float factor = 0.9f);&lt;br /&gt;
public static float GetStraightness(Vector2 p1, Vector2 p2, Vector2 p3);&lt;br /&gt;
public static bool IsTurningLeft(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static Vector2 NearestPointOnLineSegment(Vector2 origin, Vector2 end, Vector2 point);&lt;br /&gt;
public static bool IsCountourInteresecting(Vector3[] v);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;br /&gt;
* &amp;lt;code&amp;gt;UnityEngine.Time.timeScale&amp;lt;/code&amp;gt; can be used to change the speed at which the game runs, 1=normal, 2=double speed, 0.5=half speed, etc&lt;br /&gt;
* &amp;lt;code&amp;gt;RespawningCommon.KillAllRespawnAll()&amp;lt;/code&amp;gt; kill all players&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=83</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=83"/>
		<updated>2023-01-18T09:40:17Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Type type;&lt;br /&gt;
public string nick;&lt;br /&gt;
public ushort id;&lt;br /&gt;
public bool rcon;&lt;br /&gt;
public int ping;&lt;br /&gt;
public bool levelLoaded;&lt;br /&gt;
public bool waitingForSpawn;&lt;br /&gt;
public SyncedProperties props;&lt;br /&gt;
public object userData;&lt;br /&gt;
protected float timeOnJoin;&lt;br /&gt;
protected float timeOnPing;&lt;br /&gt;
public float timeOnDeath;&lt;br /&gt;
public float timeOnSpawn;&lt;br /&gt;
public Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt; votes = new Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;();&lt;br /&gt;
public bool muted;&lt;br /&gt;
public bool IsLocal();&lt;br /&gt;
public bool IsBot();&lt;br /&gt;
public bool IsRemote();&lt;br /&gt;
public float GetPlayTime();&lt;br /&gt;
public float GetTimeSinceLastPing();&lt;br /&gt;
public float GetTimeSinceDeath();&lt;br /&gt;
public float GetTimeSinceRespawn();&lt;br /&gt;
public bool IsDead();&lt;br /&gt;
public int GetTeam();&lt;br /&gt;
public bool IsSpectator();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_SetHealth(float hp, Player p = null, NetworkObject unknown = null)&amp;lt;/code&amp;gt; set player health, only works if executed on the server&lt;br /&gt;
Can potentially set up a listener for whenever a specific player's health changes: &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().HealthChanged.AddListener(cb)&amp;lt;/code&amp;gt;, where the callback function cb takes a single float as its argument&lt;br /&gt;
&lt;br /&gt;
=== Math ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Math&amp;lt;/code&amp;gt; class contains some potentially useful functions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static bool IsNearlyEqual(float value1, float value2, float epsilon = 0.0001f);&lt;br /&gt;
public static Vector2 CloserPosition(Vector2 point, Vector2 a, Vector2 b);&lt;br /&gt;
public static bool IsWithin(this int value, int minimum, int maximum);&lt;br /&gt;
public static bool IsWithin(this float value, float minimum, float maximum);&lt;br /&gt;
public static bool IsValid(this float value);&lt;br /&gt;
public static float Normalize(ref Vector2 v);&lt;br /&gt;
public static float Normalize(ref Vector3 v);&lt;br /&gt;
public static float Angle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p1, Vector2 p2);&lt;br /&gt;
public static Vector3 RotatePointAroundPivot(Vector3 point, Vector3 pivot, Vector3 angles);&lt;br /&gt;
public static Vector3 RotateVector(Vector3 vector, float angle);&lt;br /&gt;
public static void InitRandom(int seed);&lt;br /&gt;
public static int Random(int max);&lt;br /&gt;
public static float Random(float max);&lt;br /&gt;
public static int RandomRange(int min, int max);&lt;br /&gt;
public static float RandomRange(float min, float max);&lt;br /&gt;
public static Vector3 GetRandomVector(Vector3 v);&lt;br /&gt;
public static Vector2 GetRandomVector(Vector2 v);&lt;br /&gt;
public static bool CirclesCollide(Vector3 pos1, Vector3 pos2, float radius1, float radius2);&lt;br /&gt;
public static bool LineSegmentsIntersecting(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4);&lt;br /&gt;
public static Vector2 LineIntersectionPoint(Vector2 l1s, Vector2 l1e, Vector2 l2s, Vector2 l2e);&lt;br /&gt;
public static bool IsPointBetweenLine(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static bool AreLinesIntersecting(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2, bool shouldIncludeEndPoints);&lt;br /&gt;
public static bool AreLinesParallel(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static bool AreLinesSame(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static float ClampRotation(float rotation);&lt;br /&gt;
public static Quaternion MirrorRotation(Quaternion q);&lt;br /&gt;
public static bool IsStraight(Vector2 p1, Vector2 p2, Vector2 p3, float factor = 0.9f);&lt;br /&gt;
public static float GetStraightness(Vector2 p1, Vector2 p2, Vector2 p3);&lt;br /&gt;
public static bool IsTurningLeft(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static Vector2 NearestPointOnLineSegment(Vector2 origin, Vector2 end, Vector2 point);&lt;br /&gt;
public static bool IsCountourInteresecting(Vector3[] v);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;br /&gt;
* &amp;lt;code&amp;gt;UnityEngine.Time.timeScale&amp;lt;/code&amp;gt; can be used to change the speed at which the game runs, 1=normal, 2=double speed, 0.5=half speed, etc&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=82</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=82"/>
		<updated>2023-01-17T15:34:00Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Type type;&lt;br /&gt;
public string nick;&lt;br /&gt;
public ushort id;&lt;br /&gt;
public bool rcon;&lt;br /&gt;
public int ping;&lt;br /&gt;
public bool levelLoaded;&lt;br /&gt;
public bool waitingForSpawn;&lt;br /&gt;
public SyncedProperties props;&lt;br /&gt;
public object userData;&lt;br /&gt;
protected float timeOnJoin;&lt;br /&gt;
protected float timeOnPing;&lt;br /&gt;
public float timeOnDeath;&lt;br /&gt;
public float timeOnSpawn;&lt;br /&gt;
public Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt; votes = new Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;();&lt;br /&gt;
public bool muted;&lt;br /&gt;
public bool IsLocal();&lt;br /&gt;
public bool IsBot();&lt;br /&gt;
public bool IsRemote();&lt;br /&gt;
public float GetPlayTime();&lt;br /&gt;
public float GetTimeSinceLastPing();&lt;br /&gt;
public float GetTimeSinceDeath();&lt;br /&gt;
public float GetTimeSinceRespawn();&lt;br /&gt;
public bool IsDead();&lt;br /&gt;
public int GetTeam();&lt;br /&gt;
public bool IsSpectator();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_SetHealth(float hp, Player p = null, NetworkObject unknown = null)&amp;lt;/code&amp;gt; set player health, only works if executed on the server&lt;br /&gt;
Can potentially set up a listener for whenever a specific player's health changes: &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().HealthChanged.AddListener(cb)&amp;lt;/code&amp;gt;, where the callback function cb takes a single float as its argument&lt;br /&gt;
&lt;br /&gt;
=== Math ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Math&amp;lt;/code&amp;gt; class contains some potentially useful functions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static bool IsNearlyEqual(float value1, float value2, float epsilon = 0.0001f);&lt;br /&gt;
public static Vector2 CloserPosition(Vector2 point, Vector2 a, Vector2 b);&lt;br /&gt;
public static bool IsWithin(this int value, int minimum, int maximum);&lt;br /&gt;
public static bool IsWithin(this float value, float minimum, float maximum);&lt;br /&gt;
public static bool IsValid(this float value);&lt;br /&gt;
public static float Normalize(ref Vector2 v);&lt;br /&gt;
public static float Normalize(ref Vector3 v);&lt;br /&gt;
public static float Angle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p_vector2);&lt;br /&gt;
public static float SignedAngle(Vector2 p1, Vector2 p2);&lt;br /&gt;
public static Vector3 RotatePointAroundPivot(Vector3 point, Vector3 pivot, Vector3 angles);&lt;br /&gt;
public static Vector3 RotateVector(Vector3 vector, float angle);&lt;br /&gt;
public static void InitRandom(int seed);&lt;br /&gt;
public static int Random(int max);&lt;br /&gt;
public static float Random(float max);&lt;br /&gt;
public static int RandomRange(int min, int max);&lt;br /&gt;
public static float RandomRange(float min, float max);&lt;br /&gt;
public static Vector3 GetRandomVector(Vector3 v);&lt;br /&gt;
public static Vector2 GetRandomVector(Vector2 v);&lt;br /&gt;
public static bool CirclesCollide(Vector3 pos1, Vector3 pos2, float radius1, float radius2);&lt;br /&gt;
public static bool LineSegmentsIntersecting(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4);&lt;br /&gt;
public static Vector2 LineIntersectionPoint(Vector2 l1s, Vector2 l1e, Vector2 l2s, Vector2 l2e);&lt;br /&gt;
public static bool IsPointBetweenLine(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static bool AreLinesIntersecting(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2, bool shouldIncludeEndPoints);&lt;br /&gt;
public static bool AreLinesParallel(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static bool AreLinesSame(Vector2 l1_p1, Vector2 l1_p2, Vector2 l2_p1, Vector2 l2_p2);&lt;br /&gt;
public static float ClampRotation(float rotation);&lt;br /&gt;
public static Quaternion MirrorRotation(Quaternion q);&lt;br /&gt;
public static bool IsStraight(Vector2 p1, Vector2 p2, Vector2 p3, float factor = 0.9f);&lt;br /&gt;
public static float GetStraightness(Vector2 p1, Vector2 p2, Vector2 p3);&lt;br /&gt;
public static bool IsTurningLeft(Vector2 a, Vector2 b, Vector2 c);&lt;br /&gt;
public static Vector2 NearestPointOnLineSegment(Vector2 origin, Vector2 end, Vector2 point);&lt;br /&gt;
public static bool IsCountourInteresecting(Vector3[] v);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=81</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=81"/>
		<updated>2023-01-17T15:29:09Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Type type;&lt;br /&gt;
public string nick;&lt;br /&gt;
public ushort id;&lt;br /&gt;
public bool rcon;&lt;br /&gt;
public int ping;&lt;br /&gt;
public bool levelLoaded;&lt;br /&gt;
public bool waitingForSpawn;&lt;br /&gt;
public SyncedProperties props;&lt;br /&gt;
public object userData;&lt;br /&gt;
protected float timeOnJoin;&lt;br /&gt;
protected float timeOnPing;&lt;br /&gt;
public float timeOnDeath;&lt;br /&gt;
public float timeOnSpawn;&lt;br /&gt;
public Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt; votes = new Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;();&lt;br /&gt;
public bool muted;&lt;br /&gt;
public bool IsLocal();&lt;br /&gt;
public bool IsBot();&lt;br /&gt;
public bool IsRemote();&lt;br /&gt;
public float GetPlayTime();&lt;br /&gt;
public float GetTimeSinceLastPing();&lt;br /&gt;
public float GetTimeSinceDeath();&lt;br /&gt;
public float GetTimeSinceRespawn();&lt;br /&gt;
public bool IsDead();&lt;br /&gt;
public int GetTeam();&lt;br /&gt;
public bool IsSpectator();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_SetHealth(float hp, Player p = null, NetworkObject unknown = null)&amp;lt;/code&amp;gt; set player health, only works if executed on the server&lt;br /&gt;
Can potentially set up a listener for whenever a specific player's health changes: &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().HealthChanged.AddListener(cb)&amp;lt;/code&amp;gt;, where the callback function cb takes a single float as its argument&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=80</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=80"/>
		<updated>2023-01-17T15:05:49Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Type type;&lt;br /&gt;
public string nick;&lt;br /&gt;
public ushort id;&lt;br /&gt;
public bool rcon;&lt;br /&gt;
public int ping;&lt;br /&gt;
public bool levelLoaded;&lt;br /&gt;
public bool waitingForSpawn;&lt;br /&gt;
public SyncedProperties props;&lt;br /&gt;
public object userData;&lt;br /&gt;
protected float timeOnJoin;&lt;br /&gt;
protected float timeOnPing;&lt;br /&gt;
public float timeOnDeath;&lt;br /&gt;
public float timeOnSpawn;&lt;br /&gt;
public Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt; votes = new Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;();&lt;br /&gt;
public bool muted;&lt;br /&gt;
public bool IsLocal();&lt;br /&gt;
public bool IsBot();&lt;br /&gt;
public bool IsRemote();&lt;br /&gt;
public float GetPlayTime();&lt;br /&gt;
public float GetTimeSinceLastPing();&lt;br /&gt;
public float GetTimeSinceDeath();&lt;br /&gt;
public float GetTimeSinceRespawn();&lt;br /&gt;
public bool IsDead();&lt;br /&gt;
public int GetTeam();&lt;br /&gt;
public bool IsSpectator();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_SetHealth(float hp, Player p = null, NetworkObject unknown = null)&amp;lt;/code&amp;gt; set player health, only works if executed on the server&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=79</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=79"/>
		<updated>2023-01-17T14:47:31Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Type type;&lt;br /&gt;
public string nick;&lt;br /&gt;
public ushort id;&lt;br /&gt;
public bool rcon;&lt;br /&gt;
public int ping;&lt;br /&gt;
public bool levelLoaded;&lt;br /&gt;
public bool waitingForSpawn;&lt;br /&gt;
public SyncedProperties props;&lt;br /&gt;
public object userData;&lt;br /&gt;
protected float timeOnJoin;&lt;br /&gt;
protected float timeOnPing;&lt;br /&gt;
public float timeOnDeath;&lt;br /&gt;
public float timeOnSpawn;&lt;br /&gt;
public Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt; votes = new Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;();&lt;br /&gt;
public bool muted;&lt;br /&gt;
public bool IsLocal();&lt;br /&gt;
public bool IsBot();&lt;br /&gt;
public bool IsRemote();&lt;br /&gt;
public float GetPlayTime();&lt;br /&gt;
public float GetTimeSinceLastPing();&lt;br /&gt;
public float GetTimeSinceDeath();&lt;br /&gt;
public float GetTimeSinceRespawn();&lt;br /&gt;
public bool IsDead();&lt;br /&gt;
public int GetTeam();&lt;br /&gt;
public bool IsSpectator();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=78</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=78"/>
		<updated>2023-01-17T14:42:04Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=77</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=77"/>
		<updated>2023-01-17T14:38:32Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting. Note that this list is by no means exhaustive.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=76</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=76"/>
		<updated>2023-01-17T14:37:02Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;player.props.Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=75</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=75"/>
		<updated>2023-01-17T14:32:24Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;StandardObject&amp;gt;().Master_Death()&amp;lt;/code&amp;gt; kill the player&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=74</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=74"/>
		<updated>2023-01-17T14:30:51Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Players ====&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The &amp;lt;code&amp;gt;Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=73</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=73"/>
		<updated>2023-01-17T14:29:21Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;Debug.Log()&amp;lt;/code&amp;gt; print to debug console, accepts any number of printable arguments&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Players ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
* The &amp;lt;code&amp;gt;props&amp;lt;/code&amp;gt; member is a dictionary that is both readable and writable. Some potentially useful keys are:&lt;br /&gt;
** Id&lt;br /&gt;
** type&lt;br /&gt;
** team&lt;br /&gt;
** score&lt;br /&gt;
** kills&lt;br /&gt;
** deaths&lt;br /&gt;
** weapon&lt;br /&gt;
** weapon2&lt;br /&gt;
It is also possible to add new properties if you want to associate some custom data to players using &amp;lt;code&amp;gt;Create(string key, object value)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events. It also allows access to some other classes that affect different aspects of the player.&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.GetComponent&amp;lt;GostekJets&amp;gt;().jetsAllowed&amp;lt;/code&amp;gt; boolean value, read/writable&lt;br /&gt;
* &amp;lt;code&amp;gt;controls.transform.position&amp;lt;/code&amp;gt; returns a Vector3 of the current position of the player&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GameCursor.GetWorldPosition()&amp;lt;/code&amp;gt; gets the current position of the local player's cursor, unknown how it will work on a server&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=72</id>
		<title>User:AL</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=User:AL&amp;diff=72"/>
		<updated>2023-01-17T14:15:20Z</updated>

		<summary type="html">&lt;p&gt;AL: Created page with &amp;quot;== Scripting Notes == The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting.  === Messaging === * &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message * &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returne...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Scripting Notes ==&lt;br /&gt;
The exact limits of what scripting in Soldat 2 can do is not yet known, but it already looks to far exceed what was possible in Soldat 1. The following is a somewhat random assortment of different ways to affect or read the game state from scripting.&lt;br /&gt;
&lt;br /&gt;
=== Messaging ===&lt;br /&gt;
* &amp;lt;code&amp;gt;GameChat.ChatOrLog(string message)&amp;lt;/code&amp;gt; print a chat message&lt;br /&gt;
* &amp;lt;code&amp;gt;HUD.Get.Notify(string message, UnityEngine.Color c)&amp;lt;/code&amp;gt; text printout similar to flag grabbed/returned text&lt;br /&gt;
&lt;br /&gt;
=== Players ===&lt;br /&gt;
The &amp;lt;code&amp;gt;Teal.Player&amp;lt;/code&amp;gt; object is what we manipulate to read or change data related to players.&lt;br /&gt;
&lt;br /&gt;
The singleton class &amp;lt;code&amp;gt;Teal.Players&amp;lt;/code&amp;gt; provides many different ways to retrieve relevant player objects:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public List&amp;lt;Player&amp;gt; players;&lt;br /&gt;
public int PlayersCount;&lt;br /&gt;
public Player GetLocalPlayer();&lt;br /&gt;
public ushort GetLocalPlayerId();&lt;br /&gt;
public Controls GetLocalPlayerControlled();&lt;br /&gt;
public Player GetPlayerByID(ushort ID);&lt;br /&gt;
public Player GetPlayerByNick(string nick);&lt;br /&gt;
public Player GetPlayerByPropertyId(ushort id);&lt;br /&gt;
public Controls GetPlayerControlledByID(ushort ID);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersOfTeamExcept(int team, Player player);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAlive();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveBots();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumans();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansNonSpectator();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetHumansOnClient();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetAliveTeam(int team);&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetSpecators();&lt;br /&gt;
public List&amp;lt;Player&amp;gt; GetPlayersNonSpecators();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Controls&amp;lt;/code&amp;gt; class allows querying some properties like whether the player is dead, is human/bot, and some (limited?) input events&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
* The &amp;lt;code&amp;gt;Teal.RealTime&amp;lt;/code&amp;gt; class offers a number of different time measures:&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float realtimeSinceStartup;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static float timeSinceLevelLoad;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;public static double SecsSinceStart;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=71</id>
		<title>Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=71"/>
		<updated>2023-01-16T15:51:29Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The main method for reacting to gameplay events in Soldat 2 scripting is by registering ''listeners''. This is done by calling the &amp;lt;code&amp;gt;AddListener()&amp;lt;/code&amp;gt; function, usually on the &amp;lt;code&amp;gt;Eventor&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
== Eventor Events ==&lt;br /&gt;
In the case of Eventor listeners, you will need to specify both the event type to listen for, as well as a function to be called when the event occurs. Callback functions should have the signature &amp;lt;code&amp;gt;void cb_func(IGameEvent)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The event types that are used with Eventor are defined by the &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt; enum, which currently contains:&lt;br /&gt;
* None&lt;br /&gt;
* New_Connection&lt;br /&gt;
* Created&lt;br /&gt;
* Destroyed&lt;br /&gt;
* Died&lt;br /&gt;
* Add_Player&lt;br /&gt;
* Remove_Player&lt;br /&gt;
* Player_Joined&lt;br /&gt;
* Player_Assigned&lt;br /&gt;
* Player_Left&lt;br /&gt;
* Player_Changed_Team&lt;br /&gt;
* Player_Unassigned&lt;br /&gt;
* Level_Loaded&lt;br /&gt;
* Rules_Loaded&lt;br /&gt;
* Impacted&lt;br /&gt;
* Weapon_Selected&lt;br /&gt;
* Trigger&lt;br /&gt;
* Match_Waiting&lt;br /&gt;
* Match_Warmup&lt;br /&gt;
* Match_Started&lt;br /&gt;
* Match_Ended&lt;br /&gt;
* Hit&lt;br /&gt;
* Camera_Target_Changed&lt;br /&gt;
* Camera_Created&lt;br /&gt;
* Powerup_Started&lt;br /&gt;
* Powerup_Ended&lt;br /&gt;
* Bullet_Created&lt;br /&gt;
* Bot_Assigned&lt;br /&gt;
* Flag_Captured&lt;br /&gt;
* Flag_Returned&lt;br /&gt;
* Flag_Grabbed&lt;br /&gt;
* Use_Weapon&lt;br /&gt;
* Construct_AddBody&lt;br /&gt;
* Construct_RemoveBody&lt;br /&gt;
* Properties_Changed&lt;br /&gt;
* Item_Dropped&lt;br /&gt;
* Item_Picked&lt;br /&gt;
* AssignedNetworkId&lt;br /&gt;
* Changed_Team&lt;br /&gt;
* Request_Spawn&lt;br /&gt;
* End_Condition&lt;br /&gt;
* Reserved&lt;br /&gt;
&lt;br /&gt;
A full example of an AddListener call is &amp;lt;code&amp;gt;Eventor.AddListener(Events.Died, OnPlayerDied)&amp;lt;/code&amp;gt;. These calls are usually placed within the &amp;lt;code&amp;gt;Awake()&amp;lt;/code&amp;gt; function of the script, which is executed when the script is loaded. Note that each AddListener call should be paired with a RemoveListener call (usually in the &amp;lt;code&amp;gt;OnDestroy()&amp;lt;/code&amp;gt; function) to ensure that the script does not continue to respond to events after it has been disabled. See the Unity manual entry for the [https://docs.unity3d.com/2020.1/Documentation/ScriptReference/MonoBehaviour.html MonoBehaviour] class for other special functions.&lt;br /&gt;
&lt;br /&gt;
== Other Events ==&lt;br /&gt;
Not all necessary game events are currently accessible with just the Eventor object, methods for adding listeners to other useful events are listed below:&lt;br /&gt;
* Player chat events: &amp;lt;code&amp;gt;GameChat.instance.OnChat.AddListener()&amp;lt;/code&amp;gt;, only takes a callback function as an argument, required signature for callback is &amp;lt;code&amp;gt;void cb_func(Player, string)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an event is not available for a specific gameplay element you are interested in responding to, it is also possible to use a polling approach to detect that event by using either the &amp;lt;code&amp;gt;Update()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;FixedUpdate()&amp;lt;/code&amp;gt; functions which are called periodically by the engine.&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=70</id>
		<title>Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=70"/>
		<updated>2023-01-16T15:50:41Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The main method for reacting to gameplay events in Soldat 2 scripting is by registering ''listeners''. This is done by calling the &amp;lt;code&amp;gt;AddListener()&amp;lt;/code&amp;gt; function, usually on the &amp;lt;code&amp;gt;Eventor&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
== Eventor Events ==&lt;br /&gt;
In the case of Eventor listeners, you will need to specify both the event type to listen for, as well as a function to be called when the event occurs. Callback functions should have the signature &amp;lt;code&amp;gt;void cb_func(IGameEvent)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The event types that are used with Eventor are defined by the &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt; enum, which currently contains:&lt;br /&gt;
* None&lt;br /&gt;
* New_Connection&lt;br /&gt;
* Created&lt;br /&gt;
* Destroyed&lt;br /&gt;
* Died&lt;br /&gt;
* Add_Player&lt;br /&gt;
* Remove_Player&lt;br /&gt;
* Player_Joined&lt;br /&gt;
* Player_Assigned&lt;br /&gt;
* Player_Left&lt;br /&gt;
* Player_Changed_Team&lt;br /&gt;
* Player_Unassigned&lt;br /&gt;
* Level_Loaded&lt;br /&gt;
* Rules_Loaded&lt;br /&gt;
* Impacted&lt;br /&gt;
* Weapon_Selected&lt;br /&gt;
* Trigger&lt;br /&gt;
* Match_Waiting&lt;br /&gt;
* Match_Warmup&lt;br /&gt;
* Match_Started&lt;br /&gt;
* Match_Ended&lt;br /&gt;
* Hit&lt;br /&gt;
* Camera_Target_Changed&lt;br /&gt;
* Camera_Created&lt;br /&gt;
* Powerup_Started&lt;br /&gt;
* Powerup_Ended&lt;br /&gt;
* Bullet_Created&lt;br /&gt;
* Bot_Assigned&lt;br /&gt;
* Flag_Captured&lt;br /&gt;
* Flag_Returned&lt;br /&gt;
* Flag_Grabbed&lt;br /&gt;
* Use_Weapon&lt;br /&gt;
* Construct_AddBody&lt;br /&gt;
* Construct_RemoveBody&lt;br /&gt;
* Properties_Changed&lt;br /&gt;
* Item_Dropped&lt;br /&gt;
* Item_Picked&lt;br /&gt;
* AssignedNetworkId&lt;br /&gt;
* Changed_Team&lt;br /&gt;
* Request_Spawn&lt;br /&gt;
* End_Condition&lt;br /&gt;
* Reserved&lt;br /&gt;
&lt;br /&gt;
A full example of an AddListener call is &amp;lt;code&amp;gt;Eventor.AddListener(Events.Died, OnPlayerDied)&amp;lt;/code&amp;gt;. These calls are usually placed within the &amp;lt;code&amp;gt;Awake()&amp;lt;/code&amp;gt; function of the script, which is executed when the script is loaded. Note that each AddListener call should be paired with a RemoveListener call (usually in the &amp;lt;code&amp;gt;OnDestroy()&amp;lt;/code&amp;gt; function) to ensure that the script does not continue to respond to events after it has been disabled. See the Unity manual entry for the [https://docs.unity3d.com/2020.1/Documentation/ScriptReference/MonoBehaviour.html MonoBehaviour] class for other special functions.&lt;br /&gt;
&lt;br /&gt;
== Other Events ==&lt;br /&gt;
Not all necessary game events are currently accessible with just the Eventor object, methods for adding listeners to other useful events are listed below:&lt;br /&gt;
* Player chat events: &amp;lt;code&amp;gt;GameChat.instance.OnChat.AddListener()&amp;lt;/code&amp;gt;, only takes a callback function as an argument, required signature for callback is &amp;lt;code&amp;gt;void cb_func(Player, string)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an event is not available for a specific gameplay element you are interested in responding to, it is also possible to use a polling approach to detect that event by using either the &amp;lt;code&amp;gt;Update()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;FixedUpdate()&amp;lt;/code&amp;gt; functions which are called periodically.&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=69</id>
		<title>Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=69"/>
		<updated>2023-01-16T15:50:23Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The main method for reacting to gameplay events in Soldat 2 scripting is by registering ''listeners''. This is done by calling the &amp;lt;code&amp;gt;AddListener()&amp;lt;/code&amp;gt; function, usually on the &amp;lt;code&amp;gt;Eventor&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
== Eventor Events ==&lt;br /&gt;
In the case of Eventor listeners, you will need to specify both the event type to listen for, as well as a function to be called when the event occurs. Callback functions should have the signature &amp;lt;code&amp;gt;void cb_func(IGameEvent)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The event types that are used with Eventor are defined by the &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt; enum, which currently contains:&lt;br /&gt;
* None&lt;br /&gt;
* New_Connection&lt;br /&gt;
* Created&lt;br /&gt;
* Destroyed&lt;br /&gt;
* Died&lt;br /&gt;
* Add_Player&lt;br /&gt;
* Remove_Player&lt;br /&gt;
* Player_Joined&lt;br /&gt;
* Player_Assigned&lt;br /&gt;
* Player_Left&lt;br /&gt;
* Player_Changed_Team&lt;br /&gt;
* Player_Unassigned&lt;br /&gt;
* Level_Loaded&lt;br /&gt;
* Rules_Loaded&lt;br /&gt;
* Impacted&lt;br /&gt;
* Weapon_Selected&lt;br /&gt;
* Trigger&lt;br /&gt;
* Match_Waiting&lt;br /&gt;
* Match_Warmup&lt;br /&gt;
* Match_Started&lt;br /&gt;
* Match_Ended&lt;br /&gt;
* Hit&lt;br /&gt;
* Camera_Target_Changed&lt;br /&gt;
* Camera_Created&lt;br /&gt;
* Powerup_Started&lt;br /&gt;
* Powerup_Ended&lt;br /&gt;
* Bullet_Created&lt;br /&gt;
* Bot_Assigned&lt;br /&gt;
* Flag_Captured&lt;br /&gt;
* Flag_Returned&lt;br /&gt;
* Flag_Grabbed&lt;br /&gt;
* Use_Weapon&lt;br /&gt;
* Construct_AddBody&lt;br /&gt;
* Construct_RemoveBody&lt;br /&gt;
* Properties_Changed&lt;br /&gt;
* Item_Dropped&lt;br /&gt;
* Item_Picked&lt;br /&gt;
* AssignedNetworkId&lt;br /&gt;
* Changed_Team&lt;br /&gt;
* Request_Spawn&lt;br /&gt;
* End_Condition&lt;br /&gt;
* Reserved&lt;br /&gt;
&lt;br /&gt;
A full example of an AddListener call is &amp;lt;code&amp;gt;Eventor.AddListener(Events.Died, OnPlayerDied)&amp;lt;/code&amp;gt;. These calls are usually placed within the &amp;lt;code&amp;gt;Awake()&amp;lt;/code&amp;gt; function of the script, which is executed when the script is loaded. Note that each AddListener call should be paired with a RemoveListener call (usually in the &amp;lt;code&amp;gt;OnDestroy()&amp;lt;/code&amp;gt; function) to ensure that the script does not continue to respond to events after it has been disabled. See the Unity manual entry for the [https://docs.unity3d.com/2020.1/Documentation/ScriptReference/MonoBehaviour.html MonoBehaviour] class for other special functions.&lt;br /&gt;
&lt;br /&gt;
== Other Events ==&lt;br /&gt;
Not all necessary game events are currently accessible with just the Eventor object, methods for adding listeners to other useful events are listed below:&lt;br /&gt;
* Player chat events: &amp;lt;code&amp;gt;GameChat.instance.OnChat.AddListener()&amp;lt;/code&amp;gt;, only takes a callback function as an argument, required signature for callback is &amp;lt;code&amp;gt;void cb_func(Player, string)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an event is not available for a specific gameplay element you are interested in responding to, it is also possible to use a polling approach to detect that event by using either the &amp;lt;code&amp;gt;Update&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;FixedUpdate&amp;lt;/code&amp;gt; functions which are called periodically.&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Main_Page&amp;diff=68</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Main_Page&amp;diff=68"/>
		<updated>2023-01-16T15:44:29Z</updated>

		<summary type="html">&lt;p&gt;AL: Add link to scripting events&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Welcome to the Soldat 2 Wiki&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contents ==&lt;br /&gt;
* [[Weapons]]&lt;br /&gt;
* [[Ranked]]&lt;br /&gt;
* [[Movement|Movement Guide]]&lt;br /&gt;
* [[Mapping|Mapping Guide]]&lt;br /&gt;
* [[Scripting Introduction]]&lt;br /&gt;
* [[Scripting Events]]&lt;br /&gt;
* [[Server Hosting]]&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
* [https://store.steampowered.com/app/474220/Soldat_2/ Soldat 2 on STEAM]&lt;br /&gt;
* [https://oczki.pl/s2-players Active Player Dashboard]&lt;br /&gt;
* [https://stats.soldat2.com/ Ranked Ladder Statistics &amp;amp; Leaderboards]&lt;br /&gt;
* [https://tms2.jrgp.org/ The Soldat 2 Mapping Showcase]&lt;br /&gt;
* [https://kreis.uber.space/soldat2/mapview/ Map Search &amp;amp; Overview]&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=67</id>
		<title>Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=67"/>
		<updated>2023-01-16T15:42:25Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The main method for reacting to gameplay events in Soldat 2 scripting is by registering ''listeners''. This is done by calling the &amp;lt;code&amp;gt;AddListener()&amp;lt;/code&amp;gt; function, usually on the &amp;lt;code&amp;gt;Eventor&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
== Eventor Events ==&lt;br /&gt;
In the case of Eventor listeners, you will need to specify both the event type to listen for, as well as a function to be called when the event occurs. Callback functions should have the signature &amp;lt;code&amp;gt;void cb_func(IGameEvent)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The event types that are used with Eventor are defined by the &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt; enum, which currently contains:&lt;br /&gt;
* None&lt;br /&gt;
* New_Connection&lt;br /&gt;
* Created&lt;br /&gt;
* Destroyed&lt;br /&gt;
* Died&lt;br /&gt;
* Add_Player&lt;br /&gt;
* Remove_Player&lt;br /&gt;
* Player_Joined&lt;br /&gt;
* Player_Assigned&lt;br /&gt;
* Player_Left&lt;br /&gt;
* Player_Changed_Team&lt;br /&gt;
* Player_Unassigned&lt;br /&gt;
* Level_Loaded&lt;br /&gt;
* Rules_Loaded&lt;br /&gt;
* Impacted&lt;br /&gt;
* Weapon_Selected&lt;br /&gt;
* Trigger&lt;br /&gt;
* Match_Waiting&lt;br /&gt;
* Match_Warmup&lt;br /&gt;
* Match_Started&lt;br /&gt;
* Match_Ended&lt;br /&gt;
* Hit&lt;br /&gt;
* Camera_Target_Changed&lt;br /&gt;
* Camera_Created&lt;br /&gt;
* Powerup_Started&lt;br /&gt;
* Powerup_Ended&lt;br /&gt;
* Bullet_Created&lt;br /&gt;
* Bot_Assigned&lt;br /&gt;
* Flag_Captured&lt;br /&gt;
* Flag_Returned&lt;br /&gt;
* Flag_Grabbed&lt;br /&gt;
* Use_Weapon&lt;br /&gt;
* Construct_AddBody&lt;br /&gt;
* Construct_RemoveBody&lt;br /&gt;
* Properties_Changed&lt;br /&gt;
* Item_Dropped&lt;br /&gt;
* Item_Picked&lt;br /&gt;
* AssignedNetworkId&lt;br /&gt;
* Changed_Team&lt;br /&gt;
* Request_Spawn&lt;br /&gt;
* End_Condition&lt;br /&gt;
* Reserved&lt;br /&gt;
&lt;br /&gt;
A full example of an AddListener call is &amp;lt;code&amp;gt;Eventor.AddListener(Events.Died, OnPlayerDied)&amp;lt;/code&amp;gt;. These calls are usually placed within the &amp;lt;code&amp;gt;Awake()&amp;lt;/code&amp;gt; function of the script, which is executed when the script is loaded. Note that each AddListener call should be paired with a RemoveListener call (usually in the &amp;lt;code&amp;gt;OnDestroy()&amp;lt;/code&amp;gt; function) to ensure that the script does not continue to respond to events after it has been disabled. See the Unity manual entry for the [https://docs.unity3d.com/2020.1/Documentation/ScriptReference/MonoBehaviour.html MonoBehaviour] class for other special functions.&lt;br /&gt;
&lt;br /&gt;
== Other Events ==&lt;br /&gt;
Not all necessary game events are currently accessible with just the Eventor object, methods for adding listeners to other useful events are listed below:&lt;br /&gt;
* Player chat events: &amp;lt;code&amp;gt;GameChat.instance.OnChat.AddListener()&amp;lt;/code&amp;gt;, only takes a callback function as an argument, required signature for callback is &amp;lt;code&amp;gt;void cb_func(Player, string)&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=66</id>
		<title>Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=66"/>
		<updated>2023-01-16T15:41:14Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The main method for reacting to gameplay events in Soldat 2 scripting is by registering ''listeners''. This is done by calling the &amp;lt;code&amp;gt;AddListener()&amp;lt;/code&amp;gt; function, usually on the &amp;lt;code&amp;gt;Eventor&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
== Eventor Events ==&lt;br /&gt;
In the case of Eventor listeners, you will need to specify both the event type to listen for, as well as a function to be called when the event occurs. Callback functions should have the signature &amp;lt;code&amp;gt;void cb_func(IGameEvent)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The event types that are used with Eventor are defined by the &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt; enum, which currently contains:&lt;br /&gt;
* None&lt;br /&gt;
* New_Connection&lt;br /&gt;
* Created&lt;br /&gt;
* Destroyed&lt;br /&gt;
* Died&lt;br /&gt;
* Add_Player&lt;br /&gt;
* Remove_Player&lt;br /&gt;
* Player_Joined&lt;br /&gt;
* Player_Assigned&lt;br /&gt;
* Player_Left&lt;br /&gt;
* Player_Changed_Team&lt;br /&gt;
* Player_Unassigned&lt;br /&gt;
* Level_Loaded&lt;br /&gt;
* Rules_Loaded&lt;br /&gt;
* Impacted&lt;br /&gt;
* Weapon_Selected&lt;br /&gt;
* Trigger&lt;br /&gt;
* Match_Waiting&lt;br /&gt;
* Match_Warmup&lt;br /&gt;
* Match_Started&lt;br /&gt;
* Match_Ended&lt;br /&gt;
* Hit&lt;br /&gt;
* Camera_Target_Changed&lt;br /&gt;
* Camera_Created&lt;br /&gt;
* Powerup_Started&lt;br /&gt;
* Powerup_Ended&lt;br /&gt;
* Bullet_Created&lt;br /&gt;
* Bot_Assigned&lt;br /&gt;
* Flag_Captured&lt;br /&gt;
* Flag_Returned&lt;br /&gt;
* Flag_Grabbed&lt;br /&gt;
* Use_Weapon&lt;br /&gt;
* Construct_AddBody&lt;br /&gt;
* Construct_RemoveBody&lt;br /&gt;
* Properties_Changed&lt;br /&gt;
* Item_Dropped&lt;br /&gt;
* Item_Picked&lt;br /&gt;
* AssignedNetworkId&lt;br /&gt;
* Changed_Team&lt;br /&gt;
* Request_Spawn&lt;br /&gt;
* End_Condition&lt;br /&gt;
* Reserved&lt;br /&gt;
&lt;br /&gt;
A full example of an AddListener call is &amp;lt;code&amp;gt;Eventor.AddListener(Events.Died, OnPlayerDied);&amp;lt;/code&amp;gt;. These calls are usually placed within the &amp;lt;code&amp;gt;Awake()&amp;lt;/code&amp;gt; function of the script, which is executed when the script is loaded. Note that each AddListener call should be paired with a RemoveListener call (usually in the &amp;lt;code&amp;gt;OnDestroy()&amp;lt;/code&amp;gt; function) to ensure that the script does not continue to respond to events after it has been disabled. See the Unity manual entry for the [https://docs.unity3d.com/2020.1/Documentation/ScriptReference/MonoBehaviour.html MonoBehaviour] class for other special functions.&lt;br /&gt;
&lt;br /&gt;
== Other Events ==&lt;br /&gt;
Not all necessary game events are currently accessible with just the Eventor object, methods for adding listeners to other useful events are listed below:&lt;br /&gt;
* Player chat events: &amp;lt;code&amp;gt;GameChat.instance.OnChat.AddListener()&amp;lt;/code&amp;gt;, only takes a callback function as an argument, required signature for callback is &amp;lt;code&amp;gt;void cb_func(Player, string)&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=65</id>
		<title>Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=65"/>
		<updated>2023-01-16T15:39:58Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The main method for reacting to gameplay events in Soldat 2 scripting is by registering ''listeners''. This is done by calling the &amp;lt;code&amp;gt;AddListener()&amp;lt;/code&amp;gt; function, usually on the &amp;lt;code&amp;gt;Eventor&amp;lt;/code&amp;gt; object. In the case of Eventor listeners, you will need to specify both the event type to listen for, as well as a function to be called when the event occurs. Callback functions should have the signature &amp;lt;code&amp;gt;void cb_func(IGameEvent)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The event types that are used with Eventor are defined by the &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt; enum, which currently contains:&lt;br /&gt;
* None&lt;br /&gt;
* New_Connection&lt;br /&gt;
* Created&lt;br /&gt;
* Destroyed&lt;br /&gt;
* Died&lt;br /&gt;
* Add_Player&lt;br /&gt;
* Remove_Player&lt;br /&gt;
* Player_Joined&lt;br /&gt;
* Player_Assigned&lt;br /&gt;
* Player_Left&lt;br /&gt;
* Player_Changed_Team&lt;br /&gt;
* Player_Unassigned&lt;br /&gt;
* Level_Loaded&lt;br /&gt;
* Rules_Loaded&lt;br /&gt;
* Impacted&lt;br /&gt;
* Weapon_Selected&lt;br /&gt;
* Trigger&lt;br /&gt;
* Match_Waiting&lt;br /&gt;
* Match_Warmup&lt;br /&gt;
* Match_Started&lt;br /&gt;
* Match_Ended&lt;br /&gt;
* Hit&lt;br /&gt;
* Camera_Target_Changed&lt;br /&gt;
* Camera_Created&lt;br /&gt;
* Powerup_Started&lt;br /&gt;
* Powerup_Ended&lt;br /&gt;
* Bullet_Created&lt;br /&gt;
* Bot_Assigned&lt;br /&gt;
* Flag_Captured&lt;br /&gt;
* Flag_Returned&lt;br /&gt;
* Flag_Grabbed&lt;br /&gt;
* Use_Weapon&lt;br /&gt;
* Construct_AddBody&lt;br /&gt;
* Construct_RemoveBody&lt;br /&gt;
* Properties_Changed&lt;br /&gt;
* Item_Dropped&lt;br /&gt;
* Item_Picked&lt;br /&gt;
* AssignedNetworkId&lt;br /&gt;
* Changed_Team&lt;br /&gt;
* Request_Spawn&lt;br /&gt;
* End_Condition&lt;br /&gt;
* Reserved&lt;br /&gt;
&lt;br /&gt;
A full example of an AddListener call is &amp;lt;code&amp;gt;Eventor.AddListener(Events.Died, OnPlayerDied);&amp;lt;/code&amp;gt;. These calls are usually placed within the &amp;lt;code&amp;gt;Awake()&amp;lt;/code&amp;gt; function of the script, which is executed when the script is loaded. Note that each AddListener call should be paired with a RemoveListener call (usually in the &amp;lt;code&amp;gt;OnDestroy()&amp;lt;/code&amp;gt; function) to ensure that the script does not continue to respond to events after it has been disabled. See the Unity manual entry for the [https://docs.unity3d.com/2020.1/Documentation/ScriptReference/MonoBehaviour.html MonoBehaviour] class for other special functions.&lt;br /&gt;
&lt;br /&gt;
Not all necessary game events are currently accessible with just the Eventor object, methods for adding listeners to other useful events are listed below:&lt;br /&gt;
* Player chat events: &amp;lt;code&amp;gt;GameChat.instance.OnChat.AddListener()&amp;lt;/code&amp;gt;, only takes a callback function as an argument, required signature for callback is &amp;lt;code&amp;gt;void cb_func(Player, string)&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=64</id>
		<title>Scripting Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Events&amp;diff=64"/>
		<updated>2023-01-16T15:04:57Z</updated>

		<summary type="html">&lt;p&gt;AL: Created page with &amp;quot;The main method for reacting to gameplay events in Soldat 2 scripting is by registering ''listeners''. This is done by calling the &amp;lt;code&amp;gt;AddListener()&amp;lt;/code&amp;gt; function, usually on the &amp;lt;code&amp;gt;Eventor&amp;lt;/code&amp;gt; object. In the case of Eventor listeners, you will need to specify both the event type to listen for, as well as a function to be called when the event occurs. Callback functions should have the signature &amp;lt;code&amp;gt;void cb_func(IGameEvent)&amp;lt;/code&amp;gt;.  The event types that are u...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The main method for reacting to gameplay events in Soldat 2 scripting is by registering ''listeners''. This is done by calling the &amp;lt;code&amp;gt;AddListener()&amp;lt;/code&amp;gt; function, usually on the &amp;lt;code&amp;gt;Eventor&amp;lt;/code&amp;gt; object. In the case of Eventor listeners, you will need to specify both the event type to listen for, as well as a function to be called when the event occurs. Callback functions should have the signature &amp;lt;code&amp;gt;void cb_func(IGameEvent)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The event types that are used with Eventor are defined by the &amp;lt;code&amp;gt;Events&amp;lt;/code&amp;gt; enum, which currently contains:&lt;br /&gt;
* None&lt;br /&gt;
* New_Connection&lt;br /&gt;
* Created&lt;br /&gt;
* Destroyed&lt;br /&gt;
* Died&lt;br /&gt;
* Add_Player&lt;br /&gt;
* Remove_Player&lt;br /&gt;
* Player_Joined&lt;br /&gt;
* Player_Assigned&lt;br /&gt;
* Player_Left&lt;br /&gt;
* Player_Changed_Team&lt;br /&gt;
* Player_Unassigned&lt;br /&gt;
* Level_Loaded&lt;br /&gt;
* Rules_Loaded&lt;br /&gt;
* Impacted&lt;br /&gt;
* Weapon_Selected&lt;br /&gt;
* Trigger&lt;br /&gt;
* Match_Waiting&lt;br /&gt;
* Match_Warmup&lt;br /&gt;
* Match_Started&lt;br /&gt;
* Match_Ended&lt;br /&gt;
* Hit&lt;br /&gt;
* Camera_Target_Changed&lt;br /&gt;
* Camera_Created&lt;br /&gt;
* Powerup_Started&lt;br /&gt;
* Powerup_Ended&lt;br /&gt;
* Bullet_Created&lt;br /&gt;
* Bot_Assigned&lt;br /&gt;
* Flag_Captured&lt;br /&gt;
* Flag_Returned&lt;br /&gt;
* Flag_Grabbed&lt;br /&gt;
* Use_Weapon&lt;br /&gt;
* Construct_AddBody&lt;br /&gt;
* Construct_RemoveBody&lt;br /&gt;
* Properties_Changed&lt;br /&gt;
* Item_Dropped&lt;br /&gt;
* Item_Picked&lt;br /&gt;
* AssignedNetworkId&lt;br /&gt;
* Changed_Team&lt;br /&gt;
* Request_Spawn&lt;br /&gt;
* End_Condition&lt;br /&gt;
* Reserved&lt;br /&gt;
&lt;br /&gt;
A full example of an AddListener call is &amp;lt;code&amp;gt;Eventor.AddListener(Events.Died, OnPlayerDied);&amp;lt;/code&amp;gt;. These calls are usually placed within the &amp;lt;code&amp;gt;Awake()&amp;lt;/code&amp;gt; function of the script, which is executed when the script is loaded. Note that each AddListener call should be paired with a RemoveListener call (usually in the &amp;lt;code&amp;gt;OnDestroy()&amp;lt;/code&amp;gt; function) to ensure that the script does not continue to respond to events after it has been disabled. See the Unity manual entry for the [https://docs.unity3d.com/2020.1/Documentation/ScriptReference/MonoBehaviour.html MonoBehaviour] class for other special functions.&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Category:Scripting&amp;diff=63</id>
		<title>Category:Scripting</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Category:Scripting&amp;diff=63"/>
		<updated>2023-01-16T12:51:00Z</updated>

		<summary type="html">&lt;p&gt;AL: Created page with &amp;quot;Pages related to scripting in Soldat 2&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pages related to scripting in Soldat 2&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Main_Page&amp;diff=62</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Main_Page&amp;diff=62"/>
		<updated>2023-01-16T12:40:49Z</updated>

		<summary type="html">&lt;p&gt;AL: Add link to scripting introduction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Welcome to the Soldat 2 Wiki&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contents ==&lt;br /&gt;
* [[Weapons]]&lt;br /&gt;
* [[Ranked]]&lt;br /&gt;
* [[Movement|Movement Guide]]&lt;br /&gt;
* [[Mapping|Mapping Guide]]&lt;br /&gt;
* [[Scripting Introduction]]&lt;br /&gt;
* [[Server Hosting]]&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
* [https://store.steampowered.com/app/474220/Soldat_2/ Soldat 2 on STEAM]&lt;br /&gt;
* [https://oczki.pl/s2-players Active Player Dashboard]&lt;br /&gt;
* [https://stats.soldat2.com/ Ranked Ladder Statistics &amp;amp; Leaderboards]&lt;br /&gt;
* [https://tms2.jrgp.org/ The Soldat 2 Mapping Showcase]&lt;br /&gt;
* [https://kreis.uber.space/soldat2/mapview/ Map Search &amp;amp; Overview]&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=61</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=61"/>
		<updated>2023-01-16T12:35:46Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under &amp;lt;code&amp;gt;Soldat2/Scripts/&amp;lt;/code&amp;gt; and there needs to be a ruleset that specifies that script in the &amp;lt;i&amp;gt;GameScript&amp;lt;/i&amp;gt; object in its json - for example, see &amp;lt;code&amp;gt;Soldat2/Rules/Standard/Climb.json&amp;lt;/code&amp;gt;. The script can be tested by starting a game that uses that ruleset.&lt;br /&gt;
&lt;br /&gt;
== Scripting Resources ==&lt;br /&gt;
The Soldat 2 engine uses Unity, so it may be useful to familiarise yourself with the [https://docs.unity3d.com/2020.1/Documentation/Manual/index.html Unity Manual].&lt;br /&gt;
&lt;br /&gt;
There is some [https://soldat2.com/docs/ preliminary documentation] for the Soldat 2 engine, however it is currently rather limited.&lt;br /&gt;
&lt;br /&gt;
Some examples of scripts can be found in your Soldat 2 game directory under the path &amp;lt;code&amp;gt;Soldat2/Scripts/Standard/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=60</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=60"/>
		<updated>2023-01-16T12:20:11Z</updated>

		<summary type="html">&lt;p&gt;AL: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under &amp;lt;code&amp;gt;Soldat2/Scripts/&amp;lt;/code&amp;gt; and there needs to be a ruleset that specifies that script in the &amp;lt;i&amp;gt;GameScript&amp;lt;/i&amp;gt; object in its json - for example, see &amp;lt;code&amp;gt;Soldat2/Rules/Standard/Climb.json&amp;lt;/code&amp;gt;. The script can be tested by starting a game that uses that ruleset.&lt;br /&gt;
&lt;br /&gt;
= Scripting Resources =&lt;br /&gt;
The Soldat 2 engine uses Unity, so it may be useful to familiarise yourself with the [https://docs.unity3d.com/2020.1/Documentation/Manual/index.html Unity Manual].&lt;br /&gt;
&lt;br /&gt;
There is some [https://soldat2.com/docs/ preliminary documentation] for the Soldat 2 engine, however it is currently rather limited.&lt;br /&gt;
&lt;br /&gt;
Some examples of scripts can be found in your Soldat 2 game directory under the path &amp;lt;code&amp;gt;Soldat2/Scripts/Standard/&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=59</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Scripting_Introduction&amp;diff=59"/>
		<updated>2023-01-16T11:17:32Z</updated>

		<summary type="html">&lt;p&gt;AL: Created page with &amp;quot;Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under &amp;lt;code&amp;gt;Soldat2/Scripts/&amp;lt;/code&amp;gt; and there needs to be a ruleset that specifies that script in the &amp;lt;i&amp;gt;GameScript&amp;lt;/i&amp;gt; object in its json - for example, see &amp;lt;code&amp;gt;Soldat2/Rules/Standard/Climb.json&amp;lt;/code&amp;gt;. The script can be tested by starting a game that uses that ruleset.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under &amp;lt;code&amp;gt;Soldat2/Scripts/&amp;lt;/code&amp;gt; and there needs to be a ruleset that specifies that script in the &amp;lt;i&amp;gt;GameScript&amp;lt;/i&amp;gt; object in its json - for example, see &amp;lt;code&amp;gt;Soldat2/Rules/Standard/Climb.json&amp;lt;/code&amp;gt;. The script can be tested by starting a game that uses that ruleset.&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
	<entry>
		<id>https://wiki.soldat2.com/index.php?title=Main_Page&amp;diff=58</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat2.com/index.php?title=Main_Page&amp;diff=58"/>
		<updated>2023-01-16T10:48:18Z</updated>

		<summary type="html">&lt;p&gt;AL: Add link to ranked page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Welcome to the Soldat 2 Wiki&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contents ==&lt;br /&gt;
* [[Weapons]]&lt;br /&gt;
* [[Ranked]]&lt;br /&gt;
* [[Movement|Movement Guide]]&lt;br /&gt;
* [[Mapping|Mapping Guide]]&lt;br /&gt;
* [[Server Hosting]]&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
* [https://store.steampowered.com/app/474220/Soldat_2/ Soldat 2 on STEAM]&lt;br /&gt;
* [https://oczki.pl/s2-players Active Player Dashboard]&lt;br /&gt;
* [https://stats.soldat2.com/ Ranked Ladder Statistics &amp;amp; Leaderboards]&lt;br /&gt;
* [https://tms2.jrgp.org/ The Soldat 2 Mapping Showcase]&lt;br /&gt;
* [https://kreis.uber.space/soldat2/mapview/ Map Search &amp;amp; Overview]&lt;/div&gt;</summary>
		<author><name>AL</name></author>
	</entry>
</feed>