<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 9 June 2017 at 10:32,  <span dir="ltr"><<a href="mailto:subversion@hamsterrepublic.com" target="_blank">subversion@hamsterrepublic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">james<br>
2017-06-08 15:32:01 -0700 (Thu, 08 Jun 2017)<br>
235<br>
Add preliminary scripting interface for NPC pathfinding. None of these are documented yet, because I gotta do testing first<br>
  pathfind npc to (n, x, y)<br>
  npc chases npc (n, dest n, stop when reached)<br>
  cancel npc movement override (n)<br>
---<br>
U   wip/<a href="http://const.bi" rel="noreferrer" target="_blank">const.bi</a><br>
U   wip/game.bas<br>
U   wip/<a href="http://game.bi" rel="noreferrer" target="_blank">game.bi</a><br>
U   wip/plotscr.hsd<br>
U   wip/scriptcommands.bas<br>
U   wip/<a href="http://udts.bi" rel="noreferrer" target="_blank">udts.bi</a><br></blockquote><div><br></div><div>Cool!<br></div><div>Instead of cancelnpcmovementoverride I think we should add a generic stopnpc command to stop the current walk. Currently you have to script it yourself by doing walknpc(npc, left, 0) , walknpc(npc, down, 0), but that's non-obvious and can leave the npc misaligned (I guess we can add an arg whether to finish the current tile's movement or stop immediately).<br></div><div>I think that the NPC/hero pathfinding commands should behave like other NPC/hero walking commands; for example waitfornpc should work, and using walknpc would cancel pathfinding and vice versa. (Is it useful enough to have a way to move an npc without cancelling pathfinding to go to the trouble of special commands? I guess they would be 'pause' and 'resume' commands.)<br></div><div>Still, I guess npciswalking should probably return false for a pathfinding npc that's currently stuck for consistency, with a separate way to check whether an npc is pathfinding.<br></div><div><br></div><div>I know we're not using script error levels for much currently, but I expect they will be more important in future (in particular, I'd like to add a script error log where you can see warning messages without them causing annoying notifications). Don't use serrBound for new script commands. Use serrBadOp. That's already the default for get_valid_npc_id.<br><br>pathfinder_stop_when_npc_reached won't work if the dest npc is just over the map edge.<br><br></div><div>I'm rather amazed that it's possible to define constants with names npc and pos, which are used elsewhere as variable names...<br></div></div><br></div></div>