Keyboard Input Question (resolved)

  • #1, by HelixAbyssSunday, 17. January 2016, 23:06 9 years ago
    Hi all, so I finally have a question that I haven't been able to figure out an answer to. So, in my game the main character has these special abilities that can be used in specific places. There are six different stones and the player can choose one, they each give a different "category" of powers and the specific thing that they do is based on the scenario. There are "primary" and "secondary" powers, so there are two keys that can activate a power. In general, when the associated keys are pressed an animation plays and the primary power will attack nearby enemies. The animation part was easy enough to setup, and attacking enemies is a problem for another time. However, when the character is standing in certain areas where there is an object that can be affected, pressing one of the keys should do something specific to that object. So, for example, in one of the scenes there is a crate, and if the character has the light blue stone she can use her power to break the crate. I have action areas setup where the character has to stand to use these powers, so there's one for the crate, one for the lever, etc. But I have no idea how to get this working since the only place it appears keys can be given actions is in the general game tab.

    Does anyone have any ideas of things I can try? And please let me know if my explanation wasn't clear enough!

    Newbie

    24 Posts


  • #2, by sebastianMonday, 18. January 2016, 00:56 9 years ago
    Hmm.. Inside the key action you have to Check if there id an affectable object inside a specific radius or if an actionarea triggered a condition.
    When using the key you have to check if this is true and activate its specific action inside the object actions.
    you could do this Via lua so that you need only to setup an action which gets triggered inside each object.

    Inside keypress action :
    - Checkradius for affectable objects (determined either by name or specific conditions)
    - create table and add each objectname which was found
    - If objecttable >0: for each object inside radius call its action to activate its effect


    Thread Captain

    2346 Posts

  • #3, by HelixAbyssMonday, 18. January 2016, 01:52 9 years ago
    Ok I think I have a pretty good idea what to do after reading what you had to say and a bunch of other topics I just read through. I'll come back if I have any issues, thanks for the help!

    Edit: I got it working!

    Newbie

    24 Posts

  • #4, by MachtnixMonday, 18. January 2016, 22:15 9 years ago
    I didn't understand all of your question... If the character enters the action area, you can set a value (or a condition) there, so you can use this value in the button area actions (game tab) to use /check the correct button you want. It should be possible without Lua.

    Thread Captain

    1097 Posts

  • #5, by HelixAbyssMonday, 18. January 2016, 22:35 9 years ago
    Hey thanks, I actually got it working last night, probably should have changed the title instead of just leaving a post haha. I'll fix that now.

    Newbie

    24 Posts