<?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=Move_Position_Events</id>
	<title>Move Position Events - 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=Move_Position_Events"/>
	<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Move_Position_Events&amp;action=history"/>
	<updated>2026-08-25T11:19:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://chronocrash.com/openbor/wiki/index.php?title=Move_Position_Events&amp;diff=969&amp;oldid=prev</id>
		<title>Dcurrent at 00:52, 19 August 2026</title>
		<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Move_Position_Events&amp;diff=969&amp;oldid=prev"/>
		<updated>2026-08-19T00:52:14Z</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:52, 18 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-l274&quot;&gt;Line 274:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 274:&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;* [[Binding]]&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;* [[Binding]]&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;* [[Movement configuration]]&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;* [[Movement configuration]]&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;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=Move_Position_Events&amp;diff=968&amp;oldid=prev</id>
		<title>Dcurrent: Created page with &quot;&lt;code&gt;onmovexscript&lt;/code&gt;, &lt;code&gt;onmoveyscript&lt;/code&gt;, and &lt;code&gt;onmovezscript&lt;/code&gt; define model-level hooks for responding to entity movement along OpenBOR&#039;s three world axes. Each hook executes after a qualifying movement stage for its axis and receives the moving entity as &lt;code&gt;self&lt;/code&gt;.  These hooks are useful for movement effects, environmental interaction, trails, custom physics, camera logic, state tracking, sound control, movement-dependent attacks, and ot...&quot;</title>
		<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Move_Position_Events&amp;diff=968&amp;oldid=prev"/>
		<updated>2026-08-19T00:49:56Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;code&amp;gt;onmovexscript&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;onmoveyscript&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;onmovezscript&amp;lt;/code&amp;gt; define model-level hooks for responding to entity movement along OpenBOR&amp;#039;s three world axes. Each hook executes after a qualifying movement stage for its axis and receives the moving entity as &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt;.  These hooks are useful for movement effects, environmental interaction, trails, custom physics, camera logic, state tracking, sound control, movement-dependent attacks, and ot...&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;onmovexscript&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;onmoveyscript&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;onmovezscript&amp;lt;/code&amp;gt; define model-level hooks for responding to entity movement along OpenBOR&amp;#039;s three world axes. Each hook executes after a qualifying movement stage for its axis and receives the moving entity as &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These hooks are useful for movement effects, environmental interaction, trails, custom physics, camera logic, state tracking, sound control, movement-dependent attacks, and other systems that should react to motion rather than run continuously.&lt;br /&gt;
&lt;br /&gt;
The hooks are related by purpose, though their native triggers are not identical. X and Z report successful collision-aware lateral movement. Y reports active vertical velocity during gravity processing.&lt;br /&gt;
&lt;br /&gt;
== Hook Summary ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Model command&lt;br /&gt;
! Axis&lt;br /&gt;
! Native trigger&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;onmovexscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| X - Horizontal level position&lt;br /&gt;
| Collision-aware lateral movement accepts a nonzero X displacement.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;onmoveyscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| Y - Vertical altitude&lt;br /&gt;
| Gravity processing leaves the entity with nonzero Y velocity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;onmovezscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| Z - Lateral level depth&lt;br /&gt;
| Collision-aware lateral movement accepts a nonzero Z displacement.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The commands do not form a universal observer for every position change. Direct property assignment, binding, and several specialized placement systems can move an entity without invoking them.&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;
onmovexscript {path}&lt;br /&gt;
onmoveyscript {path}&lt;br /&gt;
onmovezscript {path}&lt;br /&gt;
&lt;br /&gt;
# Default&lt;br /&gt;
# No corresponding Onmove script&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;
* Each command belongs in a model definition.&lt;br /&gt;
* OpenBOR loads and compiles each supplied source with the model.&lt;br /&gt;
* Each source defines a normal &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt; entry point.&lt;br /&gt;
* Script return values are ignored.&lt;br /&gt;
&lt;br /&gt;
Example model header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
name example_entity&lt;br /&gt;
type enemy&lt;br /&gt;
&lt;br /&gt;
onmovexscript data/scripts/example_move_x.c&lt;br /&gt;
onmoveyscript data/scripts/example_move_y.c&lt;br /&gt;
onmovezscript data/scripts/example_move_z.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;
onmoveyscript @script&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    void self = getlocalvar(&amp;quot;self&amp;quot;);&lt;br /&gt;
    float velocity_y = get_entity_property(&lt;br /&gt;
        self,&lt;br /&gt;
        ENTITY_PROPERTY_VELOCITY_Y&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    update_vertical_effect(self, velocity_y);&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;update_vertical_effect()&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;
All three hooks receive the same local:&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;
| Entity whose movement triggered the script.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
No displacement, velocity, direction, movement source, collision result, platform, or logical time is supplied automatically. Retrieve current values from &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; or project-managed state when needed.&lt;br /&gt;
&lt;br /&gt;
Useful entity properties include:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_POSITION_X&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_POSITION_Y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_POSITION_Z&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_VELOCITY_X&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_VELOCITY_Y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_VELOCITY_Z&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_MOVE_X&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTITY_PROPERTY_MOVE_Z&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The X and Z move properties are working movement accumulators during lateral processing. They should not be assumed to contain a finalized accepted displacement while an Onmove callback is still executing.&lt;br /&gt;
&lt;br /&gt;
== X and Z Movement ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onmovexscript&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;onmovezscript&amp;lt;/code&amp;gt; execute from OpenBOR&amp;#039;s collision-aware lateral movement handler. The handler first tests screen limits, holes, obstacles, platforms, walls, and the final destination. Accepted movement is then applied to both lateral coordinates before either callback executes.&lt;br /&gt;
&lt;br /&gt;
After placement:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;onmovexscript&amp;lt;/code&amp;gt; executes when the accepted X displacement is nonzero.&lt;br /&gt;
# &amp;lt;code&amp;gt;onmovezscript&amp;lt;/code&amp;gt; executes when the accepted Z displacement is nonzero.&lt;br /&gt;
&lt;br /&gt;
Diagonal movement can therefore execute both hooks. X executes first, followed by Z. Both callbacks observe the already-updated X and Z position.&lt;br /&gt;
&lt;br /&gt;
When one axis is blocked and the other remains valid, only the successful axis hook executes. Fully rejected movement executes neither hook. Related [[Onblock scripts]] may execute earlier during the collision tests.&lt;br /&gt;
&lt;br /&gt;
=== Movement Sources ===&lt;br /&gt;
&lt;br /&gt;
Lateral movement can reach these hooks from several native sources:&lt;br /&gt;
&lt;br /&gt;
* Walking, running, and native artificial intelligence movement.&lt;br /&gt;
* X or Z velocity accumulated during the entity update.&lt;br /&gt;
* Animation-configured lateral movement.&lt;br /&gt;
* Moving-platform carry when the rider uses collision-aware movement.&lt;br /&gt;
* Native grab-walking and linked movement that routes through the same handler.&lt;br /&gt;
&lt;br /&gt;
More than one collision-aware movement operation can occur during a single logical cycle. Platform carry may occur before the entity applies its own movement, for example. X and Z callbacks are therefore event-driven and are not limited to one execution per logical cycle.&lt;br /&gt;
&lt;br /&gt;
Some entity types intentionally use direct lateral placement instead of the collision-aware movement handler. Their X and Z position can change without executing these hooks.&lt;br /&gt;
&lt;br /&gt;
== Y Movement ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;onmoveyscript&amp;lt;/code&amp;gt; belongs to gravity processing rather than the lateral collision handler. OpenBOR first applies the entity&amp;#039;s existing Y velocity to its position, calculates gravity, updates and limits Y velocity, and evaluates the configured drop-position transition. Onmoveyscript then executes when the resulting Y velocity is nonzero.&lt;br /&gt;
&lt;br /&gt;
Positive Y velocity moves upward. Negative Y velocity moves downward.&lt;br /&gt;
&lt;br /&gt;
The trigger is based on velocity after gravity and speed limiting, not a direct comparison between old and new Y positions. Consequences include:&lt;br /&gt;
&lt;br /&gt;
* The hook may execute when gravity has just created nonzero velocity even if Y position did not change earlier in that same gravity pass.&lt;br /&gt;
* The hook does not execute when velocity becomes exactly zero, even if the previous velocity already changed Y position during that pass.&lt;br /&gt;
* Landing resolution occurs after the callback, so the entity may be at or below its base while Onmoveyscript still reports the final active downward velocity.&lt;br /&gt;
&lt;br /&gt;
Changes made by Onmoveyscript occur before native landing resolution. Script may inspect or modify position, velocity, animation, damage, or other state used by the remaining landing logic. Its return value does not cancel the native process.&lt;br /&gt;
&lt;br /&gt;
Direct Y placement, moving-platform base correction, and binding do not invoke Onmoveyscript merely because they changed altitude. The hook specifically belongs to active gravity processing with nonzero resulting Y velocity.&lt;br /&gt;
&lt;br /&gt;
== Runtime Order ==&lt;br /&gt;
&lt;br /&gt;
The usual logical-cycle order is:&lt;br /&gt;
&lt;br /&gt;
# [[Updateentityscript]] executes during the entity&amp;#039;s main update when eligible.&lt;br /&gt;
# Native action, thinking, and animation processing continue.&lt;br /&gt;
# Attack collision and health-display processing occur.&lt;br /&gt;
# X and Z velocity are added to pending lateral movement.&lt;br /&gt;
# Post-update processing begins with base adjustment and gravity.&lt;br /&gt;
# Y position and velocity are processed.&lt;br /&gt;
# &amp;lt;code&amp;gt;onmoveyscript&amp;lt;/code&amp;gt; executes when resulting Y velocity is nonzero.&lt;br /&gt;
# Native landing processing continues.&lt;br /&gt;
# Pending X and Z movement is tested and applied.&lt;br /&gt;
# &amp;lt;code&amp;gt;onmovexscript&amp;lt;/code&amp;gt; executes for accepted X movement.&lt;br /&gt;
# &amp;lt;code&amp;gt;onmovezscript&amp;lt;/code&amp;gt; executes for accepted Z movement.&lt;br /&gt;
# Binding resolves after movement is complete.&lt;br /&gt;
&lt;br /&gt;
Onmoveyscript normally precedes the lateral hooks during the post-update pass. Binding occurs later and does not retroactively execute an Onmove script for position changes it applies.&lt;br /&gt;
&lt;br /&gt;
== Changes That Do Not Trigger the Hooks ==&lt;br /&gt;
&lt;br /&gt;
The following operations do not inherently execute an Onmove hook:&lt;br /&gt;
&lt;br /&gt;
* Assigning &amp;lt;code&amp;gt;ENTITY_PROPERTY_POSITION_X&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ENTITY_PROPERTY_POSITION_Y&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ENTITY_PROPERTY_POSITION_Z&amp;lt;/code&amp;gt; directly.&lt;br /&gt;
* Repositioning an entity through binding.&lt;br /&gt;
* Native base correction placing an entity onto vertically moving terrain.&lt;br /&gt;
* Lateral movement performed by an entity type without a collision-aware movement handler.&lt;br /&gt;
* Rejected movement that leaves the applicable lateral displacement at zero.&lt;br /&gt;
* Vertical processing whose resulting Y velocity is zero.&lt;br /&gt;
&lt;br /&gt;
Scripts needing to observe every possible coordinate change should compare stored and current positions from a general update hook. Onmove scripts are targeted callbacks for specific native movement paths, not global property-change events.&lt;br /&gt;
&lt;br /&gt;
== Frozen and Fresh Entities ==&lt;br /&gt;
&lt;br /&gt;
Frozen entities do not apply their own ordinary lateral or vertical movement, so their Onmove hooks normally remain inactive. Moving-platform carry is processed before the rider&amp;#039;s lateral freeze check, allowing X or Z callbacks when a frozen rider is carried through collision-aware movement.&lt;br /&gt;
&lt;br /&gt;
Onmoveyscript remains suppressed while the entity is frozen because active gravity movement is skipped.&lt;br /&gt;
&lt;br /&gt;
Freshly spawned entities skip the main entity update during their spawn cycle, though they still participate in post-update processing. Existing pending movement, platform carry, or vertical state can consequently produce an Onmove callback during that cycle. Pausing the logical engine prevents the normal update pass from advancing.&lt;br /&gt;
&lt;br /&gt;
== Return Values and Script Changes ==&lt;br /&gt;
&lt;br /&gt;
Return values are ignored for all three hooks.&lt;br /&gt;
&lt;br /&gt;
X and Z collision decisions are complete before their callbacks execute. Returning a value cannot restore a blocked movement axis. Direct position changes made by script remain possible, though those changes bypass the collision checks that preceded the callback.&lt;br /&gt;
&lt;br /&gt;
Y executes before native landing resolution. Returning a value still has no control effect, though property changes may influence the logic that follows because the engine reads the modified entity state afterward.&lt;br /&gt;
&lt;br /&gt;
== Quick Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Lateral Movement Effect ===&lt;br /&gt;
&lt;br /&gt;
The same project function can be called from separate X and Z scripts. Systems that should run only once for diagonal movement must guard against both hooks executing during the same operation.&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;
    float x = get_entity_property(&lt;br /&gt;
        self,&lt;br /&gt;
        ENTITY_PROPERTY_POSITION_X&lt;br /&gt;
    );&lt;br /&gt;
    float z = get_entity_property(&lt;br /&gt;
        self,&lt;br /&gt;
        ENTITY_PROPERTY_POSITION_Z&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    update_lateral_trail(self, x, z);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Rising and Falling Effects ===&lt;br /&gt;
&lt;br /&gt;
Onmoveyscript can select behavior from the post-gravity velocity sign:&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;
    float velocity_y = get_entity_property(&lt;br /&gt;
        self,&lt;br /&gt;
        ENTITY_PROPERTY_VELOCITY_Y&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    if(velocity_y &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        update_rising_effect(self, velocity_y);&lt;br /&gt;
    }&lt;br /&gt;
    else if(velocity_y &amp;lt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        update_falling_effect(self, velocity_y);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The called functions in these examples are project-defined and illustrate routing rather than a complete effect system.&lt;br /&gt;
&lt;br /&gt;
== Common Uses ==&lt;br /&gt;
&lt;br /&gt;
* Producing footsteps, dust, wakes, skid effects, or movement trails.&lt;br /&gt;
* Updating terrain interaction while an entity moves laterally.&lt;br /&gt;
* Applying ascent, fall, or wind effects according to Y velocity.&lt;br /&gt;
* Coordinating movement-dependent audio.&lt;br /&gt;
* Recording accepted lateral movement for custom state systems.&lt;br /&gt;
* Adjusting camera or interface behavior according to entity motion.&lt;br /&gt;
* Extending native movement without running equivalent work during stationary cycles.&lt;br /&gt;
&lt;br /&gt;
== Common Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* Treating the hooks as universal observers for all coordinate changes.&lt;br /&gt;
* Expecting blocked X or Z movement to execute the corresponding Onmove script.&lt;br /&gt;
* Expecting direct position assignment or binding to invoke a hook.&lt;br /&gt;
* Assuming X and Z callbacks execute no more than once per logical cycle.&lt;br /&gt;
* Forgetting that diagonal movement executes X first and then Z.&lt;br /&gt;
* Reading &amp;lt;code&amp;gt;ENTITY_PROPERTY_MOVE_X&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ENTITY_PROPERTY_MOVE_Z&amp;lt;/code&amp;gt; as a finalized displacement during the callback.&lt;br /&gt;
* Assuming Onmoveyscript proves that Y position changed during the same gravity pass.&lt;br /&gt;
* Expecting Onmoveyscript when direct placement changes altitude with zero Y velocity.&lt;br /&gt;
* Returning a value and expecting movement or landing logic to be cancelled.&lt;br /&gt;
* Producing the same lateral effect twice when both X and Z callbacks handle one diagonal movement.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Geometry Overview]]&lt;br /&gt;
* [[Entity properties]]&lt;br /&gt;
* [[Updateentityscript]]&lt;br /&gt;
* [[Animationscript]]&lt;br /&gt;
* [[Binding]]&lt;br /&gt;
* [[Movement configuration]]&lt;/div&gt;</summary>
		<author><name>Dcurrent</name></author>
	</entry>
</feed>