Post by Laddo D on Aug 3, 2013 10:34:17 GMT -8
It wasn't announced, but v0.8 exposes the level editor for anybody to use. It's still very rough and user-unfriendly though, so don't expect a terribly positive experience. To lessen the blow, I have started this thread to post a tutorial and answer any questions you might have.
The first thing to do is to enable debug keys. In the folder path assets/data/ there is a file called GLOBAL. There are several fields here, most can either be set to TRUE or FALSE:
1) The first line enables the following debug keys:
) - spawns a new player character, some menus and keys will not work without an active player character
u - toggle no-clip mode on/off
k - reveals the entire minimap
\ - opens up the level editor
, - toggles the level tile grid
' - toggles the hud on/off
n - resets the average framerate display and sets your gold to 1000
2) controls whether the game starts at the load screen, then goes to title menu. If not, the game will load up the first save slot and drop you into the hub level directly.
3) this is what type of level the game starts you in and goes to when you select the "To Hub" option in the pause menu. 'none' defaults to the hub level. 'SCRIPTED' indicates any of the level definition files in assets/data/levels/. 'EDITED' indicates any of the static levels in assets/data/levels/edited/.
4) this is the actual level file. If it is not the same type as the above field the game will probably crash or lock up or something fun like that
5) though 8) are pretty self-explanatory and not all that terribly useful for our purposes
Basically if you want to make your own levels change the first field to TRUE.
So now load up the game and press the \ key once you get to the hub. The level editor should pop on the left or right side of the screen.
At the top it shows the currently selected tile and the current drawing layer. There is also a cancel button but its easier to use the \ key toggle the editor on and off.
Below that is a text box for level names and buttons for new/save/load operations.
"New" will just blank out the current level's tiles.
To save a level, type a name in the box and hit "Save". This will overwrite any level with this name without warning so you might want to backup your files every once in a while!.
To load a level, type the level name in the box and hit "Load".
Underneath is a slider that controls the ambient light strength for the level. You might have to re-load the level in order for the lighting to work entirely correctly.
The bulk the level editor is a the tile list. You can select what tile to use and what layer to draw on.
Left-click will place the current tile.
Right-click will open the options menu for certain tiles.
Shift-click will change the current tile to whatever you and mousing over.
Ctrl-click + drag will place a rectangle of the current tile
As a bonus, in the lower-left corner the player's current world position is displayed. 32 world units corresponds to a single tile.
The steps for creating a new level are definitely the least user-friendly part so please bear with me. To create a new level, I start by blanking the current level by hitting "New" then naming and saving the level. At this point you'll need to go and edit the level file directly, because it was seriously easier for me to do this every time I make a level than build the UI for this stuff. Eventually I will but for now we'll all have to grin and bear it. Find the file in assets/data/levels/edited. Even though these files don't have an extension, they are just plain text files that can be opened in notepad. The internals are kind of mysterious and weird but fortunately we only have to edit the header which is very simply laid out:
The first three numbers are the level's light level, width, and height.
The second line is the level background music. These files are located in assets/sound/bg/
The third line is the number of background images.
The next few lines are the background images in top-down order. These files are located in assets/textures/bg/
The last line is intentionally left blank.
Save the file and then load it up in Magicmaker. You are now ready to begin editing your level.
Now several of this tiles have extra options that can be accessed by right-clicking them after they have been places. If you have been paying attention, you've probably predicted that none of these options are explained or even laid out properly. They probably overlap each other in weird ways and make no sense. I will be fixing this as we go along but for now you'll have to suffer through what a tool/application looks like when absolutely no thought is given to usability. At the very least it will give you a heightened appreciation for UI designers.
Just so you the level editing experience isn't a complete pain, I will explain the menus for each of the tiles right here:
ENEMYSPAWN
a set of radio buttons for the one(1) enemy spawned by this tile at initialization
TIMERTRIGGER
this tile returns true if its internal timer exceeds some value
a button that toggles whether the player can see the timer
a text field for the timer's max value (i can't remember what happens if you put something here that isn't a number but it is probably not cool)
a button that will let you set a reference to a tile. the timer will only count up if this tile returns true. if this reference points to this tile, it is counted as always true.
CHEST
this tile returns true if the chest has been opened
a set of radio buttons for how many things to drop
a set of radio buttons for if the chest drops materials, quest items, or gold
a set of radio button for what type of chest is spawned
depending on the second radio button set it might have the following options:
a checklist of what materials to drop
a bunch of sliders that do nothing
a checklist of what quest items or coupons to drop
a set of buttons for the minimum and maximum gold to drop
TRIGGEREDDOOR
this tile become collidable if certain conditions are met
a text field for the particle used by this door. these images are in assets/textures/particle/.
a set of radio buttons for what kind of event triggers this door
depending on the radio buttons it might have the following options:
a pair of radio buttons for if the conditions are logical AND (all conditions must be met) or OR (at least one condition must be met)
a set of buttons that reference other tiles, these tiles are tested for if they return true or not
a set of buttons that indicate what quest item would open the door
PORTALSPAWN
a set of radio buttons indicates what type of level
a text field that indicates the level file to be loaded
edited level - this is located in assets\data\levels\edited
scripted level - this is located in assets\data\levels and is the definition file
a text field that indicates the particle the portal in made of
a text field that indicates the particle the portal expels
a text field that indicates a file in assets\data\text that includes the information in the level dialogue box
NPCSPAWN
a text field argument that is the npc file is assets\data\npc
VAULTDOOR
a set of radio buttons that indicates what key opens this door
a button that does nothing? I don't remember putting this here.
TRIGGEREDMESSAGETILE
displays a message at the bottom of the screen, takes several arguments
a text field that is the message title
a text field that is the message body
a set of radio buttons that indicates if it is trigged by a tile or an item
a toggle for if the message is triggered by the condition being met or unmet
depending on the radio buttons two things are displayed:
a button containing a reference to a tile
a set of radio buttons for what quest item activates this message
then there are a set of similar controls for what deactivates this message
AREATRIGGER
tile returns true if the player ever approaches x distance
a text field that indicates the distance in magicmeters
PROP
a text field for a propfile in assets\data\prop. TESTPROP is is the folder, and is pretty self-explanatory
ENEMYSPAWNREPEAT
a set of radio buttons for what enemy is is repeatedly spawned
a text field for how often it spawns the enemy
a button with a reference to a tile, it only spawns enemies if this tile is true
QUESTITEMDROP
a set a radio buttons for what item to drop
a button with a reference to a tile, it will drop the item when this tile is true
SPELLTRIGGER
this tile returns true is if the player has shot a spell at it in the last x seconds
a test field that indicates x in seconds
a button with a reference to tile, this tile only works while this tile is true
NOTGATE
a button with a reference to a tile, this tile always returns the opposite of this tile
If I missed something, which I most certainly did, please feel free to ask about it.
The first thing to do is to enable debug keys. In the folder path assets/data/ there is a file called GLOBAL. There are several fields here, most can either be set to TRUE or FALSE:
1) The first line enables the following debug keys:
) - spawns a new player character, some menus and keys will not work without an active player character
u - toggle no-clip mode on/off
k - reveals the entire minimap
\ - opens up the level editor
, - toggles the level tile grid
' - toggles the hud on/off
n - resets the average framerate display and sets your gold to 1000
2) controls whether the game starts at the load screen, then goes to title menu. If not, the game will load up the first save slot and drop you into the hub level directly.
3) this is what type of level the game starts you in and goes to when you select the "To Hub" option in the pause menu. 'none' defaults to the hub level. 'SCRIPTED' indicates any of the level definition files in assets/data/levels/. 'EDITED' indicates any of the static levels in assets/data/levels/edited/.
4) this is the actual level file. If it is not the same type as the above field the game will probably crash or lock up or something fun like that
5) though 8) are pretty self-explanatory and not all that terribly useful for our purposes
Basically if you want to make your own levels change the first field to TRUE.
So now load up the game and press the \ key once you get to the hub. The level editor should pop on the left or right side of the screen.
At the top it shows the currently selected tile and the current drawing layer. There is also a cancel button but its easier to use the \ key toggle the editor on and off.
Below that is a text box for level names and buttons for new/save/load operations.
"New" will just blank out the current level's tiles.
To save a level, type a name in the box and hit "Save". This will overwrite any level with this name without warning so you might want to backup your files every once in a while!.
To load a level, type the level name in the box and hit "Load".
Underneath is a slider that controls the ambient light strength for the level. You might have to re-load the level in order for the lighting to work entirely correctly.
The bulk the level editor is a the tile list. You can select what tile to use and what layer to draw on.
Left-click will place the current tile.
Right-click will open the options menu for certain tiles.
Shift-click will change the current tile to whatever you and mousing over.
Ctrl-click + drag will place a rectangle of the current tile
As a bonus, in the lower-left corner the player's current world position is displayed. 32 world units corresponds to a single tile.
The steps for creating a new level are definitely the least user-friendly part so please bear with me. To create a new level, I start by blanking the current level by hitting "New" then naming and saving the level. At this point you'll need to go and edit the level file directly, because it was seriously easier for me to do this every time I make a level than build the UI for this stuff. Eventually I will but for now we'll all have to grin and bear it. Find the file in assets/data/levels/edited. Even though these files don't have an extension, they are just plain text files that can be opened in notepad. The internals are kind of mysterious and weird but fortunately we only have to edit the header which is very simply laid out:
The first three numbers are the level's light level, width, and height.
The second line is the level background music. These files are located in assets/sound/bg/
The third line is the number of background images.
The next few lines are the background images in top-down order. These files are located in assets/textures/bg/
The last line is intentionally left blank.
Save the file and then load it up in Magicmaker. You are now ready to begin editing your level.
Now several of this tiles have extra options that can be accessed by right-clicking them after they have been places. If you have been paying attention, you've probably predicted that none of these options are explained or even laid out properly. They probably overlap each other in weird ways and make no sense. I will be fixing this as we go along but for now you'll have to suffer through what a tool/application looks like when absolutely no thought is given to usability. At the very least it will give you a heightened appreciation for UI designers.
Just so you the level editing experience isn't a complete pain, I will explain the menus for each of the tiles right here:
ENEMYSPAWN
a set of radio buttons for the one(1) enemy spawned by this tile at initialization
TIMERTRIGGER
this tile returns true if its internal timer exceeds some value
a button that toggles whether the player can see the timer
a text field for the timer's max value (i can't remember what happens if you put something here that isn't a number but it is probably not cool)
a button that will let you set a reference to a tile. the timer will only count up if this tile returns true. if this reference points to this tile, it is counted as always true.
CHEST
this tile returns true if the chest has been opened
a set of radio buttons for how many things to drop
a set of radio buttons for if the chest drops materials, quest items, or gold
a set of radio button for what type of chest is spawned
depending on the second radio button set it might have the following options:
a checklist of what materials to drop
a bunch of sliders that do nothing
a checklist of what quest items or coupons to drop
a set of buttons for the minimum and maximum gold to drop
TRIGGEREDDOOR
this tile become collidable if certain conditions are met
a text field for the particle used by this door. these images are in assets/textures/particle/.
a set of radio buttons for what kind of event triggers this door
depending on the radio buttons it might have the following options:
a pair of radio buttons for if the conditions are logical AND (all conditions must be met) or OR (at least one condition must be met)
a set of buttons that reference other tiles, these tiles are tested for if they return true or not
a set of buttons that indicate what quest item would open the door
PORTALSPAWN
a set of radio buttons indicates what type of level
a text field that indicates the level file to be loaded
edited level - this is located in assets\data\levels\edited
scripted level - this is located in assets\data\levels and is the definition file
a text field that indicates the particle the portal in made of
a text field that indicates the particle the portal expels
a text field that indicates a file in assets\data\text that includes the information in the level dialogue box
NPCSPAWN
a text field argument that is the npc file is assets\data\npc
VAULTDOOR
a set of radio buttons that indicates what key opens this door
a button that does nothing? I don't remember putting this here.
TRIGGEREDMESSAGETILE
displays a message at the bottom of the screen, takes several arguments
a text field that is the message title
a text field that is the message body
a set of radio buttons that indicates if it is trigged by a tile or an item
a toggle for if the message is triggered by the condition being met or unmet
depending on the radio buttons two things are displayed:
a button containing a reference to a tile
a set of radio buttons for what quest item activates this message
then there are a set of similar controls for what deactivates this message
AREATRIGGER
tile returns true if the player ever approaches x distance
a text field that indicates the distance in magicmeters
PROP
a text field for a propfile in assets\data\prop. TESTPROP is is the folder, and is pretty self-explanatory
ENEMYSPAWNREPEAT
a set of radio buttons for what enemy is is repeatedly spawned
a text field for how often it spawns the enemy
a button with a reference to a tile, it only spawns enemies if this tile is true
QUESTITEMDROP
a set a radio buttons for what item to drop
a button with a reference to a tile, it will drop the item when this tile is true
SPELLTRIGGER
this tile returns true is if the player has shot a spell at it in the last x seconds
a test field that indicates x in seconds
a button with a reference to tile, this tile only works while this tile is true
NOTGATE
a button with a reference to a tile, this tile always returns the opposite of this tile
If I missed something, which I most certainly did, please feel free to ask about it.