Action groups #10964
pixel-boy
started this conversation in
Engine Core
Action groups
#10964
Replies: 1 comment
-
You can actually create actions with slashes in them in code, I'm not sure why you can't from the menu. Maybe the UI could be overhauled, to show the actions with slashes in them as folders? That way, you wouldn't need the "show built-in actions" toggle since they'd just be folded |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The idea would be to be able to group actions with a name id:
It could be written like this in gdscript:
if Input.is_action_pressed("player_1/move_left"):
Built-in actions could be put into the global group, and could be written directly:"ui_left" (and not "global/ui_left") to keep the simplicity of the current system and not break compatibility, they probably cannot be duplicated/inherited.
In green the groups "player_1" and "player_2" would always have the same actions, but different InputEvents associated.
Why
I have created several local multiplayer games and I never use the action interface because it is too tedious for that, let's imagine a game playable by 4 players, where each player has all these actions:
"move_left"
"move_right"
"move_up"
"move_down"
"jump"
"attack"
"special"
"pause"
Currently this means manually creating 32 actions, every time this list changes, the change must be applied 4 times
I ended up creating a system based on custom resources which gets around the problem quite well but I would like to be able to benefit from the Godot interface for that.
More generally it could allow to separate the actions for controllable elements of a game (ui, character, vehicle etc...), and make the interface a bit more organized for games that have a lot of actions.
Features
Being able to add variations of a group (as shown in the mockup) would avoid having to create the actions manually for the different players, and to be able to edit them without having to modify the 4 players individually.
The ability to change the device associated with all the actions of a group for gamepads would also be useful because in the majority of cases the gamepad controls are the same from one player to another and the only change is the device.
Allowing to move an action from one group to another could be useful.
Being able to save and load them could be handy to make them more reusable, the option to save actions is already under discussion here #423 with a group system it would allow to save actions in a more reusable way maybe ?
Implementation
The biggest part of the work would probably be adapting the action interface to allow creating and editing the groups.
Beta Was this translation helpful? Give feedback.
All reactions