Certain Keyboard conditions not working

0 favourites
  • 12 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • I've encountered a strange bug involving keyboard conditions not working when coupled with local/instance variables. It's quite bizarre. Thankfully, due to Construct 2's ability to transfer events and objects between caps, it's MUCH easier to reproduce the problem in an isolated cap.

    Basically, the "attack" option works, but you can't exit out of the attack menu with B, and space bar doesn't work when trying to select 'item'. Mouse controls work perfectly, however... Though, in my project, at some point they stopped working entirely in that one layout. Strange.

    Example capx

    This problem was more pronounced in earlier caps, forcing me to use workarounds (such as layer visibility, which kinda has been rather useful in other ways), but at some point it became simply unfeasible to work around stuff by the point I hit the 'item' problem.

  • Thankfully, due to Construct 2's ability to transfer events and objects between caps, it's MUCH easier to reproduce the problem in an isolated cap.

    Has that been fully implemented? I thought it wasn't finished yet.

  • > Thankfully, due to Construct 2's ability to transfer events and objects between caps, it's MUCH easier to reproduce the problem in an isolated cap.

    Has that been fully implemented? I thought it wasn't finished yet.

    Oh, it works. Though, I had to copy events within the original project and remove certain conditions/actions to actually make it work with the new cap, first. But copying objects works perfectly.

  • I had a quick look, but are you aware that triggers only run if all their parent events are true too?

    For example, you have 'On B pressed' as a subevent to "Layer ItemSelection is visible". If that layer is not visible, the 'On B pressed' trigger won't fire.

    Can you reproduce an issue with triggers which are not in subevents or do you think it's just how you've set up the events?

  • Thing is, the 'On B pressed' events should be working fine. They work perfectly in my original project, that's for sure. The parent events should not be conflicting, period.

  • Should they? It's not obvious whether this is a bug in Construct 2 or a logic problem in your events. It's very difficult and time consuming for me to check the project to verify the logic of the events is indeed sound, and therefore the problem must only be a bug in Construct 2. I'll double check some time in future, but it would save tonnes of time if you could reproduce keyboard events not working in an empty project with as few events as possible.

  • That... MIGHT be a little tricky! The capx as it is, well, is more or less stripped straight down from the original project. It's hardly that much. I've stripped the whole thing down even further to what should be the most essential events for the cap to show the problem - it should be to the point where it should be easy to determine whether it's a bug or a logic problem.

  • It's still a lot for debugging - the same function is called in the engine for all the events, so diagnosing projects with more than 5 events that way gets pretty difficult. Still, if you can't get it any less than that, I can take a look some time soon.

  • Yeah, can't really strip it down any further, sorry.

    Though, I realized why the B conditions weren't firing, mainly to do with the "SelectionTimer" variable not decreasing via DeltaTime when above 0 as it should be (it does decrease in the original project), mainly to prevent key presses from skipping over menus. So THAT is not a bug, I fixed it.

    But the fact that the Space key condition doesn't fire with the Item selection is still the main problem.

  • But the fact that the Space key condition doesn't fire with the Item selection is still the main problem.

    When I try it, it seems to work fine. If I hit space on menu items 1 or 4 it appears to switch to a different menu. Is that what's supposed to happen? If not what is supposed to happen?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's strange. When I hit space on 1, it works fine, but when I hit it on 4, it doesn't work at all.

    But if it works for you... That's just odd.

    Edit: NOW IT WORKS?! Okay, now that's even more weird! The only thing I changed was add a 'SelectionTimer' condition, but... That shouldn't have... Gah, I can't think, it's way too late, I need to hit the hay. >_<

  • Have you installed a new release in the mean time? It might have been accidentally fixed :)

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