Jump to content

thieving help


ugpjosh

Recommended Posts

Could someone help me with the code needed here?

 

I used the thieving script tutorial for the tea stall and everytime it goes to click the stall it clicks about 3 times before it actually picks up the tea. When the camera moves to a certain point it makes me walk behind the stall to the person who wont let you steal from it.

 

HOW can i make it so that it wont do this and if it does happen, it identifies hes yelling at me and makes me run back to the spot out front of the stall.

Link to comment
Share on other sites

Well theres a handful of ways of doing it.

 

The simplest way for you would be to create an area around the are you dont want to stand in while attempting to steal from the tea stall:

Area DANGER_AREA = new Area(int top right x, int top right y, int bottom left x, int bottom left y);

and then just in your getState call:

if (DANGER_AREA.contains(myPlayer()))
        return State.returnToStealPos;

and in your switch statement:

        localWalker.walk(STEAL_POS);

where STEAL_POS is the position you want to steal at

 

(You can define STEAL_POS at the top like so: )

Position STEAL_POS = new Position(x,y);

I hope I made myself clear, if not just quote this post and i'll gladly help out further.

PS hope the tutorial helped! 

Link to comment
Share on other sites

Well theres a handful of ways of doing it.

 

The simplest way for you would be to create an area around the are you dont want to stand in while attempting to steal from the tea stall:

Area DANGER_AREA = new Area(int top right x, int top right y, int bottom left x, int bottom left y);

the area is bottom  left x, bottom left y, top right x, top right y

Edited by josedpay
Link to comment
Share on other sites

Well theres a handful of ways of doing it.

 

The simplest way for you would be to create an area around the are you dont want to stand in while attempting to steal from the tea stall:

Area DANGER_AREA = new Area(int top right x, int top right y, int bottom left x, int bottom left y);

and then just in your getState call:

if (DANGER_AREA.contains(myPlayer()))
        return State.returnToStealPos;

and in your switch statement:

        localWalker.walk(STEAL_POS);

where STEAL_POS is the position you want to steal at

 

(You can define STEAL_POS at the top like so: )

Position STEAL_POS = new Position(x,y);

I hope I made myself clear, if not just quote this post and i'll gladly help out further.

PS hope the tutorial helped! 

 

I'm coming up with problems with the coordinate thing. Could you Team View me?

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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