Jump to content
  • 0
Sign in to follow this  
hunter4565

How to make 'unitwalk' work when distance to target is too big?

Question

Hi people, i'm currently working on a "PvP bots" npc (server-side , not Kore stuff.) and i've tried creating some waypoints at the PvP (i'm using Prontera as PvP map).

However, i'm finding some problems with the *unitwalk command since it does nothing if the distance is too big (ie.: Order the unit to move from the center to the church). Is there any way to bypass it or even another solution for it?

 

I'm asking here in this section because i don't know how to mess with source code, sorry if i've posted in the wrong section.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

If it needs to walk then you have to make a small algorithm for it. So that it will walk to X recalculate route, walk to Y, recalculate route and continue in this pattern until it reaches it's destination.

Otherwise, you could just use unitwarp if the method of arrival doesn't matter so long as they get there.

Share this post


Link to post
Share on other sites
  • 0

You won't be able to make the walkpath much longer, even if you can recode pathfinding to not have any limits, it will become so complex that just a few units will make the CPU busy and require a lot of memory to remember all possible paths.

 

So yes, you need to use waypoints.

Share this post


Link to post
Share on other sites
  • 0

Thanks for the replies! I see, so i'll have to use "bread crumb" waypoints and make the bot walk trough it until the "hotspot" waypoints (for big distances).

 

Also, is there a way to make a circular check to make the bot find out avaible targets? I'm currently using a pre-defined array with the GID of the target account then the bot char checks if it's in range (9 cells) then proceeds to attack .

Edited by hunter4565

Share this post


Link to post
Share on other sites
  • 0

You could use, Annieruru's getmemberaid command. It can return all the AID's of users within X1,Y1,X2,Y2 range. So if you were to specify, all users with in 9 cells in any direction starting from the unit. You could have it just randomly choose 1 of those or make it do something else based on that information.

 

Also, you can use a script to make the mob walk dynamically to it's location. It'd be pretty much checking the unit's location every X seconds, and reroute accordingly mid walk, thus eliminating the need to actually set predefined points into an array and making it travel there and reroute to the next predetermined point until it reaches it's destination.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.