Frictional Games Forum (read-only)
Questions I have - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: SOMA (https://www.frictionalgames.com/forum/forum-55.html)
+--- Forum: User created content (https://www.frictionalgames.com/forum/forum-79.html)
+---- Forum: Technical Support (https://www.frictionalgames.com/forum/forum-80.html)
+---- Thread: Questions I have (/thread-30896.html)

Pages: 1 2


RE: Questions I have - Aaron - 09-25-2015

The eAction_Test commands are just for debugging, for firing off functions so that you don't have to replay the whole level to trigger certain events. They are only linked to keyboard numbers 0-9.


RE: Questions I have - Rapture - 09-25-2015

Do you know what the function is called for grabbing the Keyboard/Mouse input?


RE: Questions I have - Aaron - 09-25-2015

Afraid not, just a lowly artist Sad. Perhaps a scripter can pop their heads in!


RE: Questions I have - Patrik - 09-26-2015

(09-25-2015, 08:59 PM)Rapture Wrote: Do you know what the function is called for grabbing the Keyboard/Mouse input?

You should be able to get by with using the OnAction callback that's called in levels, modules, player states and probably other things as well. You can also use the cInput_* functions for directly checking an eAction from anywhere in the code.

Code:
cInput_BecameTriggered(eAction_Jump)

You can set up your own eActions in InputHandler.hps and InputHandler_Types.hps if you need something not already defined.

That's the recommended way of doing things and the only way we do it in all of SOMA, but I think you can also do cInput_GetKeyboard()/cInput_GetMouse() to get direct access if you really want to. Something like:

Code:
cInput_GetKeyboard().KeyIsDown(eKey_Space)

Haven't tried it myself though and will quickly get complicated if you want to rebind keys or allow gamepad use.


RE: Questions I have - Rapture - 09-26-2015

To get the Debug 1-9 to work.


Is their something special you need to do, to get them to work? I am in DebugMode, but pressing 1 doesn't seem to do anything.

Code:
    void OnAction(int alAction, bool abPressed)
    {
      if (!abPressed) return;
    
      if (alAction == eAction_Test1)
     {
      Entity_SetActive("construct_theta_1", false);
      cLux_AddDebugMessage("Hi");    
     }
    }