The Daily Click ::. Forums ::. Klik Coding Help ::. Level Editor... Layers.
 

Post Reply  Post Oekaki 
 

Posted By Message

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
14th November, 2008 at 09:05:49 -

Ok, so my level editor is eventually going to have layers (Background, Main, and Foreground) and I thought I'd ask this question before I dive into the event editor and cause a tidal wave that would demolish my beautiful code.

Here goes:

Currently, there is only one layer (Main) and the level can be saved and loaded again to and from a *.csv file. With additional layers, I'm wondering if it would be wise to have a different array for each layer, but save them all to the same *.csv file... So I'd have 3 arrays in the one file. Do you think this would be harder to get information from than if I say, had one array with 3 values separated by a dot in each cell, like this:

5.11.3, 0.8.7, 2.4.34

etc.. For every cell...

The first number in each cell would be the value of a background layer tile, second number the Main layer and the foreground layer would be the third number.

What do you think? Three arrays or one complicated array with dots separating the layers in each cell?

Mmf2!

Image Edited by the Author.

 
n/a ...

NeoMonkey

Finnish Army Fire Commander

Registered
  01/12/2006
Points
  243

VIP Member360 OwnerI am an April FoolPS3 Owner
14th November, 2008 at 11:12:18 -

Easy way to do this is to have x,y and z in array. Much easier, than using 3 arrays. Also you can save data like 1:3, which is like tile 3 in layer 1. Now you have to use string parser 2 and make the : as parser.

 
I have proven new mathematic formula to be true...

2D > 3D

Image


-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
14th November, 2008 at 11:24:07 -

Turns out the Dynamic Array object doesn't do Z coordinates

Image Edited by the Author.

 
n/a ...

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
14th November, 2008 at 21:20:48 -

Ok well I've gone with the one complicated array for now. I'm using a regular array to save all the data, including using the Z dimension to determine which layer is being edited, and now I have my dynamic array object read the values from that and turn them into strings like this: 15:32:09 for each cell. Each number in each cell represents a different layer, and when I want to retrieve one of them I'm sure I could just use string parser or something.


But now I have a new problem, when I add backdrop, even if the object is on layer 1 it still adds the backdrop over top of everything else... Any suggestions?

 
n/a ...

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
14th November, 2008 at 21:42:29 -

I could give you the source to my game that uses a level editor and loader using an array. However it doesn't actually paste objects in different MMF2 layers, only a backdrop and Active object layer each.
The array uses another page (z axis thingy) for various things like storing which levels the current level leads too and what music plays and which pictures to load for the parallax.
I'm sure phizzy wont mind me letting someone else see his work.

 
.

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
14th November, 2008 at 21:48:51 -

That would be great thanks

The level editor I'm making is just for visual purposes at the moment, that's why I'm using Add Backdrop. All the data is saved to a csv file so in the actual application, the game will load the levels from the csv data, not the editor. Since csv's are just text, I thought this would be a good way for easy level sharing , just copying someone elses level code into a blank csv file and loading it and then being able to play their level.

 
n/a ...

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
14th November, 2008 at 22:43:10 -

http://www.ectoprods.com/uploads/Lilpirate-opensource.zip

 
 

			
  	    

 
.

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
15th November, 2008 at 00:10:25 -

Cool Had a look through the event editor and it looks great.

I noticed in the level editor you could have animated tiles, like the boxes that flashed what was inside them.

With mine, I might have animated actives but currently I am using just one object as a tile selector, with each frame being a different tile. With some spread value functions I made it so every instance of the tile selector that was on the screen had a different frame, so it looked like lots of different objects

I made a video of it not long ago just to demonstrate the sort of stuff you can do with it so far.. I've added a few features since then but I can show you if you like

 
n/a ...

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
15th November, 2008 at 00:38:47 -

Just got the layers working

Now the backdrop only gets added to the correct layer, and only gets deleted from the correct layer.

I don't think I have any more problems now...

 
n/a ...

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
15th November, 2008 at 21:45:58 -

Glad to see it helped you! If you had any question i might not be able to answer because i didn't make the editor or the level loader.

The only thing linking objects in the editor and the main game is a single alterable value. So you can make the object in the editor do anything.

oh actually you can change an active object's size with the mouse wheel too, but not backdrop objects.

 
.

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
15th November, 2008 at 22:11:50 -

Testing post. . .

Edited by -J-

 
n/a ...
   

Post Reply



 



Advertisement

Worth A Click