How do I save the player's location as in an RPG.

0 favourites
From the Asset Store
Players follower. use it for anything which follows the player
  • Can't help without seeing your project event sheet.

  • 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 ...

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • 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.

  • 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.

  • 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.

  • 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.

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

  • 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.

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

  • 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.

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