Search Unity

PlayMaker Actions for cInput

Discussion in 'Assets and Asset Store' started by devandart, Jan 15, 2015.

  1. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
    Hi,

    I created a package of actions for PlayMaker that integrates the most (if not all) cInput functions.

    To use this package you will need the PlayMaker and cInput assets.

    The Asset is available here.

    Workflow
    1. Add PlayMaker
    2. Add cInput
    3. Add these package
    4. Use almost all cInput Functions in PlayMaker

    Screenshots:
    d1185819-6f0e-4eae-82ec-bc688f1a5ab6_scaled.jpg

    Wait for a "Double Key" in a defined time to run for e.g.
    8f74a21e-b2c1-4e52-81ff-76bbd814eaeb_scaled.jpg

    Get the control key text for a specific action
    7855a340-1c39-4ca5-97af-56d2760c25b2_scaled.jpg
    Get the axis value of a specific axis
    f07b361b-9e25-418b-ae27-4edb1714f427_scaled.jpg

    I hope some of you will find it useful and like it.
    If you have any questions or requests, let me know! :)

    Thank you.
     
    XCO likes this.
  2. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
    There is no specific manual for the actions, there are demo scenes but the GUI thing is not included, yet.
    I think the simplest way to show the UI is to add a "Call Method" action into your PlayMaker state.
    Then search for cGUI in the Project Explorer and drag that script into the Behaviour slot.
    Then paste "ToggleGUI" (without quotes) into the Method Name field and you should be able to enable/disable the cGUI menu.

    Let me know if that helps. :)

    Reference for the Call Method action: https://hutonggames.fogbugz.com/default.asp?W1139
     
  3. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
    These are not errors but warnings about the line endings in the scripts.
    Are you developing on OSX? That could be the reason + that I am developing in Visual Studio, not Mono Develop.
    Will see, how to fix that.
     
  4. justifun

    justifun

    Joined:
    Apr 2, 2013
    Posts:
    22
    2 questions....

    I'm trying to figure out how to use the axis actions.

    On the key setup state, i have a cInput Set Axis action
    Axis Name: JoyX
    Negative Input: Xbox1LStickRight
    Positive Input: Xbox1RStickLeft

    and the same setup for the Y axis

    However in the state that uses those inputs i have
    Cinput Get Axis
    Axis Name: JoyX
    store axis value: InputX

    but playmaker is giving me an error saying "Couldn't find an axis match for JoyX. Is it possible you typed it wrong?

    am i using these actions correctly?


    My second question is to find the optimal way to deal with 4 players easily. I'd like to setup one FSM that initiates the controls for the xbox controller, but then intelligently assigns the correct controls to each of the 4 xbox controllers.

    Can you think of a solution off the top of your head? Do i have to brute force assign all buttons for each controller at startup?

    I was playing around with creating using the build string playmaker action to make variables such as "Joystick"+player number+ButtonNumber+Button Variable to loop through and assign all button commands to the proper joystick inputs.

    eg: Joystick+"1"+Button+"0" etc then feed those into the Set Key/Axis actions.

    Unless you know a better way.

    Thanks!
     
  5. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
    Hi,

    the documentation of cInput says, that you have to setup an axis out of two inputs you defined with SetKey.
    Otherwise you get this exceptions (from cInput).

    Here is an example how to set it up:
    cInputSetupAxis.PNG

    For your multiplayer question I don't have an idea for a better solution at the moment, sorry.

    Cheers
     
  6. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
    Version 1.1 is now available.

    Added:

    - ToggleGUI Action
    - GetAxisDeadZone Action
    - GetAxisGravity Action
    - GetAxisSensitivity Action
    - SetAxisInverted Action
    - ResetInputs Action
    - New example scenes
    Modified:
    - Added all parameters to ChangeKey Action
    - Added "return blank" option to GetText Action
     
  7. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
    Hi guys,

    to let you know I made a little mistake and uploaded a not correctly working GetKey Action.
    The correct version (1.1.1) is already in submission.

    As a small compensation I added a new action called GetKeySequence.
    You can set a sequence of cInput actions you set before and the action handles if the user input sequence was right or wrong.
    Cool for codes or cheats.
    You can also store the missing key count and the next key that is expected.
    Hope you like it!

    Example scene is included for sure:
    cInputActionGetKeySequence.PNG
     
  8. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
  9. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
    Version 1.2 is now available on store!

    Added:
    - First Steps PDF document
    - Tooltips to all actions to explain shortly what it does

    Removed:
    - GetResetInputs, because ResetInputs is the same action and it was a duplicate

    Fixed:
    - ChangeKey finishes now when pressing Escape because otherwise it gets stucked
    - ChangeKey didn't work with xbox controller, now it works

    http://u3d.as/b7b
     
  10. devandart

    devandart

    Joined:
    Jun 7, 2013
    Posts:
    144
    Version 1.3 is now available on store!

    Added:
    - cInputGetButtonStates
    - cInputGetKeyStates

    Both of them are additions the to GetKey/GetButton actions. They don't call events but store the state values into FSM Variables.

    Fixed:
    - added cInputClear Tooltip description

    http://u3d.as/b7b