Jump to content

Recommended Posts

As in; when I do GetEntityAtPoint(x, y, z)  (or something like that)  what determines how close the coordinates have to be to an entity actually detect that entity?

 

Currently, the detection radius feels pretty big. I can be fairly far off from the entity and the game will still pick it up. from like 1 or 2 units away.

 

Is it because the entity's defined "size" is really big, or because the entity detection radius is really big?

 

What exactly determines the "size" of an entity? is there a set size for every entity? Is it determined by the physics hitbox set for the prefab? (it sure doesn't feel like it. shrinking the physics hitbox doesn't seem to do much).  Is it determined by the sprite sizes?

 

Or is an entity actually only a single point, and the GetEntityAtPointwhatever has a very large detection radius? Is there a way to change the detection radius?

 

Is there a way to change the entity's size? Or hitbox or whatever it's called? To make the detection more precise? 

 

I've got all the weird questions, I just can't find any answers.

 

I think it's the thing you can see when pressing backspace after spawning or selecting an entity using the console.

 

EDIT: Alternatively, maybe look into physic shapes?

Edited by Mobbstar

You could bypass this by specifying the radius, using TheSim:FindEntities(x, y, z, radius).

 

Ahh, yes this is exactly what I was looking for!

 

So, from my testing, it turns out that entities are defined as a single point. (and I had my search radius set to 3 without realizing it, which is why it felt so big. oops) So thats good.

 

But is there still a way to increase the defined size of the entity? I'm guessing there isn't, but you never know.

 

Or even better, is there a way to search for something like the entity's physics hitbox instead? 

 

 

Currently, the only other "FindWhatever" functions I see in the pastebin site for the don't starve api are FindLandNextToWater (very useful for kaji) FindFlower and FindLight.

I think it's the thing you can see when pressing backspace after spawning or selecting an entity using the console.

 

EDIT: Alternatively, maybe look into physic shapes?

 

Wooaaa, I had no idea backspace showed all that stuff. That's very usefull.

 

Is there any way to get that information to show up for entities? Or is it hard coded into the game that way?

 

 

 

I've also already looked at physics shapes. But increasing and decreasing their size doesn't change the detection. Theres only two, or at least there are only two used in the games code. Spheres and capsules. 

I wonder if there are other shapes available that just aren't used in the game's code

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
×
  • Create New...