Map Editor

The Map Editor is a program bundled along with Superfighters Deluxe which enables players to create their own maps for Superfighters Deluxe. It was added in PreAlpha 1.1.0.

Features
he SFD map editor is a basic program in which players can design maps with various instances found in all of the current included maps in Superfighters Deluxthe sfd map

The SFD map editor is a basic program in which players can design maps with various instances found in all of the current included maps in Superfighters Deluxthe sfd map

Making simple maps (Not using ...[ScriptAPI]]) within Map Editor require no advanced programming knowledge, for example if you wanted to add a concrete slab, you can either manually scroll through the list to find the concrete slab you want, or type "concrete" in the search bar right above the object listing and simply drag the property from the list onto the open space, you would simply find the desired item and drag it onto the grid.

Name/Type map/Author
To name your map, you have to go down to the right and write the name of your map (the name must be coherent with your map).Do not forget to put your username to author, to who create the map.

The Grid
The grid is used to help you, the more you enlarge the grid unless you are accurate and shrink your grid more accurate you are, the grid is at the top of the window (advice: let the grid to 8 because it is adapted to the shape of objects). You can also remove the grid in the bar that is at the top of the window.

Map Bottom
Map bottom, is a yellow line that one can see in the Map Editor, it limits the field, if you cross that line or if a dynamic object crosses this line, the object or the player disappears / dies. The Map Bottom is located at the bottom right of the window, you can change its value (it is to be -320), but you can not delete it.

Border/Camera
"Camera aera"The camera is used to see the map, you can see it in the Map Editor, it has form of a green square, you can change its value who is located at the bottom right ."Border aera"The border limits the player's view on the map,it has form of a white square, it has form of a white square, you can change its value who is located at the bottom right.

Getting Started!
WARNING:
 * Placing tiles and objects is simple drag the tile you want into the world from the list on the right.
 * In order for a map to work properly, you should place at least eight 'SpawnPlayer' markers or some players will spawn at the same position.
 * If you host a multiplayer game with your map, anyone will be able to join and play without downloading the map. To let other players host with your map, however, they need to have it installed on their machine. You should post your .sfdm file online, since you cannot currently share maps in the game.
 * Maps you create during the Pre-Alpha may not be playable or editable in future versions of the game.
 * Unknown bugs can cause loss of data so remember to save frequently!

Controls

 * You can move the camera with middle mouse button or the WASD keys.
 * You can zoom the camera with the mouse wheel.
 * You can right-click on a selected tile to open a sontext menu with actions like rotate, cut, copy, move to front or back.
 * You can select/deselect multiple tiles by drawing a rectangle with the left mouse button.
 * You can select /deselect multiple tiles of the same type by holding Ctrl and double clicking the middle mouse button and moving the mouse.
 * You can invert the current snap-to-grid mode by holding shift.
 * You can copy a selection by moving it while holding Ctrl.
 * You can undo actions by pressing Ctrl + Z.
 * You can redo actions undone by pressing Ctrl + Y.
 * You can see debug information by holding Alt Gr.
 * You can hide the selection highlightning by pressing space.

Map

 * Get started building your own map by placing tiles. See Controls for useful controls.
 * When you want to test your map hit the green play icon on the top menu bar or press F5.
 * WHen you're happy with the result give your map a name and type in the author in the properties in the lower right corner

Note: The properties for the map will only show when you have no tile or layer selected.

Note: When saving your map you should consider using a similar fie name to the display name in the map properties.

Layers
Layers is the best way to keep track of overlapping tiles. You can add, copy and remove layers and arrange the order by using the Layers control in the top-right part of the editor.You can also lock and hide specific layers to prevent you from accidentally making changes.

Placing Tiles

 * You can place a tile by dragging it into the world from the list on the right.
 * You can also search for tiles using the searchbox above the list.
 * You can also copy selected tiles from another opened map (Ctrl + C) and paste it into your own map (Ctrl + V)

Map Properties

The properties for the map are only visible when you have nothing else selected.


 * Map Name: The map's name as it will be displayed in the menus when browsing maps.
 * Map Type: The type of the map. --Versus is a standing versus map.-- Custom maps will never end without calling the Game.SetGameOver method through scripting with option for a custom victory text.
 * Author: The author of the map.
 * Camera Area: The camera area of your map. It's shown by a green rectangle in the edit view. Everything outside this area will be black.
 * Border Area: The coordinates that will be visible for the players.Anything outside this area will be rendered as black.
 * Map Bottom: The world bottom for your map. It's shown by a yellow line in the edit-view. Anything falling below this line will be removed.
 * Weather: Which type of weather to be used on your map (Note: Weather can be disabled from the settings and its only for visual effect).
 * Weapon spawn chances: Edit the overall weapon spawn chances for supply crates (SupplyCrate00). The suppy crates can only spawn if you place some SpawnWeaponArea markers in your map (see SpawnWeaponArea for more details).
 * Start Commands: You can set different start commands for your map by typing them in here. See World Start Commands for more info.

World Start Commands
You can set the starting life for all players by typing "/setstarthealt", "/setstartlife", "setstarthealt" or "/setstartlife" followed by a value between 1 and 100.

You can show a message at the start of each round by typing: "/MSG" or "/MESSAGE" followed by message.

You can set start items for all players by typing: "/STARTITEMS", "/SETSTARTITEMS" or "/SETSTARTUPITEMS" followed by the ID or Names of the items.

"INFINITE_ENERGY" followed by  "1" or "0" to set infinite energy on or off.

"/INFINITE_AMMO" followed by "1" or "0" to set infinite ammo on or off

"INFINITE_LIFE" or "/INFINITE_HEALT" followed by "1" or "0" to set infinite healt on or off.

"/SETTIME" followed by the time modifier ranging between 0.1 and 2.0.

Note: The host can override these startup parameters by typing the same command with different values.

Scripting
OBS: Scripting is targeted for users who knows a bit of C#. If you don't know anything about programming or C# you can find many great tutorials for beginners on the internet and start writing your first lines of code quickly in Visual C# Express (which is a free IDE).

Scripting allows you to change and control the map in different ways by writing your own code. You can open the script window by pressing the Script-tab in the upper right corner of the map editor.

Pressing the help button in the Script Editor will open up the Superfighters Deluxe Script API_ generetade by Doxygen. Here you can navigate the available API for SFD.

By default a page to "GameScriptInterface Class Reference" will be opened. It's in this class all your code in the Script Editor will be compiled into. Here you can see you have access to one property called "Game" which gives you access to the SFD Script API and all its methods and properties.

The game will be able to call methods in your script through different triggers. Each trigger implements a method to run when a certain condition is fulfilled for the trigger.

The most basic trigger is the StartupTrigger that calls a method of your choice when the map starts. If you tell a StartupTrigger to run Script Method "OnStartup" you must have the following public method implemented in your script

public void OnStartup(TriggerArgs args) { /* Method body here */ }

If any trigger calls a method that's not in the script the script for the map will stop with a warning but the game will continue.

All methods called by triggers in your code must have the following signature:public void MyMethod(TriggerArgs args) { /* Method body here */ } TriggerArgs args* args.Caller is the calling trigger (as type BaseObject). Cast it as required. Most triggers can also activate other triggers through the property 'Activate Triggers'. So you can set a StartupTrigger to activate a TimerTrigger that after 20 seconds activates a DestroyTrigger that destroys something in your map.
 * args.Sender is the object that activated the trigger (as type BaseObject). Cast it as required. Can be null.
 * args.Handled is a flag indicating if user has handled the event completely and if any chained events should be stopped.

Note: Triggers don't have to call a custom method you can leave it blank.

Note: Triggers don't have to activate other triggers - you can leave it blank.

If you in your script set args.Handled = true; in a custom method you tell the trigger calling your method that you have handled all events and that any following triggers to activate should be ignored.

Triggers is just a simple way to make things happen in your map based on certain input and conditions implemented by the different triggers. You will be able to do a lot more with custom scripts than with triggers alone.

Note: The game will always try to call the following method "public void OnStartup" when a map starts with or without StartupTriggers.

Note: See the official maps for some examples how to use scripting.

Note: As we developed the game we will add more triggers and methods to the Script API as time goes on. If you have a smart requests for a certain trigger or method in the Script API that's missing - share to us at 'www.mythologicinteractive.com/forum'

Note: The script window is a plain-text editor and does not provide any visual aid in your code.

Limits (and bugs)

 * Superfighters Deluxe uses the box2D engine and all of its limitations.
 * Use joints at your own risk! From the Box2D manual:

"Stacking heavy bodies on top of much lighter bodies is not stable. Stability degrades as the mass ratio passes 10:1.Chains of bodies connected by joints may stretch if a lighter body is supporting a heavier body. For example, a wrecking ball connect to a chain of light weight bodies may not be stable. Stability degrades as the mass ratio passes 10:1."


 * Avoid placing tiles so they overlap each other if they collide with the player. When the box2D solves overlapping it can cause weird behavior and the player's body might move too far when overlapping is solved.
 * Avoid creating dynamic objects that move too fast. Fast moving objects online can look like they are teleporting.
 * If you need a dynamic tile to act as a static convert it to a static instead of welding it stuck.

--- Known bug- Map Editor link:
 * Flipping tiles will make markers and joints lose targets on flipped tiles.

Tiles

Triggers