Page 1 of 1

New input_action : Possibility of allow/forbid usage of hand ghosting

Posted: Mon Dec 27, 2021 9:06 am
by Masamune00
Hello,

It would be nice to have an input_action added that can allow or forbid hand-ghosting (shift click with a building in hand).


I have not seen an input_action that can change that, there are lot of permissions with blueprint (copy, paste and so on) but it is just this case of hand-ghosting missing :
https://lua-api.factorio.com/latest/def ... put_action
On some scenario, we like to restrict what some users can do, hence the need of this new permission, currently we are using "on_built_entity" as a workaround but we will like to use a permission instead.

Thanks you for your time !
Regards,
Masamune00

Re: New input_action : Possibility of allow/forbid usage of hand ghosting

Posted: Mon Dec 27, 2021 9:20 am
by boskid
There may be slight misunderstanding here. In order for factorio to work in multiplayer, literally everything a player can do has a related input action because those input actions are messages which are sent to the server which distributes it to other clients so they can correctly simulate the game state taking into account what every player did. That means if a player is building ghosts this is still going through InputAction::Build, but that input action simply has quite a lot of parameters inside (position, direction, created by moving, allow belt power replace, shift build, skip fog of war, blueprint flip, smart belt building). Its unlikely there would ever be a input action permissions system that would allow to filter input actions based on their parameters. In 1.1.x there is also a limit of how many different input actions can be defined, limit is 256 and there are 245 input actions right now. Multiplying input actions by their specific parameters also is not an option right now.

Re: New input_action : Possibility of allow/forbid usage of hand ghosting

Posted: Mon Dec 27, 2021 6:33 pm
by Masamune00
Thanks you for your time and answer ! I understand that it's very unlikely to be added, then we shall continue using on_built_entity event instead, which works still but I would have liked more to avoid using that.

I think permission is prob less intensive than doing all kind of checks on built_entity, but maybe it's a wrong worry and maybe it just takes 1ns to do this check... so even like with 40 players building, maybe it doesn't matter..?