Banatawa's Forum Posts

  • There is something else wrong with your code or layouts then

    If so, I think it comes from the player's move. I put him an 8-directions. I should correct that one day, it does not fit my project. The character undergoes an acceleration and does not stop instantly.

    But hey, one problem at a time.

    I'll take care of that at the end.

  • I don't think you need Solid. It's changing to "On Collision" event that fixed it.

    I can confirm you need it, I tried without it and the problem was back.

  • Forget what I just said, I just re-checked and put the "solid" behavior to the wrong object. Thank you very much for your help, I will be able to advance in the development of my game.

    So...

    For the people who came on this topic to solve the same problem as me, you just have to do as on the screen below.

    S_Entrée_01 = The object that will allow you to go from one layout to another.

    "ruins_meet_flowey" = The next layout.

    It will also put the behavior "solid" on the object (for me it's for "S_Entrée_01).

    You have to put the behavior "presist" on the player sprite too.

    I create a S_Entrée_n ° for each entry or exit. You, do it as you feel.

  • You are using on overlapping. If you persist, it saves the location so once you go back to your first layout, you are still overlapping.

    Change it to on collide instead, with Trigger Once.

    Welp, I did as you told me, it gave me the same effect.

    So I added the behavior "solid" to "S_entrée". Result, I can enter the map, come out, for cons I can not enter. The map is displayed for a short time but I come back to the previous one. In my opinion the collision always activates the event.

  • Do you have S_Entrée_01 sprite on the second layout?

    C2 runs only one layout at a time and two events can't be triggered if there is no S_Entrée_01 sprite on the layout.

    I suggest you run your game in Design Mode and check everything thoroughly.

    If you still can't fix it, please share your .capx file

    It's not really about both at the same time, but what I mean is that the player is on a layout1 event1 that teleports it on layout 2. But to get out of layout2, you have to go to an event2 that teleports the player to layout1. As the player has the behavior "persist", it appears on the event1 layout1 which leads to the event2 layout2 which leads to the event1 layout1 ... All this without ever stop. But I would like to stop it as simply as possible.

  • Banatawa

    Run your game in Debug mode (Ctrl-F4) and check how many character instances you have on each layout.

    Also you will be able to see where each character is.

    It is possible that your character gets duplicated because you set it as Global. If this is the case, remove character sprite from the second layout.

    I disabled the global property to be able to put the "Persist" behavior.

    There my problem is that my character is on both events at once, I explained in my previous answer.

    Now, I would like to have a trick to prevent that without complicating things.

  • oosyrag

    Hmm, maybe I should explain.

    When the player goes to the sprite "S_Entrée_01" he goes to the next layout.

    But...

    When the player goes on the sprite "S_Entrée_02" which is on the second layout, it arrives directly on the sprite "S_Entrée_01" of the first layout which brings it on the other layout and so on ...

  • Can't help without seeing your project event sheet.

  • Do you mean you want him to be back at the same spot when you return to the layout a second time? Then you want to add the "persist" behavior.

    Thank you, I think it works.

    Yes ... "I think" because as the character now activates both events at the same time, I see a beautiful bug that swaps the two layouts without stopping. Would you have a trick to prevent this? I have the annoying tendency to complicate things while they can be easily solved.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry having a little trouble understanding because of translation I think.

    Do you have the "Scroll To" behavior on the player?

    When you change layout, you'll have to position the player where you want with an On Start Of Layout event.

    Yes the player has the behavior "scroll to".

    But if I position the player with an "On start of layout", his position will not be recorded, I'm wrong?

  • Yeah...

    I put an Trigger once and I feel like playing on both maps at the same time ... It's ... very weird ...

  • If it's the fault, how can I fix it?

    I'm a little tired, I have no solution right now ...

  • I created sprites "Action" which in contact with the player, makes it go on another layout without destroying the object ...

    Is this the mistake?

  • Try using the Global property set to Yes.

    Global

    By default, all instances are destroyed when the layout ends (e.g. when going to the next layout). If Global is Yes, none of the instances of this object type will be destroyed when switching layouts.

    Use on start of layout to adjust position if needed.

    How to say...

    When I launch the layout, everything is fine. I'm going to the next map ...

    The, the camera goes I do not know where, I do not see the character ... I go down to access the previous map, and there, there is no more character. I can move the camera that looks downright elsewhere, but I do not see the character.

    In the preview :

    In construct 2 :

  • It's good, I could find what you were talking about.

    I'll try that tomorrow, thanks for your answer