Persistent Layouts

New releases and general discussions.

Post » Fri Aug 21, 2009 9:39 pm

It would be nice if Construct had a feature that you could check in the layout for "persistence". This would be similar to what GameMaker does. So if you had an RPG where you need to revisit a layout you could just do that and not have to worry about losing the state of the layout.

I realize that you could create persistence by using events (and I've done it), but it takes a fair bit of work to save the location of all of the sprites on the layout. This seems like something that should be done by Construct since it would be required in any game where you have to revisit layouts. Of course, it would probably have to be done in a 1.x release.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Fri Aug 21, 2009 10:20 pm

global objects?
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Fri Aug 21, 2009 10:42 pm

@lucid Yes, global objects work. However, there is something buggy even then because I have had a global object at lets say 1000,1000 enter a layout and when returning end up at 0,0. Guess I should submit a bug report. :?

Even assuming you are using global objects, you still have to keep track yourself in each layout whether you have entered the layout for the first time or subsequent times. As I mentioned before, this can be done with events (check a global variable or enable/disable groups), but this seems like something that would be better built into Construct.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Fri Aug 21, 2009 10:45 pm

It's actually easier than it seems via events. All you need to do is put all the sprites you want to save the position of in a family, then on end of layout, for each object in the family, use loopindex to write the object name in one column of an array, the x position in another, etc.

At start of layout, run through the column of object names and create from that. It all could probably be done with 2-3 events.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,422

Post » Sat Aug 22, 2009 1:41 am

@Arima Good idea. The more I think about this its probably better suited to be implemented by the game developer than built in. Probably not worth adding into the IDE.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat Aug 22, 2009 1:16 pm

It's a nice idea though and a common question - maybe some feature could be developed to make it easier, at least.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,564


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 7 guests