<?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=Onmodelcopyscript</id>
	<title>Onmodelcopyscript - 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=Onmodelcopyscript"/>
	<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Onmodelcopyscript&amp;action=history"/>
	<updated>2026-11-19T23:20:14Z</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=Onmodelcopyscript&amp;diff=978&amp;oldid=prev</id>
		<title>Dcurrent: /* See Also */</title>
		<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Onmodelcopyscript&amp;diff=978&amp;oldid=prev"/>
		<updated>2026-08-20T02:44:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;See Also&lt;/span&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 21:44, 19 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-l368&quot;&gt;Line 368:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 368:&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;== See Also ==&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;== See Also ==&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 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;* [[Models]]&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;* [[Weapons]]&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;* [[Modelflag]]&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;* [[Changeentityproperty]]&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;* [[Changeplayerproperty]]&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;* [[Onspawnscript]]&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;* [[Onspawnscript]]&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;* [[Animationscript]]&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;* [[Animationscript]]&lt;/div&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;* [[Entity properties]]&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;* [[Model properties]]&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;[[Category:OpenBOR Index]]&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;[[Category:OpenBOR Index]]&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;[[Category:Script Events]]&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;[[Category:Script Events]]&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;[[Category:Model]]&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;[[Category:Model]]&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=Onmodelcopyscript&amp;diff=977&amp;oldid=prev</id>
		<title>Dcurrent at 02:43, 20 August 2026</title>
		<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Onmodelcopyscript&amp;diff=977&amp;oldid=prev"/>
		<updated>2026-08-20T02:43:11Z</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 21:43, 19 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-l377&quot;&gt;Line 377:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 377:&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;* [[Entity 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;* [[Entity 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;* [[Model 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;* [[Model properties]]&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 Index]]&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 Events]]&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:Model]]&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=Onmodelcopyscript&amp;diff=975&amp;oldid=prev</id>
		<title>Dcurrent: Created page with &quot;&lt;code&gt;onmodelcopyscript&lt;/code&gt; defines a model-level lifecycle hook for an entity changing from one model to another through OpenBOR&#039;s model-copy system. It executes after the incoming model and its scripts have been installed, providing the live entity as &lt;code&gt;self&lt;/code&gt; and a temporary snapshot of its previous state as &lt;code&gt;old&lt;/code&gt;.  Weapon models are the traditional use because equipping or removing a weapon can replace the player&#039;s active model. The hook is equ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Onmodelcopyscript&amp;diff=975&amp;oldid=prev"/>
		<updated>2026-08-19T02:03:54Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;code&amp;gt;onmodelcopyscript&amp;lt;/code&amp;gt; defines a model-level lifecycle hook for an entity changing from one model to another through OpenBOR&amp;#039;s model-copy system. It executes after the incoming model and its scripts have been installed, providing the live entity as &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; and a temporary snapshot of its previous state as &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt;.  Weapon models are the traditional use because equipping or removing a weapon can replace the player&amp;#039;s active model. The hook is equ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;code&amp;gt;onmodelcopyscript&amp;lt;/code&amp;gt; defines a model-level lifecycle hook for an entity changing from one model to another through OpenBOR&amp;#039;s model-copy system. It executes after the incoming model and its scripts have been installed, providing the live entity as &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; and a temporary snapshot of its previous state as &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Weapon models are the traditional use because equipping or removing a weapon can replace the player&amp;#039;s active model. The hook is equally useful for transformations, armor, mounts, alternate forms, stance packages, possession, power states, costume models, and other systems that change an existing entity without spawning a replacement.&lt;br /&gt;
&lt;br /&gt;
Onmodelcopyscript allows the incoming model to inspect what the entity was and finish the transition deliberately. Creator logic can preserve proportional health, transfer form-specific resources, reconfigure helpers, choose a transition animation, rebuild interface state, apply effects, or normalize any property that model copying alone cannot resolve.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
onmodelcopyscript {path}&lt;br /&gt;
&lt;br /&gt;
# Default&lt;br /&gt;
# No corresponding Onmodelcopyscript&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;{path}&amp;lt;/code&amp;gt; - Path to an OpenBOR Script source file.&lt;br /&gt;
* The command belongs in a model definition.&lt;br /&gt;
* Place the command on the incoming model that should handle the completed transition.&lt;br /&gt;
* OpenBOR loads and compiles the supplied source with the model.&lt;br /&gt;
* The source defines a normal &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt; entry point.&lt;br /&gt;
* The script&amp;#039;s return value is ignored.&lt;br /&gt;
&lt;br /&gt;
Example weapon or transformation model header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
name hero_armored&lt;br /&gt;
type player&lt;br /&gt;
&lt;br /&gt;
onmodelcopyscript data/scripts/hero_armored_copy.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Event code may also be embedded directly in the model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line&amp;gt;&lt;br /&gt;
onmodelcopyscript @script&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    void self = getlocalvar(&amp;quot;self&amp;quot;);&lt;br /&gt;
    void old = getlocalvar(&amp;quot;old&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    complete_model_transition(self, old);&lt;br /&gt;
}&lt;br /&gt;
@end_script&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;complete_model_transition()&amp;lt;/code&amp;gt; in this example represents a project-defined function.&lt;br /&gt;
&lt;br /&gt;
== Local Variables ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Local&lt;br /&gt;
! Type&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt;&lt;br /&gt;
| Entity pointer&lt;br /&gt;
| Live entity after the incoming model has been applied.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt;&lt;br /&gt;
| Entity pointer&lt;br /&gt;
| Temporary snapshot of the same entity immediately before the model change.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt; is more than a previous model handle. It is an entity snapshot containing the earlier model reference, copied model data, current health and magic, animation state, position, relationships, combat state, and other entity members as they existed before the transition.&lt;br /&gt;
&lt;br /&gt;
The live entity does not receive a new identity. &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; retains the same entity pointer, unique identifier, world membership, and general runtime state while its active model package changes.&lt;br /&gt;
&lt;br /&gt;
== The &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt; Snapshot ==&lt;br /&gt;
&lt;br /&gt;
OpenBOR prepares &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt; specifically for the callback. Direct entity members represent pre-copy values, while offense and defense arrays receive independent copies so the incoming model cannot overwrite the values most commonly needed for weapon transitions.&lt;br /&gt;
&lt;br /&gt;
The snapshot is temporary and valid only while Onmodelcopyscript is executing. Never store &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt; in a global variable, entity variable, array, object relationship, binding, or another location for later use. Its memory ceases to represent a valid object when the callback returns.&lt;br /&gt;
&lt;br /&gt;
Treat &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt; as read-only transition data rather than an entity in play. It is not a second world entity and should not be moved, damaged, killed, bound, spawned from, or passed to systems that expect an active entity-list member.&lt;br /&gt;
&lt;br /&gt;
The copy is intentionally shallow except for offense and defense arrays. Pointer-backed members may still refer to shared model data, scripts, objects, or live entities. Scalar properties and the embedded previous model-data copy are the safest sources for comparisons.&lt;br /&gt;
&lt;br /&gt;
Useful values include:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_MODEL&amp;lt;/code&amp;gt; - Previous cached model pointer on &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt;; incoming cached model pointer on &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_MODEL_DATA&amp;lt;/code&amp;gt; - Previous entity model-data copy on &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt;; incoming entity model-data copy on &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_HP&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ENTITY_PROPERTY_MP&amp;lt;/code&amp;gt; - Resource values before and after native limits are applied.&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_ANIMATION_ID&amp;lt;/code&amp;gt; - Previous and resulting animation identifiers.&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_ANIMATION_FRAME&amp;lt;/code&amp;gt; - Previous and resulting indexed animation positions.&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_DEFENSE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ENTITY_PROPERTY_OFFENSE&amp;lt;/code&amp;gt; - Independently preserved old arrays and rebuilt new arrays.&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_OWNER&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ENTITY_PROPERTY_PARENT&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;ENTITY_PROPERTY_WEAPON_ITEM&amp;lt;/code&amp;gt; - Relationship context when applicable.&lt;br /&gt;
&lt;br /&gt;
The word &amp;lt;code&amp;gt;FRAME&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;ENTITY_PROPERTY_ANIMATION_FRAME&amp;lt;/code&amp;gt; is the literal script identifier. Conceptually, the value is the current indexed position within the animation.&lt;br /&gt;
&lt;br /&gt;
== Trigger Conditions ==&lt;br /&gt;
&lt;br /&gt;
Onmodelcopyscript belongs to OpenBOR&amp;#039;s complete model-copy path. Current native entry points include:&lt;br /&gt;
&lt;br /&gt;
* Equipping, replacing, or removing a weapon when the operation selects another model.&lt;br /&gt;
* An animation&amp;#039;s weapon-change command.&lt;br /&gt;
* Native weapon pickup, loss, level restoration, and related player weapon handling.&lt;br /&gt;
* Script weapon changes routed through &amp;lt;code&amp;gt;changeentityproperty()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;changeplayerproperty()&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Script model changes routed through &amp;lt;code&amp;gt;changeentityproperty()&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
The event does not execute when the requested incoming model is already the entity&amp;#039;s current model. OpenBOR returns without performing a copy in that case.&lt;br /&gt;
&lt;br /&gt;
The following operations do not inherently invoke Onmodelcopyscript:&lt;br /&gt;
&lt;br /&gt;
* Spawning or respawning an entity. [[Onspawnscript]] covers entity creation.&lt;br /&gt;
* Directly assigning a model pointer with &amp;lt;code&amp;gt;set_entity_property()&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Low-level engine paths that change only the cached model reference.&lt;br /&gt;
* Modifying properties on the entity&amp;#039;s current model-data copy.&lt;br /&gt;
* Loading, caching, or inheriting a model definition without changing a live entity.&lt;br /&gt;
&lt;br /&gt;
Directly assigning &amp;lt;code&amp;gt;ENTITY_PROPERTY_MODEL&amp;lt;/code&amp;gt; is not a complete model transformation. Such assignment does not install model data, copy scripts, rebuild offense and defense, apply palette state, or dispatch this event. Use the full model-change path when the entity should actually transition.&lt;br /&gt;
&lt;br /&gt;
No &amp;lt;code&amp;gt;global_model&amp;lt;/code&amp;gt; Onmodelcopyscript is executed. The callback belongs to the script set installed on the transitioning entity, normally supplied by the incoming model.&lt;br /&gt;
&lt;br /&gt;
== Initiating a Scripted Model Change ==&lt;br /&gt;
&lt;br /&gt;
The current full model-change route is the &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt; property of &amp;lt;code&amp;gt;changeentityproperty()&amp;lt;/code&amp;gt;. Its final argument governs animation synchronization:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line&amp;gt;&lt;br /&gt;
changeentityproperty(&lt;br /&gt;
    self,&lt;br /&gt;
    &amp;quot;model&amp;quot;,&lt;br /&gt;
    &amp;quot;hero_armored&amp;quot;,&lt;br /&gt;
    1&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the final argument is nonzero and the incoming model supplies the current animation, OpenBOR retains the animation identifier and indexed position. When synchronization is disabled or the incoming model lacks that animation, OpenBOR selects the appropriate starting state for the new model.&lt;br /&gt;
&lt;br /&gt;
Weapon changes use the same internal model-copy operation. Their animation argument is interpreted through the weapon-changing wrapper, so creator code should follow the documented weapon API rather than assuming it has identical polarity to the direct model argument.&lt;br /&gt;
&lt;br /&gt;
== Runtime Order ==&lt;br /&gt;
&lt;br /&gt;
The relevant transition order is:&lt;br /&gt;
&lt;br /&gt;
# OpenBOR resolves the requested incoming model.&lt;br /&gt;
# When the incoming model is already current, the operation ends with no callback.&lt;br /&gt;
# Model-copy flags on the incoming model govern inheritance from the outgoing model.&lt;br /&gt;
# OpenBOR preserves a temporary snapshot of the live entity for &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt; when the incoming callback is available.&lt;br /&gt;
# The live entity&amp;#039;s cached model and model-data copy change to the incoming model.&lt;br /&gt;
# Selected compatibility properties from the outgoing entity model data are retained where native rules require them.&lt;br /&gt;
# The entity&amp;#039;s original type is restored, preventing a weapon or form model from changing its fundamental runtime type.&lt;br /&gt;
# Instance scripts transition to the incoming model&amp;#039;s script set.&lt;br /&gt;
# Offense and defense arrays are rebuilt from the resulting model data.&lt;br /&gt;
# The entity&amp;#039;s current palette selection is reapplied.&lt;br /&gt;
# Onmodelcopyscript executes with the resulting entity as &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; and the prior snapshot as &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Control returns to the weapon or model-changing caller, which may perform additional source-specific work.&lt;br /&gt;
&lt;br /&gt;
Onmodelcopyscript is therefore a post-copy hook. The incoming model, model data, scripts, offense, defense, and palette are already active. Changes made by the callback become the final transition adjustments before the initiating model-copy operation returns.&lt;br /&gt;
&lt;br /&gt;
[[Onspawnscript]] does not run because the entity was not created. The entity&amp;#039;s next ordinary update continues according to its existing lifecycle and timing.&lt;br /&gt;
&lt;br /&gt;
== State Preserved by the Entity ==&lt;br /&gt;
&lt;br /&gt;
Model copying transforms an existing entity rather than replacing it. Position, direction, unique identifier, owner, parent, opponent, bindings, runtime counters, and many other entity-level values generally remain in place unless native model-copy logic or script changes them.&lt;br /&gt;
&lt;br /&gt;
Current health and magic also remain, though OpenBOR clamps either value when it exceeds the incoming maximum. Missing incoming maximum values may inherit their outgoing counterparts through compatibility rules.&lt;br /&gt;
&lt;br /&gt;
The entity&amp;#039;s runtime type is explicitly preserved from the outgoing state. Weapon and transformation models do not turn a player into an item, projectile, or enemy merely because the incoming model definition uses another type.&lt;br /&gt;
&lt;br /&gt;
Script instance storage is retained across the copy operation. Incoming script bytecode replaces matching initialized script slots, while the model&amp;#039;s &amp;lt;code&amp;gt;modelflag&amp;lt;/code&amp;gt; determines whether unmatched outgoing script slots remain available.&lt;br /&gt;
&lt;br /&gt;
Animation handling depends on the synchronization argument. Successful synchronization retains the current animation identifier and indexed position against the incoming animation. Fallback handling selects a spawn, respawn, select, or idle state according to the current screen, logical time, entity type, and available animations.&lt;br /&gt;
&lt;br /&gt;
== Model Copy Flags ==&lt;br /&gt;
&lt;br /&gt;
The incoming model&amp;#039;s &amp;lt;code&amp;gt;modelflag&amp;lt;/code&amp;gt; command controls which portions of the outgoing model may be inherited during transition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
modelflag {flags}&lt;br /&gt;
&lt;br /&gt;
# Default&lt;br /&gt;
modelflag none&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Multiple named flags may be combined on one line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
modelflag no_basic no_weapon no_script&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Flag&lt;br /&gt;
! Effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
| Enables the default compatibility copy behavior.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;no_basic&amp;lt;/code&amp;gt;&lt;br /&gt;
| Prevents the incoming model from inheriting the outgoing model&amp;#039;s basic compatibility package. Current native members include movement configuration, missing movement and run values, icons, shadow and effect references, sounds, and missing animations.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;no_weapon&amp;lt;/code&amp;gt;&lt;br /&gt;
| Prevents the incoming model from inheriting the outgoing model&amp;#039;s weapon index and missing weapon list.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;no_script&amp;lt;/code&amp;gt;&lt;br /&gt;
| Clears the entity&amp;#039;s outgoing script slots before incoming model scripts are copied. Incoming scripts still install normally, including Onmodelcopyscript itself.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;no_script&amp;lt;/code&amp;gt; does not disable scripts. It prevents scripts absent from the incoming model from lingering on the entity after the transition. Model scripts actually supplied by the incoming model still replace their corresponding slots.&lt;br /&gt;
&lt;br /&gt;
The flags belong to the incoming model, not the outgoing model and not the individual copy call. Every transition into that model uses its declared policy.&lt;br /&gt;
&lt;br /&gt;
=== Cached Model Inheritance ===&lt;br /&gt;
&lt;br /&gt;
Default basic and weapon inheritance can populate missing values directly on the cached incoming model. Those inherited values may then be observed by later entities that use the same model during the process lifetime.&lt;br /&gt;
&lt;br /&gt;
This behavior is useful for weapon models designed as extensions of one compatible base character. The weapon can omit shared animations and configuration, allowing the copy system to complete it from the wielder.&lt;br /&gt;
&lt;br /&gt;
Models intended for unrelated source characters or fully independent transformations should define their own data and use &amp;lt;code&amp;gt;no_basic&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_weapon&amp;lt;/code&amp;gt; as appropriate. Otherwise, the first source model copied into a shared target can influence later transitions.&lt;br /&gt;
&lt;br /&gt;
== Return Value and Re-entry ==&lt;br /&gt;
&lt;br /&gt;
The script&amp;#039;s return value is ignored. Returning &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, or another value does not undo the model copy or restore the previous model.&lt;br /&gt;
&lt;br /&gt;
Script may alter &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt;, select an animation, adjust resources, change relationships, or initiate another full model change. Since the callback executes synchronously, a second model change can invoke another Onmodelcopyscript before the first operation returns.&lt;br /&gt;
&lt;br /&gt;
Nested transitions enable intentional multi-stage forms, though cycles can recurse indefinitely. Guard any callback that can change models by testing the incoming and outgoing models, transition state, or another explicit condition.&lt;br /&gt;
&lt;br /&gt;
Removing &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; is also possible, though the weapon or model-changing caller can still have source-specific work remaining after the callback. Transition logic should account for that continuation rather than treating a return value as cancellation.&lt;br /&gt;
&lt;br /&gt;
== Quick Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Preserve Health Proportion ===&lt;br /&gt;
&lt;br /&gt;
Native copying preserves current health and clamps it to the incoming maximum. Transformations that should preserve the previous health percentage can calculate it from both embedded model-data copies:&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 self = getlocalvar(&amp;quot;self&amp;quot;);&lt;br /&gt;
    void old = getlocalvar(&amp;quot;old&amp;quot;);&lt;br /&gt;
    void old_model = get_entity_property(&lt;br /&gt;
        old,&lt;br /&gt;
        ENTITY_PROPERTY_MODEL_DATA&lt;br /&gt;
    );&lt;br /&gt;
    void new_model = get_entity_property(&lt;br /&gt;
        self,&lt;br /&gt;
        ENTITY_PROPERTY_MODEL_DATA&lt;br /&gt;
    );&lt;br /&gt;
    int old_hp = get_entity_property(&lt;br /&gt;
        old,&lt;br /&gt;
        ENTITY_PROPERTY_HP&lt;br /&gt;
    );&lt;br /&gt;
    int old_max = get_model_property(&lt;br /&gt;
        old_model,&lt;br /&gt;
        MODEL_PROPERTY_HP&lt;br /&gt;
    );&lt;br /&gt;
    int new_max = get_model_property(&lt;br /&gt;
        new_model,&lt;br /&gt;
        MODEL_PROPERTY_HP&lt;br /&gt;
    );&lt;br /&gt;
    int new_hp = old_hp;&lt;br /&gt;
&lt;br /&gt;
    if(old_max &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        new_hp = old_hp * new_max / old_max;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if(old_hp &amp;gt; 0 &amp;amp;&amp;amp; new_hp &amp;lt; 1)&lt;br /&gt;
    {&lt;br /&gt;
        new_hp = 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if(new_hp &amp;gt; new_max)&lt;br /&gt;
    {&lt;br /&gt;
        new_hp = new_max;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    set_entity_property(&lt;br /&gt;
        self,&lt;br /&gt;
        ENTITY_PROPERTY_HP,&lt;br /&gt;
        new_hp&lt;br /&gt;
    );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same pattern can migrate magic, guard points, transformation charge, armor, ammunition, or any project-defined resource.&lt;br /&gt;
&lt;br /&gt;
=== Transition-Specific Presentation ===&lt;br /&gt;
&lt;br /&gt;
Both model names are available during the callback:&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 self = getlocalvar(&amp;quot;self&amp;quot;);&lt;br /&gt;
    void old = getlocalvar(&amp;quot;old&amp;quot;);&lt;br /&gt;
    void old_model = get_entity_property(&lt;br /&gt;
        old,&lt;br /&gt;
        ENTITY_PROPERTY_MODEL_DATA&lt;br /&gt;
    );&lt;br /&gt;
    void new_model = get_entity_property(&lt;br /&gt;
        self,&lt;br /&gt;
        ENTITY_PROPERTY_MODEL_DATA&lt;br /&gt;
    );&lt;br /&gt;
    void old_name = get_model_property(&lt;br /&gt;
        old_model,&lt;br /&gt;
        MODEL_PROPERTY_NAME&lt;br /&gt;
    );&lt;br /&gt;
    void new_name = get_model_property(&lt;br /&gt;
        new_model,&lt;br /&gt;
        MODEL_PROPERTY_NAME&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    present_model_transition(&lt;br /&gt;
        self,&lt;br /&gt;
        old_name,&lt;br /&gt;
        new_name&lt;br /&gt;
    );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The project-defined function can select a flash, sound, animation, text callout, camera effect, or interface update according to the exact transition.&lt;br /&gt;
&lt;br /&gt;
=== Preserve Action Context ===&lt;br /&gt;
&lt;br /&gt;
Incoming logic can inspect the previous animation and indexed position even when the model-copy request did not synchronize them:&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 self = getlocalvar(&amp;quot;self&amp;quot;);&lt;br /&gt;
    void old = getlocalvar(&amp;quot;old&amp;quot;);&lt;br /&gt;
    int animation_id = get_entity_property(&lt;br /&gt;
        old,&lt;br /&gt;
        ENTITY_PROPERTY_ANIMATION_ID&lt;br /&gt;
    );&lt;br /&gt;
    int animation_position = get_entity_property(&lt;br /&gt;
        old,&lt;br /&gt;
        ENTITY_PROPERTY_ANIMATION_FRAME&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    restore_compatible_action(&lt;br /&gt;
        self,&lt;br /&gt;
        animation_id,&lt;br /&gt;
        animation_position&lt;br /&gt;
    );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;restore_compatible_action()&amp;lt;/code&amp;gt; represents project logic that validates the incoming animation before selecting an equivalent state.&lt;br /&gt;
&lt;br /&gt;
== Common Uses ==&lt;br /&gt;
&lt;br /&gt;
* Initializing an equipped weapon model from the outgoing character state.&lt;br /&gt;
* Restoring character behavior when a weapon is removed or lost.&lt;br /&gt;
* Migrating resources between normal, armored, mounted, powered, or transformed forms.&lt;br /&gt;
* Selecting transition effects according to both outgoing and incoming models.&lt;br /&gt;
* Reconfiguring child entities, interface elements, sound ownership, or encounter registration after a form change.&lt;br /&gt;
* Rebuilding project-specific offense, defense, movement, or artificial intelligence state.&lt;br /&gt;
* Preserving compatible action context across models with matching animations.&lt;br /&gt;
* Applying target-model rules after all native compatibility inheritance is complete.&lt;br /&gt;
&lt;br /&gt;
== Common Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* Treating &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt; as only a model pointer rather than a temporary entity snapshot.&lt;br /&gt;
* Storing &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt; for use after the callback returns.&lt;br /&gt;
* Trying to manipulate &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt; as though it were an active entity.&lt;br /&gt;
* Placing Onmodelcopyscript only on the outgoing model when the incoming model should own the transition logic.&lt;br /&gt;
* Expecting &amp;lt;code&amp;gt;global_model&amp;lt;/code&amp;gt; to receive the event.&lt;br /&gt;
* Expecting Onmodelcopyscript during spawn, respawn, or a request for the already-current model.&lt;br /&gt;
* Directly assigning &amp;lt;code&amp;gt;ENTITY_PROPERTY_MODEL&amp;lt;/code&amp;gt; and expecting a complete model copy.&lt;br /&gt;
* Expecting the return value to cancel or reverse the transition.&lt;br /&gt;
* Assuming &amp;lt;code&amp;gt;no_script&amp;lt;/code&amp;gt; disables incoming scripts.&lt;br /&gt;
* Forgetting that default basic or weapon inheritance can populate the cached incoming model.&lt;br /&gt;
* Starting another model change from the callback without preventing recursive cycles.&lt;br /&gt;
* Assuming model-copy animation synchronization and weapon-wrapper animation arguments use identical polarity.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Models]]&lt;br /&gt;
* [[Weapons]]&lt;br /&gt;
* [[Modelflag]]&lt;br /&gt;
* [[Changeentityproperty]]&lt;br /&gt;
* [[Changeplayerproperty]]&lt;br /&gt;
* [[Onspawnscript]]&lt;br /&gt;
* [[Animationscript]]&lt;br /&gt;
* [[Entity properties]]&lt;br /&gt;
* [[Model properties]]&lt;/div&gt;</summary>
		<author><name>Dcurrent</name></author>
	</entry>
</feed>