Jump to content

[Walking problem] Can't execute some simple walking in this location. What can I do?


Recommended Posts

Posted

Hello guys, currently working on a script that is taking place inside of the mm II tunnels. The problem I'm having is that I simply can't make the damn char walk back n forth between 2 tiles that are next to each other. I've tested the script on other places(just swapped x,y coordinates) and it works just fine. I've tried making my own paths and aswell tried using both Positions as well as Areas. and I've also tried walk(..), webWalk(..), walkPath(..).

It's just inside these tunnels that I cant make it work.

How can I solve this?

Posted (edited)

never said I did? Just pointed out that I never had to use walkingEvent in the past and gotten away with using very simple webwalking in my previous scripts! :) not sure if I'm doing it the optimal way though but at least it works now!

WalkingEvent tile1 = new WalkingEvent(TILE_ONE);
         tile1.setOperateCamera(false);
         tile1.setEnergyThreshold(20);
         tile1.setMinDistanceThreshold(0);
         getBot().getEventExecutor().execute(tile1);

 

Edited by dot_b0T
  • Like 1
Posted
22 minutes ago, dot_b0T said:

never said I did? Just pointed out that I never had to use walkingEvent in the past and gotten away with using very simple webwalking in my previous scripts! :) not sure if I'm doing it the optimal way though but at least it works now!


WalkingEvent tile1 = new WalkingEvent(TILE_ONE);
         tile1.setOperateCamera(false);
         tile1.setEnergyThreshold(20);
         tile1.setMinDistanceThreshold(0);
         getBot().getEventExecutor().execute(tile1);

 

There is some unnecessary code in there.

Why setting OperateCamera to false? Why set an energy threshold?

This should work fine:

WalkingEvent event = new WalkingEvent(TILE_ONE);
event.setMinDistanceThreshold(0);
getBot().execute(event);

 

Posted
25 minutes ago, dot_b0T said:

never said I did? Just pointed out that I never had to use walkingEvent in the past and gotten away with using very simple webwalking in my previous scripts! :) not sure if I'm doing it the optimal way though but at least it works now!


WalkingEvent tile1 = new WalkingEvent(TILE_ONE);
         tile1.setOperateCamera(false);
         tile1.setEnergyThreshold(20);
         tile1.setMinDistanceThreshold(0);
         getBot().getEventExecutor().execute(tile1);

 

3

we have a execute() method

execute(Event event);

execute(tile1);

 

2 minutes ago, The Undefeated said:

There is some unnecessary code in there.

Why setting OperateCamera to false? Why set an energy threshold?

This should work fine:


WalkingEvent event = new WalkingEvent(TILE_ONE);
event.setMinDistanceThreshold(0);
getBot().execute(event);

 

maybe he doesnt want it to move the camera?

what if he wants it to start running @ 20 run?

Posted
1 hour ago, The Undefeated said:

He said ithas to walk 2 tiles, why bother adding code like that for 2 tiles?

it is moving diagonally around a corner, which means it travels past another square so it has time to start running in-game, and since this action is repeated a lot i wanted to manage the run energy somewhat so that's why I have that added in there! Also i prefer to have full control over the camera. for this script it wouldn't make a lot of sense to have the camera move much. so I just handled the few camera actions I needed manually. :peanut:

Posted
5 hours ago, Alek said:

WalkingEvent will do that, however that solution also works. 

yep worked fine using walkingEvent

6 hours ago, IDontEB said:

Why not just use MainScreenTileDestinations and just click the tile since it's only two squares away?

I found out about that method while I was looking around, from what I understand it works best when there are no items and npcs covering the tile? since your just sending a mouse click with that. not sure though :D

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