<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=SetMonsterMoveGoal</id>
	<title>SetMonsterMoveGoal - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=SetMonsterMoveGoal"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=SetMonsterMoveGoal&amp;action=history"/>
	<updated>2026-09-19T06:33:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=SetMonsterMoveGoal&amp;diff=707&amp;oldid=prev</id>
		<title>QCherry: Document Lua APIs available or improved from G1R:MP 0.1.2</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=SetMonsterMoveGoal&amp;diff=707&amp;oldid=prev"/>
		<updated>2026-09-03T18:40:09Z</updated>

		<summary type="html">&lt;p&gt;Document Lua APIs available or improved from G1R:MP 0.1.2&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= setMonsterMoveGoal =&lt;br /&gt;
&amp;lt;div style=&amp;quot;background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#111111; font-weight:bold; letter-spacing:0.04em;&amp;quot;&amp;gt;AVAILABLE FROM UPDATE 0.1.2&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#111111; margin-top:0.25rem;&amp;quot;&amp;gt;This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assigns one direct, collision-checked movement goal to a resource-owned ground monster in scripted navigation mode.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setMonsterMoveGoal(string monsterId, number x, number y, number z [, table options])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;monsterId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || yes || The opaque decimal monster identifier returned by &amp;lt;code&amp;gt;spawnMonster&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;getMonsters&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || yes || Goal X coordinate in metres.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || yes || Goal Y coordinate in metres.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || yes || Ground-location Z reference in metres.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;options&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || no || Optional &amp;lt;code&amp;gt;{ speedScale = number, arrivalRadius = number }&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;speedScale&amp;lt;/code&amp;gt; must be greater than 0 and no greater than 1 and defaults to 1. &amp;lt;code&amp;gt;arrivalRadius&amp;lt;/code&amp;gt; is measured in metres, must be 0.01-5, and defaults to 0.2.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; when the complete goal is accepted; otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Walk directly toward a scripted guard position at half catalog speed:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line&amp;gt;&lt;br /&gt;
setMonsterNavigationMode(monsterId, &amp;quot;scripted&amp;quot;)&lt;br /&gt;
setMonsterMoveGoal(monsterId, 25.0, 12.0, 3.0, {&lt;br /&gt;
    speedScale = 0.5,&lt;br /&gt;
    arrivalRadius = 0.25,&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Available only in server-side resource scripts.&lt;br /&gt;
* Only the owning resource may set a goal, and the monster must be alive, ground-following and already in &amp;lt;code&amp;gt;&amp;quot;scripted&amp;quot;&amp;lt;/code&amp;gt; mode.&lt;br /&gt;
* The goal is a direct segment. Scripted mode does not invoke built-in path finding, avoidance, automatic detours, return-home movement or formation positioning.&lt;br /&gt;
* Static world blockers and authoritative player, NPC and monster capsules remain hard constraints. A blocked goal is retained and retried; the server never walks through a blocker.&lt;br /&gt;
* The owning resource receives one &amp;lt;code&amp;gt;onMonsterMoveBlocked&amp;lt;/code&amp;gt; edge when continuous blockage begins and one &amp;lt;code&amp;gt;onMonsterMoveComplete&amp;lt;/code&amp;gt; event when the arrival radius is reached.&lt;br /&gt;
* Movement is ground-only. The Z value must describe a plausible nearby ground location; this API does not control flying, vertical velocity or moving platforms.&lt;br /&gt;
* Target selection and authoritative attacks continue while navigation is scripted, although built-in movement toward the target is bypassed.&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Functions]]&lt;br /&gt;
[[Category:Server Functions]]&lt;br /&gt;
[[Category:World Functions]]&lt;br /&gt;
[[Category:Monster Functions]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>