SteamInput()->DeactivateActionSetLayer( controllerHandle1, scopeHandle ) //remove the scoped-in layer when you lower the scope SteamInput()->ActivateActionSetLayer( controllerHandle1, scopeHandle ) //apply the scoped-in layer when you scope in The code for this might look something like: When the player selects a class, the appropriate layer is added, e.g. For basic gameplay, a base action set is always active and covers running around, picking up items, jumping, etc. This game has native Steam Input support and makes use of action set layers. Imagine a class-based shooter with vehicles. Additionally, in legacy mode, players can define their own action set layers and the inputs that trigger them, just as they can define their own player-triggered action sets. Your code could easily have race conditions or other subtle timing bugs that could swap the order.Īction set layers are intended for narrow use cases and a good practice is to apply and remove them only on specific game state changes.įor games with native Steam Input support, the developer can define specific action set layers activated by the game's code. The last layer applied will override any conflicting information that came before, so take special care to apply them in the correct order. Calling ActivateActionSetLayer is cheap and can be safely called repeatedly (but see callout below)Ĭareful with multiple layers!Just because you can re-apply action set layers every frame doesn't mean you should, especially if you're using more than one layer.Deactivating an action set layer, and then activating it, will set it to the top of the stack.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |