Can't change layouts?

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Simply said, I can't use anything regarding layout changing-- next, previous, jump to-- none are working in my game. They work fine in a new .cap, but not the one I'm actually using.

    I have it set that when you press control "Start" it moves to the next layout. Except it doesn't do anything. I tried in another frame and it didn't work there either.

    Am I overlooking something or is my .cap broken? (Hopefully not the latter, I don't want to have to do all I've done over again...)

  • Make sure the event actually passes, i.e. it actually checks for control 'Start'. Make an event that displays the big text "TEST" in middle of screen when you click Start. That way you'll know it is working properly.

    If not, double-check check the triggering event itself.

  • If the above doesn't yield anything, but it on the bug tracker. You can mark the bug private if you don't want anyone else seeing the .cap file.

  • Good thought. It's not figuring out that I'm pressing a button.

    That's odd, because in the game frame I use input a lot.

    Might this be an issue caused by me making a Mouse/Keyboard object global? I did so because I'd add one per frame and it would give me MouseKeyboard, MouseKeyboard2, etc. and I didn't want that...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • MouseKeyboard should always be made global for that very reason. Maybe you still have some duplicates of the object? There should be one MouseKeyboard object only, the global one.

  • I think I may just have confused Construct?

    Basically, there never WAS a MouseKeyboard in this layout I'm working with. But it was made before the second layout, in which I added a MouseKeyboard and made it global. Does the first layout just not know that MouseKeyboard was made global? (It doesn't appear at all in the object list for that layout)

  • You should put an instance of the mouse and keyboard object in every layout, even though it's global, so each layout can work with it.

  • In theory that should work, but when I go to add a MouseKeyboard to the layout it assumes I want a brand-new one. As in, not the global one...

  • Bumping because I'm not sure that my final post here has been seen, and I'm rather in need of a solution.

    As I've said, despite the fact that I should put a MouseKeyboard in every frame, the issue now is that it will not let me place the global one in any new frames. I can only get it to place new, numbered ones. Is there some special way this is done?

  • You shouldn't have to place a new M&K object in any frames if you have a global one you want to use.

    Also, you shouldn't have to place the global one either. It should just already be available for use from the event sheet editor.

  • You can place a global object on the first layout and use it anywhere. In the next build, a bug with "run layout" where it would not create these global objects is fixed.

  • I think it's all messed up. Which is unfortunate, because if there's no solution then I'll have to figure out how to transfer all my code to a new .cap and I've noticed that copying events between .caps usually doesn't work.

    But shouldn't I have to place a MouseKeyboard somewhere in the game initially in order to make it global? I can't just go and start a new application and see the MouseKeyboard already available to use-- I just tried it.

    Unless you meant after the inital placement, in which case I don't think the object realizes it's global. Because it will not function in any layout in which I can't see it in the object list in the layout editor. And I don't except in my initial gameplay frame I made and placed the MouseKeyboard object in to start.

    update: ok I was about to post this and another reply popped up, which I'll now cover.

    It's not really a problem with "run layout" because it doesn't do anything in "run all" either.

    Now is the issue that I placed my global MouseKeyboard in the second layout of the app to start? I had been messing around and didn't need the keyboard input yet, so I didn't place it, but then did and made it global in the second layout where the game is.

  • You should put it on the first layout because

    • the next build's Run Layout option creates global objects only from the first layout so it'll only work this way
    • a global object placed on layout 2 does not exist until you visit layout 2 for the first time. ie. events using that object in layout 1 won't work, because the object is not yet created.
  • OK then. I'll just have to place a new global one in the first layout and redo the events to point to it, then delete the other.

    This should probably be clarified somewhere in the documentation so nobody else makes such a mistake. I didn't see anything about it.

    Thanks for your help!

  • You could copy and paste the object from the second layout to the first layout, then delete the original, using the object bar. Same events, and object is on first layout

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