Jump to content

Issues with path walking


Recommended Posts

Posted

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?

Posted

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
Posted

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
Posted

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

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