 |
 |
 |
 |
| Author |
Message |
Pierce
Joined: 02 Feb 2006 Posts: 256
|
Posted: Mon Apr 07, 2008 12:42 pm Post subject: NPC movement (npc.em) |
|
|
Inspired by Luth topic, i remember the things i missed in the past on NPC movement.
We all know the funny things in ai scripting when e.g. a dragon is stopped in movement by a small box or a group of some chicken or rats standing in his way. Players even use this to block npc.
You can script a complex workaround using findpath or script different cases.
I think it would be nice if the npc.em commands for movement could have two new features.
First, that an error is returned, if the npc can't move the next step cause the server denied it (blocking static, object (item or npc), multi).
At the moment you only get a 1 for a successfull move or an error if you put in a wrong param or invalid coordinates.
An error return like {"error", static}, {"error", item}, {"error", npc/char} or {"error", multi} would be great.
Second, a force movement param could be helpful (like MOVEOBJECT_FORCELOCATION). If we get an error like {"error", npc/char} where npc.npctemplate is a chicken to stay at the example above, a forced movement at the next step could be helpful. |
|
 |
|
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
| Author |
Message |
ncrsn
Joined: 10 Feb 2006 Posts: 168
|
Posted: Mon Apr 07, 2008 10:17 pm Post subject: |
|
|
Bring in the red pencil, this is highly needed!
Improving the idea, would be useful to even get all the item / mobile / multirefs that made the move fail. Of course this can be scripted listing and checking the objects on the destination tile, so this is would not be as high priority. UO::ListObjectsOnTheWay(mobile); is just a fancy idea, I think.
About the FORCE_PARAM, ain't this something that could also be spesified? Say, I have a ghost I'd like to be able to get through walls and fences, I could do it writing Move(ghost.facing, FORCEMOVE_STATIC + FORCEMOVE_ITEM);. And as a default solution to a failed step, I could have Move(npc.facing, FORCEMOVE_MOBILE);, as suggested. Oh, all the possibilities!
| Madman wrote: | | if you want to have an NPC move into or through a space occupied by another NPC, what are your options currently? |
MoveObjectToLocation() will do, but is not that pretty way - scripter would have to do the sleeping before step, play animations, recheck the ability to walk and do the actual move. Though, no need for the core if done this way. |
|
 |
|
|
|