Jump to content

WalkingEvent does not walk very well?


Recommended Posts

Posted (edited)

Im walking a path i have created using walkingEvent and i find that it will walk to the next tile in the path and get to that tile, then instead of going to the following tile it will click a tile next to me and then go to the next one.

 

Almost like it didnt go to the correct tile in the first place so it clicks a tile at the side of me then will move onto te next one. Maybe i need to set some sort of 2-3 tile tolerance?

 

Also sometimes it gets to the tile, then clicks again ion the tile even though im already there, then moves on.

 

Edited by saintpaul1
Posted
1 hour ago, Gunman said:

Maybe a logic issue? Hard to say without any code, could try playing with the distance offsets and see if that fixes it for you

Okay thanks ill have a play with it. This is my event :
 

 WalkingEvent event = new WalkingEvent();
                            event.setPath(areasAndPaths.pathList);
                            event.setHighBreakPriority(true);
                            event.setEnergyThreshold(10);
                            event.setBreakCondition(new Condition() {
                                @Override
                                public boolean evaluate() {
                                    return atPath;
                                }
                            });
                            main.execute(event);
 Position[] path = {
            new Position(3051, 3650, 0),
            new Position(3064, 3652, 0),
            new Position(3072, 3652, 0)
    };
    LinkedList<Position> pathList = new LinkedList<>(Arrays.asList(path));

 

Posted
On 5/2/2023 at 9:20 PM, Gunman said:

Maybe a logic issue? Hard to say without any code, could try playing with the distance offsets and see if that fixes it for you

Hey im still having problems if u have any ideas. Tried changing distance thresholds etc to no avail. Before using walkEvent i was using walkpath and i would walk to the following tile before reaching the first one and that fixed my problems, but i need to use walkEvent so i can use a break condition if i get attacked. 

Posted
1 hour ago, saintpaul1 said:

Hey im still having problems if u have any ideas. Tried changing distance thresholds etc to no avail. Before using walkEvent i was using walkpath and i would walk to the following tile before reaching the first one and that fixed my problems, but i need to use walkEvent so i can use a break condition if i get attacked. 

What is the atPath boolean?

Posted (edited)

Sorry i just typed that in but basically i return when my player is at an Area. atPath should be : destinationArea.contains(myPlayer())

edit: im going to try create a new path see if it helps, ill report back :)

return destinationArea.contains(myPlayer())

Area destinationArea = new Area(3142, 10245, 3278, 10050);
Edited by saintpaul1

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...