PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
NPC movement (npc.em)

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Feature Suggestions
Display posts from previous:   

Author Message
Pierce



Joined: 02 Feb 2006
Posts: 259

PostPosted: Mon Apr 07, 2008 12:42 pm    Post subject: NPC movement (npc.em) Reply with quote

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
Madman
POL Developer


Joined: 05 Feb 2006
Posts: 30

PostPosted: Mon Apr 07, 2008 6:32 pm    Post subject: Reply with quote

I'm not sure how easy or hard it'll be, but I do like in general errors being more verbose.

I'm not going to pretend to have had a shard for rather a while, right now, so this is a general question- if you want to have an NPC move into or through a space occupied by another NPC, what are your options currently? PCs can pushthrough (if it's on). NPCs? I don't remember, so I ask. Smile

Author Message
Pierce



Joined: 02 Feb 2006
Posts: 259

PostPosted: Mon Apr 07, 2008 7:57 pm    Post subject: Reply with quote

Well the options are quite limited. You can do what OldnGrey does, but that only helps you on one facet:

http://forums.polserver.com/ftopic1795.php

You can also set the freemove priv on npc's but that's not a good idea regarding paralyse, cause you can't stop them in that case Very Happy

You can write complex scripts which use a lot of system ressources, to do what the core seems already to do to respond to the npc. I think the core does this. Perhaps i'm wrong. If the core does it, i would like to have the answer as a "no, there is an npc or whatever blocking" in an error message with the blocking object Smile

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 529

PostPosted: Mon Apr 07, 2008 8:36 pm    Post subject: Reply with quote

Well don't forget that there are 2 movement checks.
One done by the core and one by the client.

Map1,2,3,4 all allow you to enter a square occupied by an npc and the pushthrough hook fires.
But on map0 the client will not let you walk into that space and so the hook never fires.

I don't know a way around that.
But moving my shard to map1 as default has not stopped me from working in Ilshenar at all.

Author Message
ncrsn



Joined: 10 Feb 2006
Posts: 189

PostPosted: Mon Apr 07, 2008 10:17 pm    Post subject: Reply with quote

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.

Post new topic   Reply to topic    PenUltima Online Forum Index -> Feature Suggestions All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty