[request] keyboard and mouse plugins

  • Why the Mouse and the Keyboard plugins have no "activate" and "deactivate" controls, or something like this ... ?

    For example , if I want to add an action that looks like this: "Set Keyboard Deactivated" ... or "Set Mouse Deactivated/Activated".

    Ashley This is a must in C2, and will save a lot of work in certain conditions.

  • Bring all the key and mouse conditions in event groups. Then system action:

    Set group active

    Set an event group active or inactive. None of the events in an inactive group run until it is activated again. The event group is identified by its name.

    I know that it is a workarround in youre eyes. But its elegant and it works perfect.

  • On any key, activate keyboard.

    Whares the any key?

  • newt - is that a simpson's joke? or a you asking where the action is?

    the idea with using a group is you would put all keyboard related control events in there, then deactivate it at start

    then use the "on any key pressed' action -> enable group "keyboard controls"

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Right, and if there was a way to disable keyboard input, you would have no way to enable it using the same method.

    Not even with the "any" key.

  • newt

    Designer could use other events like wait signal (for example, waiting the cut-scene finished) then enable keyboard events.

  • Here's an example of an platformer that I am working on:

    The player has different weapons that can select. I've made a global variable called "Available Weapons" (type: number) and assigned different actions from 0 to 6, because I want the player as he progress in the game to have the other weapons unlocked. In this game the player can teleport, and when he does that he is invisible for 2 seconds. In this interval of time I want to disable the mouse and keyboard so he can't shoot while is invisible. So to do that , I have to create a function with sub events for each number of the "Available Weapons" global variable with checks ... With a "Enable/Disable Mouse/Keyboard" action this would be a lot easier.

    https://www.dropbox.com/s/9nq15ra64yj97 ... t.jpg?dl=0

  • This is straightforward to do with events, I don't see why it needs its own specific feature? You could just put all your input events in a group, and disable the group. Or check a global variable like you're already doing.

  • You are right, but if I want to add more things to my game this can turn to be more complicated. And why do we have to make groups and add lots of events and actions when we could do this in a single line? This plugins should make our life easier, let's complete them and they will bring us only benefits.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)