(1) Your FC account doesn't work here; (2) Don't make new articles about yourself or another person; (3) Contribute!
NOTE: The style guide dictates that all headings and page titles are in sentence case.

FCResource:WebFCML editor

From Fantastic Wiki

Jump to: navigation, search

The editor can be found at: http://www.fc.tetsunosuke.co.cc/webfcml/ (make sure you are logged in on FC Resource first or otherwise you cannot save if you login later)

FC Resource's WebFCML editor is an online application that lets you write and publish "FCML code." FCML code is an easy to read and easy to write (once you learn it) language for describing stuff in Fantastic Contraption levels and designs. For example, all the green rectangles in a level could be represented by a line of text with "StaticRect" in it. For another example, say you wanted 20 equally sized dynamic rectangles (the yellow shapes); just write the corresponding FCML line and copy it 20 times over. You're done!

While this article makes it sound easy, the editor is generally for perfecting existing levels or creating mathematically accurate levels. It's just too much of a bother to design the entirety of a level in FCML. And lastly, while FCML has been created so that it can describe designs as well as levels, the WebFCML editor only allows you to work with levels. It will complain if you try to, for example, put an unpowered wheel in the code.

Besides all of this, the WebFCML editor allows you to "bend the rules" ever so slightly so that you can create shapes that are smaller than they can normally be in the game.

Contents

[edit] How FCML is written

First, get familiar to the syntax of FCML.

[edit] Comments

First off, you can put comments in FCML files. These lines are for your personal use, and the parser won't do anything with them. Just prefix lines with either a semi-colon (;) or a hash mark (#) to make it a comment. These won't save with a level either, but you can pass around the FCML source code with the comments to other people.

; This is an example of a comment
; Another line!

[edit] Properties

Next, you'll need to define attributes such as name and description. If you're putting together a level, you'll need to name it. Properties are defined like so:

@attribute value

And an example:

@name This is the name of the level

Level FCML supports two properties:

Property Type Description
name string (required) Name of the level/design; max. 15 characters
description string Description of the level/design; max. 50 characters

Adding extra properties won't do any harm, but it's also pointless.

[edit] Objects and areas

Each object is put onto its own line. The line looks like this:

type (x, y), (width, height), angle

Coordinates (x, y) are always from the center of the object, not the top left. Angle is expressed in degrees. If you set an object's coordinates to be (0, 0), it will be in the very center of the level. Here's an example of an object:

StaticRect (0, 3), (20, 400), 0

Build areas and goal areas are defined in the same way.

Example of an object written in FCML
Example of an object written in FCML

Now, what objects can you use, what are their names, and what are the constraints? They are in the following table:

Type X Y Width Height Angle Notes
StaticRect -8000 = x = 8000 -8000 = y = 8000 1 = w = 6000 1 = h = 6000 No constraint
StaticCircle -8000 = x = 8000 -8000 = y = 8000 1 = w = 6000 1 = h = 6000 No constraint Width must equal height
DynamicRect -8000 = x = 8000 -8000 = y = 8000 1 = w = 6000 1 = h = 6000 No constraint
DynamicCircle -8000 = x = 8000 -8000 = y = 8000 1 = w = 6000 1 = h = 6000 No constraint Width must equal height
GoalRect -8000 = x = 8000 -8000 = y = 8000 1 = w = 6000 1 = h = 6000 No constraint
GoalCircle -8000 = x = 8000 -8000 = y = 8000 1 = w = 6000 1 = h = 6000 No constraint Width must equal height
BuildArea -8000 = x = 8000 -8000 = y = 8000 60 = w = 6000 60 = h = 6000 Always define as 0
GoalArea -8000 = x = 8000 -8000 = y = 8000 60 = w = 6000 60 = h = 6000 Always define as 0

When it says that "width must equal height," that's because ellipses are not supported in the game. Thus, the width and height of a particular circle need to be equal.

For build and goal areas, as they cannot be rotated, always put the angle as 0.

[edit] Example FCML

The following is some example FCML for a sandbox level.

; Level: Bonus SX

@name Bonus SX
@description A mere sandbox level

; Build and goal areas (1 of each)
BuildArea (16.7, -2.8), (1876.6, 1225.1), 0
GoalArea (673.75, -476.1), (562.4, 278.4), 0

; Non-goal objects
StaticRect (52.95, 549.65), (1809.7, 122.5), 0
DynamicCircle (-849.55, -514), (61.3, 61.3), 0
StaticCircle (-697.45, -487.5), (27.8, 27.8), 0

; Goal objects
GoalCircle (-785.1, 438.1), (40, 40), 0
GoalCircle (-834, 389.25), (40, 40), 0
GoalCircle (-834, 438.05), (40, 40), 0
GoalRect (-830.8, 338.2), (50, 50), 0
GoalCircle (-785.1, 389.2), (40, 40), 0
GoalRect (-774.45, 338.2), (50, 50), 0
GoalCircle (-717, 412.6), (89.3, 89.3), 0
GoalRect (-691.55, 307.35), (102.1, 110.5), 0
GoalRect (-803.2, 297.75), (106.3, 19.1), 0

[edit] How to use the WebFCML editor

To the right of the interface is the textbox where you enter your FCML editor. Once you've written out your code, you can press the "Preview" button to generate a simulated screenshot of your level (note: it's not exact for every pixel). Once you are ready, you can click the "Upload" button to publish your level to Fantastic Contraption. The editor will give you a link to edit your newly saved level or to play it.

[edit] Preview options

At the bottom of the editor are some preview options:

  • Preview in wireframe: this won't fill in the shapes in the screenshots
  • Preview with axis and boundaries: shows the coordinate system as well as the three important boundaries

[edit] Plugins

In the menu bar, there is a menu for plugins. These enhance the editor with various features.

  • Circle generator: This will generate a mathematically perfect circle for your level.
  • Transform: This allows a level to be transformed in various ways

[edit] Frequently asked questions

[edit] Getting the FCML of an existing level

When you're viewing the lookup page for a level, on the menu on the right at the bottom is an Export FCML link. Click that, and FC Resource will dump you the FCML data. Currently, there's no way to load the FCML of an existing level from within the editor.

Personal tools
Fantastic Contraption