PenUltima Online

It is currently Sat Sep 06, 2008 7:43 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: NPC movement (npc.em)
PostPosted: Mon Apr 07, 2008 8:42 am 
Offline

Joined: Thu Feb 02, 2006 8:33 am
Posts: 276
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 07, 2008 2:32 pm 
Offline
POL Developer
User avatar

Joined: Sun Feb 05, 2006 7:20 pm
Posts: 45
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. :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 07, 2008 3:57 pm 
Offline

Joined: Thu Feb 02, 2006 8:33 am
Posts: 276
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 :D

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:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 07, 2008 4:36 pm 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 548
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 07, 2008 6:17 pm 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 217
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl