Teleport between layouts

Get help using Construct 2

Post » Sun Aug 18, 2013 9:22 pm

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!
B
3
Posts: 6
Reputation: 237

Post » Sun Aug 18, 2013 9:40 pm

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
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Mon Aug 19, 2013 3:58 am

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.
B
3
Posts: 6
Reputation: 237

Post » Mon Aug 19, 2013 8:32 am

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).
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Mon Aug 19, 2013 7:17 pm

You sir, are a genius. Ha Thank you!
B
3
Posts: 6
Reputation: 237

Post » Tue Aug 20, 2013 6:16 am

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
B
3
Posts: 6
Reputation: 237

Post » Tue Aug 20, 2013 6:33 am

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

https://www.dropbox.com/s/kzho14ybxkafl4z/Adventures.capx
B
3
Posts: 6
Reputation: 237

Post » Tue Aug 20, 2013 8:30 am

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 @plinkie so I receive a notification, thanks.
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Tue Aug 20, 2013 8:52 am

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.

@plinkie
B
3
Posts: 6
Reputation: 237

Post » Tue Aug 20, 2013 10:06 am

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..
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Next

Return to How do I....?

Who is online

Users browsing this forum: David181 and 14 guests