ThomasP's Forum Posts

  • So you're using layers to differentiate between different levels of your game instead of layouts? How are you using the word level when you say "level one or level two" in your first post? Like Mario Bros. where you go from level to level, or like a building where each floor or story would be a level? If you need to switch back and forth quickly between the different levels, I could see using layers, but otherwise I'd recommend using layouts.

  • Hahaha, well, this question reminded me of one asked in another thread, so I went to go find that thread and it turns out it was yours, Ximon, and the answer in there didn't explain how to do so. Hopefully LittleStain sees this thread and is able to answer specifically how to do so, since I'm curious as well.

  • I don't have Construct 2 in front of me, so I don't know if you can disable entire event sheets, but you can put the events in a Group and then disable or enable the group as you want. You could have each fighter in their own Group, have them all disabled, then when a fighter is picked, that fighter's Group is enabled.

  • Isn't pick Nth instance what the tutorial I linked with solution 3 showing? This is the internet, so I feel it necessary to point out that this is a serious question and I'm not trying to be a sarcastic jerk. I may be misreading the tutorial, which would certainly not be the first time for that.

  • This tutorial should help and doesn't require a duplicate family: https://www.scirra.com/tutorials/556/un ... o-families

    Solution 3 should be what you're looking for.

  • You can have System Spawn Object at position, then for the X and Y coordinates, use random(0, layout.width) and random(0, layout.height).

  • You don't restart the layout, you simply make the layer invisible when the menu isn't open and then visible when it is. It doesn't require changing layouts at all except that initial load to pull the objects on the layer in.

  • As for the second question, are you talking about something like a global UI or menu system that can be used on multiple layouts? Here's a good tutorial for one of those: https://www.scirra.com/tutorials/594/bu ... terface-ui

  • Event sheets have layers? I thought only layouts have layers.

  • You can add a sub event to the function to choose that IID, but I don't think choosing something by IID is available as an action.

  • Great graphics, I'll be coming out to check this out with more content. Keep up the good work!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Do the cannonballs spawn far enough away from the cannon so the sprites aren't touching when it spawns initially?

    What is happening when you get that error, or does that pop up as soon as you hit the play button?

  • I should mention that I set the x and y to be slightly on the side of next level's exit object, to avoid the infinite teleporting. But I suppose it's actually more versatile to have a destination object ( like you do) instead of setting the x and y. That way if you change the level you don't have change the coordinates in a lot of places, but rather just move the object.

    Yeah, that versatility and making level-building easy was what I was going for, but if I can't get that to work, at least your method works!

    Although, you could probably set something up so that when the layout loads, or on start of layout, each exit variable is set to whatever the sprite's X and Y coordinates are, so it is automated like my method but thorough enough to work like your method...

    EDIT: Ignore the preceding paragraph because I'm an idiot.

    Also, I got it to work using mindragon73's method, but adding a variable called ExitAvailable that is made false on start of layout, and then made true once the player is no longer overlapping an exit sprite. Thanks everybody!

  • Hi!

    I´m actually trying to do the same thing, and what I´ve done and which seems to work ok so far (even if I´m sure there is a smarter way of doing it), is something like this (pretty close to what you have done)

    I have two global variables: DestinationX and DestinationY

    I have an "Exit Sprite" with three instance variables: nextX, nextY and NextLayout.

    I place the sprite where I want an exit to be.

    Then I set the variables in that sprite instance to where I want the player to "teleport" to.

    Then I have an event saying something like (if I recall correctly):

    Player -On collision with ExitSprite -> set DestinationX to ExitSprite.NextX

    -> set DestinationY to ExitSprite.NextY

    -> go to Layout(ExitSprite.NextLayout)

    And on each layout I have an event saying:

    On start of layout->create player at DestinationX, DestinationY

    Also, I noticed that I had to have the player sprites (I have a hitbox, a "movebox" and the actual animated sprite) on a separate layout not used in the game to avoid duplicate players to spawn in the layouts.

    So you're recording the X and Y coordinates of the destination and just sending the sprite there instead of onto an object? I'll give that a shot when I get home, thanks. I have had the duplicate players issue, so I'll move them all do a separate layer also. Thank you!

  • As you have the events, when you go to a different layout from Layout1, you have not recorded where you came from, so on the next layout you try to create an object at Exit.LeadsTo where neither LeadsTo equals the previous layout's name. You could use On End of Layout and store the current layout's name in a variable, then compare that variable to the Exit.LeadsTo in the create function. There's another problem you will encounter when you fix that issue - when you create a player on top of an exit, the on collision trigger will fire and you'll end up travelling to a different room, only for the player to be created on top of an exit again, and so on, every tick...

    I actually have a CurrentLevel which holds where the player left from and an EnteringLevel (both global variables), and the Exit.LeadsTo is supposed to match the CurrentLevel, which the player just left. I can't check the capx right now, so I'm not sure if that is showing that. I did run into the problem you described once and it kept bouncing me back and forth between two layouts. I didn't know what was happening, so thank you for that explanation, it makes perfect sense!