Any information on redrawing tilemap in realtime? [SOLVED]

Get help using Construct 2

Post » Fri Feb 05, 2016 5:26 pm

If I have a large tilemap, can I redraw the entire tilemap to form a "new level" rather than loading a new tilemap or a new layout?
Last edited by jook00 on Sun Feb 07, 2016 11:09 pm, edited 1 time in total.
Check out my games on Google Play:

BEAST ATTACK (900,000+ downloads!)

ZOMBIE BASH (Android) (Launched Feb 17)

ZOMBIE BASH (iOS) (Launched March 17)
B
49
S
15
G
2
Posts: 427
Reputation: 5,139

Post » Fri Feb 05, 2016 6:38 pm

You can have as many instances of the object as you like.
You can have as many tilemap objects as you like(in theory).
Image ImageImage
B
165
S
49
G
147
Posts: 8,047
Reputation: 96,586

Post » Fri Feb 05, 2016 9:34 pm

Thanks, but I am aware of that. What I'm trying to figure out is if I have one tilmap with a specific map drawn out, can I change it to a different map? Essentially redrawing the same tilemap? Maybe load it through Json and Arrays?
Check out my games on Google Play:

BEAST ATTACK (900,000+ downloads!)

ZOMBIE BASH (Android) (Launched Feb 17)

ZOMBIE BASH (iOS) (Launched March 17)
B
49
S
15
G
2
Posts: 427
Reputation: 5,139

Post » Fri Feb 05, 2016 9:52 pm

Yes, but all instances share the same texture, so you can't change that part.
On the other hand you can manage them just like every other object using its index, and picking of course.
Image ImageImage
B
165
S
49
G
147
Posts: 8,047
Reputation: 96,586

Post » Fri Feb 05, 2016 9:54 pm

To add the newt's reply, there's the "load" action to load a json. Also there's the Tilemap.TilesJSON to get the json.
B
88
S
30
G
89
Posts: 5,109
Reputation: 60,329

Post » Sat Feb 06, 2016 5:10 am

@newt
Yup, wanting to manage the tilemap using the same textures, just differently drawn out. Thanks!

@R0J0hound
Yeah, I want to do the "load" action through json or tilemap.tilesJSON, but wanting to know how to do this. Would you happen to know how? Thank you so much for your help!
Check out my games on Google Play:

BEAST ATTACK (900,000+ downloads!)

ZOMBIE BASH (Android) (Launched Feb 17)

ZOMBIE BASH (iOS) (Launched March 17)
B
49
S
15
G
2
Posts: 427
Reputation: 5,139

Post » Sat Feb 06, 2016 7:40 am

What is there to know?
You can use project files + ajax or perhaps a dictionary object to store your level data. Project files have the advantage to only being loaded into memory when you need them, while the dictionary would have to be filled immediately.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Sat Feb 06, 2016 6:16 pm

@mindfaQ Perhaps I should've posted this in the beginner section as I have no idea how to store in project files + ajax, let alone tilemaps. I'll take a look at some ajax tutorials. Thanks!

What I am aiming to do once I figure out how to do it:
1. Store tilemap in project files + ajax
2. When level is beaten, make a loading screen and load the next sequence of tiles (using the same tilemap) from ajax files.

My guess:
I'm guessing I'll have to store the corresponding number of the tilemap into the ajax file and I guess they are ordered 0,1,2,etc...? Then I'll have to store the order of the tile map from left to right, top to bottom. Could be 5,0,0,2,3,etc..., then store them in the ajax file, then recall them using arrays?
Check out my games on Google Play:

BEAST ATTACK (900,000+ downloads!)

ZOMBIE BASH (Android) (Launched Feb 17)

ZOMBIE BASH (iOS) (Launched March 17)
B
49
S
15
G
2
Posts: 427
Reputation: 5,139

Post » Sat Feb 06, 2016 6:42 pm

Here's a super simple example. Use a separate project to have all of your tile maps laid out and get the JSON text from the TextBox. You can then load these strings in your real game on demand.

www.blackhornettechnologies.com/Constru ... pJSON.capx
ImageImageImage
B
71
S
20
G
190
Posts: 3,535
Reputation: 108,344

Post » Sun Feb 07, 2016 11:08 pm

@blackhornet Thanks! I also found this that seems to work as well:
https://c2tutorials.wordpress.com/2014/ ... o-plugins/
Check out my games on Google Play:

BEAST ATTACK (900,000+ downloads!)

ZOMBIE BASH (Android) (Launched Feb 17)

ZOMBIE BASH (iOS) (Launched March 17)
B
49
S
15
G
2
Posts: 427
Reputation: 5,139


Return to How do I....?

Who is online

Users browsing this forum: matrixreal, Phacanu, psp321, the_Shit_hawk and 9 guests