<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://chronocrash.com/openbor/wiki/index.php?action=history&amp;feed=atom&amp;title=Player_Join_Scripts</id>
	<title>Player Join Scripts - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://chronocrash.com/openbor/wiki/index.php?action=history&amp;feed=atom&amp;title=Player_Join_Scripts"/>
	<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Player_Join_Scripts&amp;action=history"/>
	<updated>2026-11-21T18:03:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://chronocrash.com/openbor/wiki/index.php?title=Player_Join_Scripts&amp;diff=1031&amp;oldid=prev</id>
		<title>Dcurrent at 01:28, 21 August 2026</title>
		<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Player_Join_Scripts&amp;diff=1031&amp;oldid=prev"/>
		<updated>2026-08-21T01:28:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:28, 20 August 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Player]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Script]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Script Events]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Join scripts&amp;#039;&amp;#039;&amp;#039; are global event hooks that execute when a player completes an in-progress join and enters active play. OpenBOR provides numbered scripts for slot-specific behavior and a shared &amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt; script for handling every player through one event listener.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Join scripts&amp;#039;&amp;#039;&amp;#039; are global event hooks that execute when a player completes an in-progress join and enters active play. OpenBOR provides numbered scripts for slot-specific behavior and a shared &amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt; script for handling every player through one event listener.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l257&quot;&gt;Line 257:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 253:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Player Properties]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Player Properties]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Script Overview]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Script Overview]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Openbor]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Script]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dcurrent</name></author>
	</entry>
	<entry>
		<id>https://chronocrash.com/openbor/wiki/index.php?title=Player_Join_Scripts&amp;diff=1030&amp;oldid=prev</id>
		<title>Dcurrent: Created page with &quot;Category:Player Category:Script Category:Script Events  &#039;&#039;&#039;Join scripts&#039;&#039;&#039; are global event hooks that execute when a player completes an in-progress join and enters active play. OpenBOR provides numbered scripts for slot-specific behavior and a shared &lt;code&gt;joinall.c&lt;/code&gt; script for handling every player through one event listener.  The numbered series consists of:  * &lt;code&gt;data/scripts/join1.c&lt;/code&gt; * &lt;code&gt;data/scripts/join2.c&lt;/code&gt; * &lt;code&gt;data/script...&quot;</title>
		<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Player_Join_Scripts&amp;diff=1030&amp;oldid=prev"/>
		<updated>2026-08-21T01:26:10Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/openbor/wiki/index.php?title=Category:Player&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:Player (page does not exist)&quot;&gt;Category:Player&lt;/a&gt; &lt;a href=&quot;/openbor/wiki/index.php/Category:Script&quot; title=&quot;Category:Script&quot;&gt;Category:Script&lt;/a&gt; &lt;a href=&quot;/openbor/wiki/index.php/Category:Script_Events&quot; title=&quot;Category:Script Events&quot;&gt;Category:Script Events&lt;/a&gt;  &amp;#039;&amp;#039;&amp;#039;Join scripts&amp;#039;&amp;#039;&amp;#039; are global event hooks that execute when a player completes an in-progress join and enters active play. OpenBOR provides numbered scripts for slot-specific behavior and a shared &amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt; script for handling every player through one event listener.  The numbered series consists of:  * &amp;lt;code&amp;gt;data/scripts/join1.c&amp;lt;/code&amp;gt; * &amp;lt;code&amp;gt;data/scripts/join2.c&amp;lt;/code&amp;gt; * &amp;lt;code&amp;gt;data/script...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Player]]&lt;br /&gt;
[[Category:Script]]&lt;br /&gt;
[[Category:Script Events]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Join scripts&amp;#039;&amp;#039;&amp;#039; are global event hooks that execute when a player completes an in-progress join and enters active play. OpenBOR provides numbered scripts for slot-specific behavior and a shared &amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt; script for handling every player through one event listener.&lt;br /&gt;
&lt;br /&gt;
The numbered series consists of:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data/scripts/join1.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;data/scripts/join2.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;data/scripts/join3.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;data/scripts/join4.c&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The shared listener is:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data/scripts/joinall.c&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Join scripts execute after OpenBOR creates the joining player&amp;#039;s entity. This makes them useful for party scaling, cooperative encounter adjustments, player-specific initialization, join effects, role assignment, shared objectives, statistics, announcements, and other systems that should react immediately when the active player group changes.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Create any desired join-script files in &amp;lt;code&amp;gt;data/scripts&amp;lt;/code&amp;gt;. OpenBOR loads them automatically, so no model, level, or project command is required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;join#.c&amp;lt;/code&amp;gt; is documentation shorthand in which &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; represents the player number. Literal filenames use &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; through &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File&lt;br /&gt;
! Scope&lt;br /&gt;
! Player identification&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;data/scripts/join1.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Player 1&lt;br /&gt;
| Filename - index &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;data/scripts/join2.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Player 2&lt;br /&gt;
| Filename - index &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;data/scripts/join3.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Player 3&lt;br /&gt;
| Filename - index &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;data/scripts/join4.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Player 4&lt;br /&gt;
| Filename - index &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;data/scripts/joinall.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Every player&lt;br /&gt;
| Local variable &amp;lt;code&amp;gt;playerindex&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Projects may use only the numbered files, only &amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt;, or both layers together.&lt;br /&gt;
&lt;br /&gt;
== Join Event ==&lt;br /&gt;
&lt;br /&gt;
Join scripts respond to the native in-progress join routine. The event occurs after a vacant player slot begins joining, completes its character or color selection as applicable, and confirms entry while joining is permitted.&lt;br /&gt;
&lt;br /&gt;
The event does not represent every player entity creation. It is distinct from:&lt;br /&gt;
&lt;br /&gt;
* Initial player creation when a level begins.&lt;br /&gt;
* Respawning an existing player after a lost life.&lt;br /&gt;
* Spawning an arbitrary player-type entity through level or script commands.&lt;br /&gt;
* Creating any other entity from a model that happens to use [[Onspawnscript]].&lt;br /&gt;
&lt;br /&gt;
Each completed in-progress join executes the applicable join-script chain once.&lt;br /&gt;
&lt;br /&gt;
== Execution Order ==&lt;br /&gt;
&lt;br /&gt;
OpenBOR performs the relevant join sequence in this order:&lt;br /&gt;
&lt;br /&gt;
# The player confirms an allowed in-progress join.&lt;br /&gt;
# OpenBOR initializes the player&amp;#039;s lives and stored spawn health and magic values.&lt;br /&gt;
# OpenBOR creates the player&amp;#039;s entity with its native player-spawn routine.&lt;br /&gt;
# The corresponding numbered script, &amp;lt;code&amp;gt;join1.c&amp;lt;/code&amp;gt; through &amp;lt;code&amp;gt;join4.c&amp;lt;/code&amp;gt;, executes when present.&lt;br /&gt;
# &amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt; executes when present and receives &amp;lt;code&amp;gt;playerindex&amp;lt;/code&amp;gt;.&lt;br /&gt;
# OpenBOR clears the player&amp;#039;s pending join input.&lt;br /&gt;
# Native post-join behavior continues, including the configured enemy-drop and level-timer reset behavior.&lt;br /&gt;
&lt;br /&gt;
The new player entity already exists when either join-script layer begins. Scripts may therefore retrieve the entity through the player property API and immediately inspect or configure it.&lt;br /&gt;
&lt;br /&gt;
The numbered script always executes before &amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt;. Shared logic can consequently consume state established by the slot-specific script during the same event.&lt;br /&gt;
&lt;br /&gt;
== Numbered Join Scripts ==&lt;br /&gt;
&lt;br /&gt;
Numbered join scripts are tied to the player slot identified by their filename. They receive no automatic event variables because the player identity is already fixed by that filename.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line&amp;gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    // join2.c always represents Player 2, player index 1.&lt;br /&gt;
    setglobalvar(&amp;quot;player_two_joined&amp;quot;, 1);&lt;br /&gt;
    setglobalvar(&amp;quot;player_two_role&amp;quot;, &amp;quot;support&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Slot-specific files are convenient when each player position has a distinct responsibility, starting package, interface, camera role, team assignment, or other fixed behavior.&lt;br /&gt;
&lt;br /&gt;
== Joinall ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt; is the shared listener for every player slot. OpenBOR supplies one automatic local variable:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Variable&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playerindex&amp;lt;/code&amp;gt;&lt;br /&gt;
| Integer&lt;br /&gt;
| Zero-based index of the player who completed the join. Values range from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; through &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; for Players 1 through 4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line&amp;gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    setglobalvar(&amp;quot;last_joined_playerindex&amp;quot;, playerindex);&lt;br /&gt;
    setglobalvar(&amp;quot;party_changed&amp;quot;, 1);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The zero-based index matches OpenBOR&amp;#039;s player property and scripting conventions:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &amp;lt;code&amp;gt;playerindex&amp;lt;/code&amp;gt;&lt;br /&gt;
! Player label&lt;br /&gt;
! Corresponding numbered script&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
| Player 1&lt;br /&gt;
| &amp;lt;code&amp;gt;join1.c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
| Player 2&lt;br /&gt;
| &amp;lt;code&amp;gt;join2.c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
| Player 3&lt;br /&gt;
| &amp;lt;code&amp;gt;join3.c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;&lt;br /&gt;
| Player 4&lt;br /&gt;
| &amp;lt;code&amp;gt;join4.c&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt; does not receive an automatic entity reference. The joining entity is available from the player slot because native spawning has already completed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line&amp;gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    void joined_entity = getplayerproperty(playerindex, &amp;quot;entity&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    if (joined_entity)&lt;br /&gt;
    {&lt;br /&gt;
        setglobalvar(&amp;quot;joined_player_ready&amp;quot;, playerindex);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creators can use &amp;lt;code&amp;gt;joined_entity&amp;lt;/code&amp;gt; immediately with the entity property API, binding functions, visual effects, or other systems that operate on active entities.&lt;br /&gt;
&lt;br /&gt;
== Combining Numbered and Shared Logic ==&lt;br /&gt;
&lt;br /&gt;
Both layers may participate in the same join. Their fixed execution order supports a useful division of responsibility:&lt;br /&gt;
&lt;br /&gt;
* Numbered &amp;lt;code&amp;gt;join#.c&amp;lt;/code&amp;gt; performs slot-specific setup.&lt;br /&gt;
* Shared &amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt; performs project-wide reconciliation after that setup.&lt;br /&gt;
&lt;br /&gt;
For example, numbered scripts might assign asymmetric cooperative roles while &amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt; recounts the active party, rescales an encounter, refreshes shared objectives, and displays a common join effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line&amp;gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    int active_players = 0;&lt;br /&gt;
    int index = 0;&lt;br /&gt;
&lt;br /&gt;
    for (index = 0; index &amp;lt; 4; index++)&lt;br /&gt;
    {&lt;br /&gt;
        if (getplayerproperty(index, &amp;quot;entity&amp;quot;))&lt;br /&gt;
        {&lt;br /&gt;
            active_players++;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    setglobalvar(&amp;quot;active_player_count&amp;quot;, active_players);&lt;br /&gt;
    setglobalvar(&amp;quot;rebalance_encounter&amp;quot;, 1);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compact shared listener responds to whichever slot joined without duplicating the party-reconciliation logic across four files.&lt;br /&gt;
&lt;br /&gt;
== Choosing a Join Script ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Need&lt;br /&gt;
! Recommended hook&lt;br /&gt;
|-&lt;br /&gt;
| Behavior unique to one fixed player slot&lt;br /&gt;
| Corresponding &amp;lt;code&amp;gt;join#.c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| The same behavior for every joining player&lt;br /&gt;
| &amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Fixed slot setup followed by common party handling&lt;br /&gt;
| Numbered &amp;lt;code&amp;gt;join#.c&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;joinall.c&amp;lt;/code&amp;gt; together&lt;br /&gt;
|-&lt;br /&gt;
| Behavior whenever any entity using a model is created&lt;br /&gt;
| [[Onspawnscript]]&lt;br /&gt;
|-&lt;br /&gt;
| Behavior when an existing player returns after losing a life&lt;br /&gt;
| [[Respawn Scripts]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other Uses ==&lt;br /&gt;
&lt;br /&gt;
Quick applications include:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Party scaling&amp;#039;&amp;#039;&amp;#039; - Recalculate enemy counts, durability, aggression, hazards, rewards, or encounter phases when the party grows.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Cooperative rules&amp;#039;&amp;#039;&amp;#039; - Enable team mechanics, shared resources, revival systems, combined objectives, or multiplayer-only routes.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Player setup&amp;#039;&amp;#039;&amp;#039; - Assign slot-specific roles, starting equipment, colors, resources, control modes, or interface elements.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Join presentation&amp;#039;&amp;#039;&amp;#039; - Play sounds, queue visual effects, display announcements, or introduce the arriving player.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Camera coordination&amp;#039;&amp;#039;&amp;#039; - Recalculate camera targets, split attention, stage boundaries, or multiplayer tracking behavior.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Objective reconciliation&amp;#039;&amp;#039;&amp;#039; - Add the player to escorts, survival conditions, team counters, voting systems, or synchronized sequences.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Statistics and achievements&amp;#039;&amp;#039;&amp;#039; - Record participation, join timing, party composition, or cooperative milestones.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Development tools&amp;#039;&amp;#039;&amp;#039; - Log join order, inspect selected models, verify slot state, or test multiplayer entry conditions.&lt;br /&gt;
&lt;br /&gt;
== Related Scripts ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Script&lt;br /&gt;
! Relationship&lt;br /&gt;
|-&lt;br /&gt;
| [[Respawn Scripts]]&lt;br /&gt;
| Execute when an existing player returns after losing a life. The numbered script runs before &amp;lt;code&amp;gt;respawnall.c&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| [[Die Scripts]]&lt;br /&gt;
| Execute when a player loses a life. The numbered script runs before &amp;lt;code&amp;gt;dieall.c&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| [[Onspawnscript]]&lt;br /&gt;
| Model event that executes for entity creation generally, including entities that are not player-controlled joins.&lt;br /&gt;
|-&lt;br /&gt;
| [[Keyscript]]&lt;br /&gt;
| Layered player-input events that may participate in beginning and confirming an in-progress join.&lt;br /&gt;
|-&lt;br /&gt;
| [[Level|level.c]]&lt;br /&gt;
| Global level-start event. Initial player creation is separate from the in-progress join event.&lt;br /&gt;
|-&lt;br /&gt;
| [[Score Scripts]]&lt;br /&gt;
| Numbered and shared global listeners for player score adjustments.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Respawn Scripts]]&lt;br /&gt;
* [[Die Scripts]]&lt;br /&gt;
* [[Onspawnscript]]&lt;br /&gt;
* [[Keyscript]]&lt;br /&gt;
* [[Score Scripts]]&lt;br /&gt;
* [[Player Properties]]&lt;br /&gt;
* [[Script Overview]]&lt;/div&gt;</summary>
		<author><name>Dcurrent</name></author>
	</entry>
</feed>