How do I load objects into a layout?

Get help using Construct 2

Post » Wed Dec 30, 2015 3:27 am

I'm making a space rpg game, and the player must travel to different locations and complete certain tasks.

I have a gamemap layout that has about 30000 tiles, and each tile has it's own location variable number (e.g location=2,location=2324, etc.) and type number (comets=6, planet=9).

whenever the players wants to go to a certain location, it will take the player to the location layout based on the sprite's location number.

Suppose the player wants to land on location#1543 and it's the player first time landing on this location.

I know how to generate elements in this new location, but I don't know how to save all the elements positions, angles, instance variables, etc, so that when the player decides to visit this location again, the layout can load all the elements/variables that were inside this layout.

Any ideas on how I can program this?

Here is a capx : ... .capx?dl=0

Posts: 26
Reputation: 1,288

Post » Thu Dec 31, 2015 3:14 am

You need to use local storage to save your initial Universe, with an Array of the frames & UIDs. Then on the next startup you check if this exists first and reload the player's universe. You would then use the same trick, but I'd suggest a dictionary for loading each location, since the player will never hit all 30k locations, so you just need to save the locations that are visited at least once. If you place everything in a Family, and name each object type, you can read in the data and rebuild the same layout. ... r_BHT.capx
Posts: 3,734
Reputation: 134,494

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 39 guests