Jump to content

Issues with path walking


TheGreatests

Recommended Posts

Ive tried alot of things so I decided to try just walking the path.

 

here is my set up, exactly like how it was posted in the tutorials however. I am getting a erro

 

    private Position[] path = {
                new Position(3183, 3431, 0),
                new Position(3177, 3429, 0),
                new Position(3171, 3426, 0),
                new Position(3172, 3416, 0),
                new Position(3171, 3404, 0),
                new Position(3173, 3395, 0),
                new Position(3177, 3388, 0),
                new Position(3179, 3381, 0),
                new Position(3182, 3375, 0)
        };

 

Then using getWalking().walkPath(path);

 

But its wanting me to change it to .walk, and then when I change it to walk. it wants me to do other stupid shit.

 

any help?

Link to comment
Share on other sites

It's asking for a list.

	List<Position> path = Arrays.asList(
		new Position(3183, 3431, 0),
		new Position(3177, 3429, 0),
		new Position(3171, 3426, 0),
		new Position(3172, 3416, 0),
		new Position(3171, 3404, 0),
		new Position(3173, 3395, 0),
		new Position(3177, 3388, 0),
		new Position(3179, 3381, 0),
		new Position(3182, 3375, 0)	
	);

  • Like 3
Link to comment
Share on other sites

Ive tried alot of things so I decided to try just walking the path.

 

here is my set up, exactly like how it was posted in the tutorials however. I am getting a erro

 

    private Position[] path = {

                new Position(3183, 3431, 0),

                new Position(3177, 3429, 0),

                new Position(3171, 3426, 0),

                new Position(3172, 3416, 0),

                new Position(3171, 3404, 0),

                new Position(3173, 3395, 0),

                new Position(3177, 3388, 0),

                new Position(3179, 3381, 0),

                new Position(3182, 3375, 0)

        };

 

Then using getWalking().walkPath(path);

 

But its wanting me to change it to .walk, and then when I change it to walk. it wants me to do other stupid shit.

 

any help?

 

As was mentioned above, you've defined it as an array, which is what the API path walking used to take (hence the outdated tutorials tell you to do it this way). Instead, you need to define it as a list.

  • Like 1
Link to comment
Share on other sites

Well what I am looking to do is calculate that if surrounding players is more then 3, to either hop or move to the next rock...

int Tomuch = 3;

 

 

the thing is, I cant do <=, or >=

 

    for (Player player : getPlayers().getAll()) {  ///////Calculating players around
                    if(player.equals(Tomuch)){
                        //hop

//walktootherrock
                    }
                }


Could I use this??

 

for (Player player : getPlayers().getAll()) {  ///////Calculating players around
                    if(player.getIndex() <=2){
                        //do something
                    }
                }

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...