CFED(6)

NAME

cfed - a level compiler for Crimson Fields

SYNOPSIS

cfed mapsource --tiles tileset --units unitset [-o outfile]

cfed {--help | --version}

DESCRIPTION

cfed is the Crimson Fields level compiler.

It creates a *.lev file out of a source file *.src. You can use any standard text editor to create the level source files (for the syntax
of those files, see the section called "FILE FORMAT" below). cfed reads the input file and creates the level file. If the name of the
ouput file is not given on the command line, it is created in the same location as the source file with the .src suffix substituted by .lev.

OPTIONS

--help
Print a usage message on standard output and exit.
--tiles tileset
Use the tile definitions from tileset when compiling the map.
--units unitset
Use the unit definitions from unitset when compiling the map.
--version
Print version information on standard output and exit.
-o
Set the name and path of the converted level file.

FILE FORMAT

A level source file consists of sections. A section is started by the
section name in square brackets, i.e. the line

[unit]

starts a unit section. Lines in a section are usually composed like
this:

qualifier = value

The only exceptions to this are the map and messages sections. Lines starting with # are considered comments. The following sections exist:
mission
This section defines some global mission parameters like map size or
the graphics set to use. The mission section is mandatory and must
appear before the map section in the file. Valid qualifiers are
name
index of a message containing the mission title. This name will be used when presenting the list of available maps to the player.
(maximum length 30 characters, mandatory)
mapwidth
[10-200] (mandatory)
mapheight
[10-200] (mandatory)
nextmap
the name of another map (without path and file ending). After the
current map has been completed, this new map will be loaded
automatically. This tag is only valid for campaign maps.
info
index of the information message that is to be shown when a player requests level information. This message can contain the level
name, author, revision, etc.
campaign
indicates whether the map is part of a campaign [0|1]. Default is 0 (not part of a campaign). See also campaignname and campaigninfo.
campaignname
index of the campaign name. It should be set only when the map
actually is the first of a campaign. See also campaign and campaigninfo. (mandatory and valid only for the introductory map of a campaign)
campaigninfo
index of the information message for the campaign. This info is
displayed when starting a new campaign and should contain a short
outline of the background story. It is useful only when the map
actually is the first of a campaign. See also campaign and campaignname.
skirmish
indicates whether the map can be played in skirmish mode [0|1].
Default is 1 (true).
players
selects whether the map is intended for play against another human being (2) or against the computer (1). This is for informational
purposes only and defaults to 2.
music
name of a soundtrack (either MIDI or Ogg Vorbis) excluding the file type suffix to be played during this map. If the setting is
missing, the default track for Crimson Fields will be played.
tileset
tileset file to be used. A tileset contains the map graphics and
terrain definitions. The filename must be given without the .tiles suffix. If omitted, the tile set defaults to 'default'.
unitset
unit set file to be used. A unit set contains the unit graphics and definitions. The filename must be given without the .units suffix. If omitted, the unit set defaults to 'default'.
map
The map section defines the actual map layout. It is a rectangle of the size specified in the mission section, consisting of various symbols which describe a certain map tile type. The map section is mandatory
and may not contain comments. The following symbols exist.
.
plains
*
forest
%
mountains
=
shallow water
~
water

EXAMPLE

### This is a simple example mission file

[mission]
# mission title is "The Great Example"
name = 5
mapwidth = 11
mapheight = 10
# the first message in the [messages] section
# will be used as level information
info = 0
# we use the default tileset and unit set so we could
# omit the next two lines
tileset = default
unitset = default

[map]
***...***..
**...****.=
*<^1n]*..==
**v..(..==~
***...].=~~
#=#.==!====
======(]...
%*.=...E^>.
%%..%...v..
%%%%.%...**

### first player - The Good
[player]
name = 6
# second message is briefing for this player
briefing = 1

### second player - The Bad
[player]
name = 7
# third message is briefing for this player
briefing = 2

### units for player 1

[unit]
# this unit will start in the building
pos = 3/2
player = 1
id = 0
type = Infantry

[unit]
pos = 5/4
player = 1
id = 1
type = Medium Tanks

[unit]
pos = 6/3
player = 1
id = 2
type = Medium Tanks

[unit]
pos = 3/2
player = 1
id = 3
type = Scouts

### units for player 2

[unit]
pos = 7/7
player = 2
id = 10
type = Anti-Aircraft Tanks

[unit]
pos = 6/6
player = 2
id = 11
type = Personnel Carriers

[unit]
pos = 7/6
player = 2
id = 12
type = Infantry

[unit]
pos = 7/7
player = 2
id = 13
type = Heavy Tanks

### buildings

# HQ of the Good
[building]
name = 8
pos = 3/2
id = 0
player = 1
# can repair units here
type = workshop
crystals = 25

# HQ of the Bad
[building]
name = 9
pos = 7/7
id = 1
player = 2
# can repair and build units
type = workshop
type = factory
# the following units can be built
factory = personnel carriers
factory = anti-aircraft guns
factory = bomber wing
crystals = 25

### events

# player 1 wins if he conquers
# the enemy building at any time...
[event]
type = score
id = 0
player = 1
trigger = havebuilding
tbuilding = 1
towner = 1
# the next line could be left out
ttime = -1
success = 100
message = 3
title = 4

# ...or destroys all enemy units
[event]
type = score
id = 1
player = 1
trigger = unitdestroyed
tunit = -1
success = 100

# player 2 wins if he conquers
# the enemy building at any time...
[event]
type = score
id = 2
player = 2
trigger = havebuilding
tbuilding = 0
towner = 2
success = 100
message = 3
title = 4

# ...or destroys all enemy units as well
[event]
type = score
id = 3
player = 2
trigger = unitdestroyed
tunit = -1
success = 100

# display briefings on first turn
#
[event]
type = message
id = 4
player = 1
trigger = timer
ttime = 0
title = 5
message = 1

# Even though time index 0 is during player 1's phase
# we want to trigger the message for player 2 as well.
# This way it gets queued for display during the turn
# replay. Otherwise player 2 would only see the briefing
# after his replay.
[event]
type = message
id = 5
player = 2
trigger = timer
ttime = 0
title = 5
message = 2

# we want to support difficulty levels (handicaps)
#
# if player 1 is handicapped we allocate some more
# crystals to players 2's factory
[event]
type = mining
id = 6
player = 2
trigger = handicap
# 1 is no handicap, 2 is player 1, 4 is player 2
thandicap = 2
building = 1
action = 1
crystals = 35

# if player 2 is handicapped player 1 gets another tank
[event]
type = createunit
id = 7
player = 1
trigger = handicap
thandicap = 4
unit = Medium Tanks
pos = 3/2

### english messages

[messages(en)]
The Great Example
Revision 6 (16-08-2004)
by Jens Granseuer <jensgr@gmx.net>
%
This is a nice introductory message, so that player 1 knows what he is expected to do. Word wraps are done automatically, so don't include line breaks if you don't want them. So, Player 1, let's take them apart:

Either conquer the enemy headquarters or destroy all their troops. %
This should present the situation to player 2.

You are being attacked. Defend yourself. The attack is considered repelled if you gain control of the enemy headquarters or the entire attacking army is no more. %
This is the success message for conquering the enemy headquarters. Congratulations!
%
Hip! Hip! Hurrah!
%
The Great Example
%
The Good
%
The Bad
%
HQ of the Good
%
HQ of the Bad
[/messages]

NOTES

The file format of level files (source and data) is subject to change
without notice. If you get an error "File not of the required type", it mostly should be sufficient to feed the appropriate source file to cfed again to create a valid level file. However, no promises are being
made. You have been warned!

cfed will eventually be phased out in favour of CoMET, the graphical map editor for crimson.

SEE ALSO

crimson(6), bi2cf(6)

COPYRIGHT

Copyright (C) 2000-2007 Jens Granseuer

This software is distributed under the terms of the GNU General Public License[1] (GPL).

AUTHOR

Jens Granseuer <jensgr@gmx.net>
Author.

REFERENCES

1. GNU General Public License
http://www.gnu.org/copyleft/gpl.html
Copyright © 2010-2025 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout