Can you kill a layout?

For questions about using Classic.

Post » Sun Jun 24, 2012 6:15 am

Hello, thanks for reading!

This is one that's been bugging me for months; when you call GoToLayout, isn't it supposed to kill/destroy/reinitialize the layout you just quitted? Like otherwise if you want stuff to be changed forever in your game you'd need to store that info in global variables, no? Otherwise switching layout means reseting layout?

When I quit my game to the main menu, then with the world map GoTo the same layout I just quitted, it seems chaos just occured while I was gone; the character seemed to fall throught the enviro while I was gone and always spawns a little lower in the level everytime I come back, particles never seem to have stopped growing and grew huge, it lags a lot like as if the whole game was running twice, my character visual is invisible and nothing seems to make it appear, I only see his collision box, it's just madness. I do not use global variables.

So I was wondering am I missing a step or a notion here concerning level structure? I'm aiming at a world structure similar to Mario World.

Thank you so much!
B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Post » Sun Jun 24, 2012 7:59 am

Is it possible to recreate this bug in a barebones .cap. I'm afraid, ppl can't help you really much without seeing a .cap.
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Sun Jun 24, 2012 11:55 am

Have you set any of the objects with the "Global" property? If so then they are not destroyed and re-created automatically when switching layouts.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sun Jun 24, 2012 4:38 pm

(frontpalm) well that must be it...!

I pictured the fact of flagging objects global as a way to have the game objects in one basic layout then using references for building each level layouts. Old habits...

so then I should make a copy of each objects in each layouts and not flag them global, unless I want something like a blacksmith forging a sword for me while I'm gone or something like that.

Thank you so much, I'm going to try that right away.
B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Post » Mon Jun 25, 2012 5:54 am

Yeah, I realized that was breaking a game I was working on as well. But now that I know how Global works, it's pretty awesome =D
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests