Teleport between layouts

0 favourites
  • 10 posts
  • Hello!

    I have been doing some research on how to use sprites to teleport a player, its inventory, and etc to another layout and I have yet to find some solid information on this.

    I am under the impression that you need to make a group variable to allow the player to take the inventory but I still seem to be stuck on even getting the player to the next layout.

    I attempted to try "Player -On collision with portal 1- set position - portal 2- and this has not yet worked for me.

    Does anybody have a few minutes to help me out?

    Thank you!

  • To have the inventory in other layouts, just make sure it's global. Your logic for teleporting seems fine so I guess it has been set up incorrectly. You will need to 'GoToLayout2' and then create the player if he doesn't exist and teleport him to the portal position. Please attach screenshot of the event sheet or link to .capx if you need more help. Thanks

  • Thank you on the quick response!

    Ok, I think my issue was that I was not actually telling it to create a whole new player. Makes more sense now!

    However, could you briefly explain how I would set up a global variable that would hold the inventory, health bar, and what not.

  • If the health is simply some sprites, you set each sprite to Global=Yes in the properties on the left-hand side. If the health uses some logic (e.g. arrays) then you also would need to make sure that each event sheet was using the inventory settings. Usually for this I create a Global event sheet which contains the logic I need globally in the game and 'include' it on every event sheet (if you right-click each event sheet and select 'include event sheet' and add the Global one).

  • You sir, are a genius. Ha Thank you!

  • Whenever I set the player or health bar, my start up menu acts crazy and will no longer work.

    I also, added a global event sheet like you suggested and now my cap is along the lines of

    Player-on collision-portal 1 THEN system player-set value=1

    then on the global events I said if

    player value = 1 THEN create object-player-position-portal2

  • Here is a link to my capx... Forgive me for the craziness of it.

    dropbox.com/s/kzho14ybxkafl4z/Adventures.capx

  • Could you be more specific about the issue as some stuff appears to be functioning so I don't know what is broken/ what is meant to be working at this stage. 'My start up menu acts crazy and will not work' ? When I select Matt he loads into an empty stage, when I select Kita she loads into a stage and receives damage from an enemy. Also on the response could you add so I receive a notification, thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Humm, Thats interesting. When I load up the start menu, It allows me to select "New Game" and instead of letting me choose between a player, it takes me to a -frozen- layout with no characters.

    However, I just tried to load the game starting with the character select screen and it works perfectly like you described. With the layout teleport and etc.

    So I assume that this is another issue completely and I appreciate your help in getting my player to teleport.

  • I loaded it from the new game screen and it let me select new game and then a character and loaded into a level. Strange..

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