Jump to content
  • 0

Auto-path with navigation feature.


Amellia sizilia sembiring

Question


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   4
  • Joined:  01/04/12
  • Last Seen:  

Hi, i want the character auto-walk to destination after select npc,mob,map in navigation. i need this script for custom quest.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   596
  • Joined:  11/25/11
  • Last Seen:  

Navigation System is a client-side feature, and, as far as I know, only some strange src modification would allow you to integrate the act of click on map (or npc, or mob) to the 'unitwalk' script command.
By the way, you can make a player walk using 'unitwalk/unitwalkto' commands, from a function or NPC.

*unitwalk <GID>,<x>,<y>{,"<event label>"};
*unitwalkto <GID>,<Target GID>{,"<event label>"};

This command will tell a <GID> to walk to a position, defined either as a set of
coordinates or another object. The command returns a 1 for success and 0 upon failure.

If coordinates are passed, the <GID> will walk to the given x,y coordinates on the
unit's current map. While there is no way to move across an entire map with 1 command
use, this could be used in a loop to move long distances.

If an object ID is passed, the initial <GID> will walk to the <Target GID> (similar to
walking to attack). This is based on the distance from <GID> to <Target ID>. This command
uses a hard walk check, so it will calculate a walk path with obstacles. Sending a bad
target ID will result in an error.

An optional Event Label can be passed as well which will execute when the <GID> has reached
the given coordinates or <Target GID>.

Examples:

// Makes player walk to the coordinates (150,150).
	unitwalk getcharid(3),150,150;

// Performs a conditional check with the command and reports success or failure to the player.
	if(unitwalk(getcharid(3),150,150))
		dispbottom "Walking you there...";
	else
		dispbottom "That's too far away, man.";

// Makes player walk to another character named "WalkToMe".
	unitwalkto getcharid(3),getcharid(3,"WalkToMe");

It may be possible to create a custom 'On' label which would cast a script after navigation system is used, but, again, it's a Source Modification.

Edited by Haziel
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...