Page 1 of 1

Request Player.can_reach_for_build

Posted: Tue Mar 07, 2017 11:07 am
by Nexela
LuaPlayer::can_reach_for_build(position) -- Returns true if the player can reach this position for building as if the player tried to build it from cursor.

Currently there is no reliable way to get the build distance and Player.can_reach_entity returns true on ghosts no matter what the build distance is.

Re: Request Player.can_reach_for_build

Posted: Tue Mar 07, 2017 7:26 pm
by Rseding91
The player can always build ghosts at any distance... and can always reach ghosts at any distance to deconstruct them.

Re: Request Player.can_reach_for_build

Posted: Tue Mar 07, 2017 9:58 pm
by Nexela
Rseding91 wrote:The player can always build ghosts at any distance... and can always reach ghosts at any distance to deconstruct them.
Correct. Which is why I would like a way to find the build_distance for reviving ghosts via script as long as they are inside the players build range.

Re: Request Player.can_reach_for_build

Posted: Tue Mar 07, 2017 10:54 pm
by Klonan
Nexela wrote:
Rseding91 wrote:The player can always build ghosts at any distance... and can always reach ghosts at any distance to deconstruct them.
Correct. Which is why I would like a way to find the build_distance for reviving ghosts via script as long as they are inside the players build range.
So maybe access to these player prototype values would solve this:

Code: Select all

    build_distance = 6,
    drop_item_distance = 6,
    reach_distance = 6,
    item_pickup_distance = 1,
    loot_pickup_distance = 2,
    reach_resource_distance = 2.7,
Then you can just calculate the players reach distance and see if the distance to the position is less than this distance

Re: Request Player.can_reach_for_build

Posted: Tue Mar 07, 2017 11:31 pm
by Nexela
That would work also and allow for even more flexibility.

Re: Request Player.can_reach_for_build

Posted: Wed Mar 08, 2017 1:08 am
by Rseding91
I added the ability to read the different reach distances off the character runtime. Reading it off the character includes the force based bonus as well as the character based bonus.