Jump to content

How do I create PolygonArea?


Recommended Posts

Posted (edited)
public PolygonArea test = new PolygonArea();

this is as far as i got. would be really cool to use some polygons instead of the boring old area boxes i'm using right now. also if anyone knows how to detect when the player is stunned (for thieving release) and how to tell which gyr falcon is mine (detecting the yellow arrow above it, for a hunter release)

 

edit: just incase it's unclear i want to add points to make a polygon not just declare it like i've already done.

Edited by shiny greninja
Posted

use any of the following parameters:

 

b4828e6997.png

 

So:

 

PolygonArea poly = new PolygonArea(new Position[] {new Position(1,1,0), new Position(1,1,0), new Position(1,1,0)});

 

 

change the positions and add more etc tongue.png

thanks this is exactly what i was looking for :D i'm still new to osbot's api. it's almost identical to others but some things are done slightly differently. this was one of them. thanks again!

 

just do

Area area = new Area(new Position[] {add your positions here});

or you can make the position array a variable and do it that way

thanks for the fast reply! 2 different reputable responses, now i can't decide which one to use. i could use both since there's 2 different polygons in the location i'm finishing (for dat rooftop script haha)

Posted

For stun detection there is probably a config variable. But if you don't want to go into that, you can simply check the height of your players model (the stun particles become part of the player model, I assume).

Something like myPlayer().getModelHeight() > defaultHeight.

 

You'll have to check what the default model height is for your player while it's not stunned. This may differ depending on hair/helm, though.

Alternatively, check the verticecount on the model.

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