How do I save and load maps without arrays?

Get help using Construct 2

Post » Tue Jan 12, 2016 10:40 pm

I'm making a game where every universe is generated randomly. For example, lets say player is in universe A (universe layout), and the player lands on one of the planets in Universe A that the player has never been to. How would I randomly generate objects to the (Planet Layout) and save all the planets objects, positions, variables, in case the player decides to visit this planet again?
B
7
S
1
Posts: 9
Reputation: 408

Post » Wed Jan 13, 2016 4:48 am

Have you tried the save and load action?
B
32
S
14
G
4
Posts: 172
Reputation: 4,008

Post » Wed Jan 13, 2016 4:54 am

@arcab072081 Yes I did, but it layout overwrites the existing objects in the layout.
B
7
S
1
Posts: 9
Reputation: 408

Post » Wed Jan 13, 2016 9:05 am

why you don't wan't to use array?

if you generate terrain in tilemap (or not) or other stuff, the array will help you to save all data... for example, if a player visit a new planet, when the terrain is generated, you can save it and reaload when the user go again in that planet with a if condition:

if the savegame of that planet exist, load it, if not generate a new one.

arrays are very poweful especially to save data...
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Wed Jan 13, 2016 2:15 pm

This is what I did:

At the end of every layout it SAVES via the "System:Save" action. And on the "Start of Layout" for the menu I use the "System:Load" action. Where am I going with this.. well. I found out a great way to make the Save and Load work perfectly with ONLY the variables in the Game. Make groups with the objects you don't want to save. In my case this was everything. In the group behavior just make them "No Save". This wont save any of the other stuff you don't want.

That was just to sort your save errors out. I don't know about the rest. I hope that helped anyhow.
B
14
S
1
Posts: 65
Reputation: 732

Post » Thu Jan 14, 2016 3:20 am

@Ribis

I don't want to use arrays because arrays are confusing. I tried learning arrays from tutorials and youtube, but every single time I can't get them to work properly or I get different results.

For example, I watched this video on youtube:

https:// (addyoutubehere).com/watch?v=TolEm2EXWPE

On 6:50 notice how the array was printing catdog together and then catdoghouse, etc. Well my array was printing one word at a time e.g cat dog house instead of cat catdog catdoghouse.

Here is a capx of my array example:

https:// (adddropboxhere).com/s/qblc3au0k7a55vy/arrayexample.capx?dl=0

Please Note remove the spaces in the links! Sorry I'm not allowed to post links until I get 500 Rep!
B
7
S
1
Posts: 9
Reputation: 408

Post » Thu Jan 14, 2016 10:47 am

@SkyLionGames

Well, now I don't have so much time to see the videos... but I make a easy example for you..

https://www.umbriadesign.it/example/save_tile.capx

with this, you can save a tilemap (you can draw, select the colors...etc) save, and load.... you can also save a file to see how is saved that file..

this is not an array, but the array works similar....

I will make another example with array when I have time
B
21
S
9
Posts: 298
Reputation: 2,967


Return to How do I....?

Who is online

Users browsing this forum: angryvel760, chrislechat, eryson27, ismael123, Yahoo [Bot] and 1 guest