User Tag List

Results 1 to 6 of 6

Thread: More level editor woes

  1. #1
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Apr 2012
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    More level editor woes

    Ah, my troubles seem neverending with this level editor of mine!

    I just realized that in my level editor I'm only able to write one tile to every position.

    As it is now, I'm saving a bunch of variables into an array that takes X,Y and Z into account.
    X and Y are the positioning, and the Z contains info about what is placed. The problem is that it only reads the array once upon loading the level.

    The only way I can see this working is if I save every layer to a separate array and load them one at a time, but that seems very extensive.

    Antother solution would be to have an array within an array, but I can't see how that would work in this software.

    Basically, I need to save the information about every grid, but have it stored in 7 Z dimensions representing all the layers that I use, so that each tile can have more than one tile on it, but on different layer levels.

    Any ideas would be greatly appreciated!

  2. #2
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Apr 2012
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I solved this sort of. What I'm doing now is I'm saving 4 arrays per level

    Array 1: Stores The layer of the object by the Z index,and the nature of the object as a string by the XYZ position, "Backdrop", "Obstacle" or "Active".
    Array 2: Stores the frame id of the current position, at the same XYZ but in a different array. This is so that the Active object that is the backdrop placer will know which image to create a backdrop from.
    Array 3: Stores the name of the active to be created if Array 1 returns "Active" in the current XYZ position. THis is done because there is a "Create by name" function, and it takes the input from the current XYZ of this array to decide what to create.
    Array 4: Stores unique variables to active objects. For example, to link a switch and a door I will assign them both an unique id during the level editing phase, and when the level loads, they will get the property from XYZ of this array. the Z index indicates the position of the variable, if it is Alterable Varible A, B or C, while the value at the index indicates what the variable is to be set to.

    Upon loading the level, I run the Z loop 7 times, once for each layer This is to make sure each object gets created at the proper layer. Throughout the rest of the loops, whenever a layer needs to be referenced, it is done by referring to LoopIndex(load_Z). Within the Z loop, I run the X loop for the entire width of the level, and within the X loop I run the Y loop for the length of the level. It is during the Y loop that the tiles are actually pasted into the level as backdrops. While 4 arrays is a bit much, I couldn't think of any other way to do it while still retaining control.

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    679
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    use one array, make it a string array.

    think of each array cell on x and y as part of your grid: 0,0 is the top left of the grid, 0,1 is 1 tile down, etc. You save all the tile info to a string in a tile on the xy axis ("tile name, tile ID, tile collision type, etc"), then use the array's Z axis to determine what layer it is on. So a tile at 5,5 in the grid on layer 3 would be saved to Array(x5, y5, z3). To retrieve the tile info from your string, use the string tokenizer extension and split the string (1D) with a delimiter of ",", then retrieve the elements (0 is the first element, 1 the second and so on) to correctly set up your tile.

    No need to store the tile's actual position in the array: whenever retrieving a tile from the array, you position it at your origin coordinates (usually 0,0 or something) then do

    set position to
    -->Origin point + (tile size * position on the grid (usually found using nested loops))

    To position it in the world.

  4. #4
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Apr 2012
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm, is it possible to concatenate strings in the Alterable Strings part? Like if I have a value that is currently "Object", can I add a string to it so that it becomes "Object, Tiletype"? and then separate them?

  5. #5
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Apr 2012
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I noticed in the string tokenizer, is there a way to clear it? I want to refer to only index 0 and 1 of the string tokenizer, but as i read and split more strings, won't they add upp?

  6. #6
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    679
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    You can add to strings. What you need to do is set the string to itself + your new string: i.e "Object" + ", Tiletype" = "Object, Tiletype".

    You can clear the elements by re-splitting the string. Every time you split the string it resets all the elements.

Similar Threads

  1. Level editor that uses MMF2's own frame editor
    By Shawn in forum File Archive
    Replies: 35
    Last Post: 9th November 2013, 06:34 PM
  2. Level Editor
    By weka in forum Multimedia Fusion 2 - Technical Support
    Replies: 27
    Last Post: 6th May 2009, 02:10 PM
  3. Help for Level Editor
    By baracuda in forum Multimedia Fusion 2 - Technical Support
    Replies: 18
    Last Post: 23rd May 2007, 07:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •