How do I "save" a map generated in preview to the editor?

Get help using Construct 2

Post » Sat Dec 24, 2016 2:54 am

I have objects I want to spread evenly across a layout. I can generate the objects with some code, but how can I then have those same objects in those same positions back in the layout so I don't have to generate them again?

Graphical representation of what I want to do:
Image
B
9
S
3
Posts: 52
Reputation: 1,260

Post » Sat Dec 24, 2016 4:51 am

I don't think you can do that.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Sat Dec 24, 2016 6:40 am

Not easily at least.
You can take the positions and generate a layout.xml file using a layout xml from your capx as an example. So you'd save the generated file somewhere, close your project in c2, and assuming you had saved your project as a folder you can replace one of your project's layout xml with the one you generated. Unless there's a mistake in the xml that was generated.

Anyways it's probably a tedious thing to do initially, and the step requiring you to manually replace files is a slow workflow.

A more reasonable thing to do would be to save the generated positions to some text, and then put that into your game and recreate the objects from that.
B
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

Post » Sat Dec 24, 2016 7:28 pm

OK. I think I might look into seeded generation and do it that way. Thank you!
B
9
S
3
Posts: 52
Reputation: 1,260


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 47 guests