Author Topic: Pathfinding issue  (Read 3554 times)

0 Members and 1 Guest are viewing this topic.

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Pathfinding issue
« on: July 13, 2017, 05:12:34 PM »
0
Having an issue with it returning to the spot but still spamming pathfinding, if anyone can point me in the direction of what I need to add to make it return to the spot and stop trying to pathfind I would muchly appreciate it, thanks!
Code: [Select]
sub findattack1
finditem %target G_15
if #findcnt < 1
event pathfind 6788 3444
{
if #finddist > 1
event pathfind #findx #findy #findz
gosub attackmob
}
until #findcnt < 1
return

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Pathfinding issue
« Reply #1 on: July 13, 2017, 05:27:38 PM »
0
OK few question.

1)  event pathfind 6788 3444  < ------   why you hard code those number. 
2) what are you trying to pathfind too monster or location.

not tested  this is some a few chance I will made. but it missing stuff.
Code: easyuo
  1. sub findattack1
  2. finditem %target G_15
  3. if #findcnt = 0
  4.   event pathfind 6788 3444  :   <  why this hard code
  5.       {
  6.       if #finddist > 0 ; if monster is 1 or more title move to him
  7.       event pathfind #findx #findy #findz    ; <  this is not work because you haven't set up at reference point.
  8.       gosub attackmob
  9.       }
  10. until #FindCNT = 0  ; if no more monster exit
  11. return
  12.  


Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Pathfinding issue
« Reply #2 on: July 13, 2017, 05:29:37 PM »
0
Excuse me if I'm a bit noob, still trying to learn
1.Not even sure what hard code is haha
2. it's a location
To add the run to mob actually works in my script its just when returning to the location it just keeps pathfinding instead of just doing it once, I want my script to be able to do other subs while it is stationary but the pathfinding spam is killing it
« Last Edit: July 13, 2017, 05:37:21 PM by Ketchup »

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Pathfinding issue
« Reply #3 on: July 13, 2017, 05:37:59 PM »
0
Hard code mean that  the value can't chance, unless you do. 

event pathfind 6788 3444  :   <  this  is hard code.

 event PathFind #FindX #FindY ; Moves to the assign target. Land/ground/ mobile

Since you have provide only 1 location, that why you move their and spam work. because it a loop. 

if you want to see the flow of your sub without hitting pause you this
   Event sysmessage ( add word here)     
  This will display a msg in the bottom left of your screen


Now serious question.  You are trying to kill a target and go back to you starting point.

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Pathfinding issue
« Reply #4 on: July 13, 2017, 05:40:41 PM »
0
yeah just simply run to a target, kill it and run back to a point, I want to add my own subs when it's back at the point doing nothing

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Pathfinding issue
« Reply #5 on: July 25, 2017, 01:43:56 PM »
0
Ketchup,  did you read this http://www.scriptuo.com/index.php?topic=14053.msg115325#msg115325
you have a few example of script how to use move and pathfind.

Tags: