Multiple layout problems

Get help using Construct 2

Post » Sat Feb 27, 2016 8:50 pm

I have a game that has more than one layout and you can move between the layouts as you like. I have a global Event sheet that they both share. I use this event sheet to hold events that can happen on either layout. (like a treasure chest or power up event will be in the global events because it can be on both layouts)
The problem I am having is that when I travel between both layouts then pick up a item it will take the item one layout 1 and also take the item on layout 2 but only if I have been to both layouts.
Anyone know why it would do that?
B
29
S
6
G
1
Posts: 93
Reputation: 3,020

Post » Sun Feb 28, 2016 1:06 am

I would guess you are using a global variable to control the item pickup system, which in some cases is not recommended, but for a better guess, please add your code image here so I can help you.
B
7
S
2
G
1
Posts: 38
Reputation: 917

Post » Sun Feb 28, 2016 1:37 am

It would be easier to just let u look at the project since it is multiple event sheets.

https://www.dropbox.com/s/h5xuvt6ufoyfp ... .capx?dl=0
B
29
S
6
G
1
Posts: 93
Reputation: 3,020

Post » Sun Feb 28, 2016 2:08 am

in that example i sent u can use the portal to the left to go to another layout and currently the orange box is set to global. But if you leave from one layout to the next over and over they start doing weird things.
I want it to be able to pick up(walk into one and destroy) and it stay picked up even when u leave to the next layout and come back. I do not want it to respawn
B
29
S
6
G
1
Posts: 93
Reputation: 3,020

Post » Sun Feb 28, 2016 4:40 pm

So, I created another sprite with the same condition of the "Pickup" sprite. Player on collision with "sprite" -> destroy, and it happens to work fine for this new sprite, but not for your "pickup" one... Anyway, I couldn't find the problem with the "pickup" sprite but I would just delete it and create another one...

And if you want the layout to remember the collected/destroyed objects you could use the Persist behavior https://www.scirra.com/manual/161/persist
B
7
S
2
G
1
Posts: 38
Reputation: 917

Post » Sun Feb 28, 2016 8:45 pm

thanks that persist behavior was what i was missing, I forgot all about that
B
29
S
6
G
1
Posts: 93
Reputation: 3,020


Return to How do I....?

Who is online

Users browsing this forum: NadeemAbbass, plinkie, wizdigitech and 7 guests