Jump to content

WalkingEvent does not walk very well?


saintpaul1

Recommended Posts

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
Link to comment
Share on other sites

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));

 

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

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