In this screenshot, I placed a ghost far away and ran a console command to check. The expected behavior (for something over 10 tiles away) is to return false. I also tested character.can_reach_entity().
http://imgur.com/a/wWmQx
[0.15.6] player.can_reach_entity(entity_ghos) returning true
[0.15.6] player.can_reach_entity(entity_ghos) returning true
Last edited by Mylon on Wed May 03, 2017 3:15 pm, edited 1 time in total.
Re: [0.15.6] player.can_reach_entity() returning true
The character can reach ghosts at any distance - that's why you can place/mine them at any distance.
That's by design.
That's by design.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.15.6] player.can_reach_entity(entity_ghos) returning true
Rseding has added in a way for us to get the players total reach distance (prototype + modifier(s)) using this we can do a simple distance check on ghosts to see if they are reachable.
luaControl.reach_distance
build_distance :: uint [Read-only]
The build distance of this character or max uint when not a character or player connected to a character.
luaControl.reach_distance
build_distance :: uint [Read-only]
The build distance of this character or max uint when not a character or player connected to a character.
Re: [0.15.6] player.can_reach_entity(entity_ghos) returning true
I found that! build_distance is definitely new and I already wrote the latest version of Bluebuild to use it. However I'm stuck trying to figure out how to implement the builds per second as a setting.
Edit: This is what I'm using:
Not sure why I need to do (a^2 + b^2)^0.5 - 1 to match the in-game build distance, but there it is.
Edit: This is what I'm using:
Code: Select all
-- Need a fudge factor since my distance formula seems off. Game likely measures from nearest colliding point?
if distance(builder, ghost) < builder.build_distance + 1 then