Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

NPC movement


BeNjO
 Share

Recommended Posts

iv been looking and changing values to do with the npc movement and nothing seems to be hitting the spot. I am wanting the npcs to move around like a normal player, without the pauses every move, once i can do this i can then look into making them pause after X moves (to rest). The only thing i can achieve is helping npcs teleport from tile to tile but not actually move fluidly a few tiles, then stop then repeat.

Anyone have any ideas where to look?

Im sat in hospital with a Dongle (curse these things) and my partners laptop so bear with me if i double post and/or delay in posting. Im enjoying it in here as i can sit and fiddle with the codes all day and night without any nagging :D
Link to comment
Share on other sites

Hi there thanks for your reply, i changed it to 3, then to 2 then i = 0 then removed it along with the select case, the npcs just seem to move from one tile to the next quicker, they still pause every move.  Or when i delete the whole select case they walk about aimlessly, i can hit them and they will not walk after me. Any idea? :embarrassed:
Link to comment
Share on other sites

@TehDoug:

> Hi there thanks for your reply, i changed it to 3, then to 2 then i = 0 then removed it along with the select case, the npcs just seem to move from one tile to the next quicker, they still pause every move.  Or when i delete the whole select case they walk about aimlessly, i can hit them and they will not walk after me. Any idea? :embarrassed:

You have probably removed too much, make sure you've only removed the case and not more, else you remove the AI pathfinding.
Link to comment
Share on other sites

The problem isn't that simple to fix sadly, it was designed like this from the ground up and will need some extensive rewriting to get it to work otherwise in a proper way. You can speed it up, but that will just cause some odd behaviour or eat away at the server cycles more than it would need to(unless you do what Erwin said, but this may make it a little tough to get up to an NPC and melee them).

It can be done, but you can't just start cutting stuff out at random. Read into what all the cases do properly, and fiddle with them. Or write your own pathfinding mechanic to make them move around a bit more smoothly.
Link to comment
Share on other sites

Well a quick fix (somewhat) would be to change the " i = Int(Rnd * 5) " like erwin said in sub Updatemaplogic to" i = 0 " and also in the server loop find this  " tmr500 = GetTickCount + 500 " and change the "+ 500" to something lower.. They will still have a slight pause but this is an improvement and will make u npcs move more like a player =/ wish someone would rewrite the ai one of these days
Link to comment
Share on other sites

  • 7 months later...
I aslo need a help.I'm looking for source but i can't find it.

Please Help! - I want to make that npc always attack you and follow you .

So i need the source code, and please give me the source that opens some form when NPC attack you ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) TY Please help!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...