Page MenuHomePhabricator

Map-0.2.9 styctap x.dtd
Updated 1,156 Days AgoPublic

This contains the details on the current Alpha Project DTD files and their proper usage. Please be patient while the documentation of this page is completed!

Table of Contents

  1. Current Files
  2. Pieces
  3. Usage
  4. Special
  5. DTD
  6. Examples

Current Files

map-0.2.9_styctap_v1.0.dtd

map-0.2.9_styctap_v1.1.dtd

map-0.2.9_styctap_v1.2.dtd

map-0.2.9_styctap_v1.3.dtd

map-0.2.9_styctap_v1.4.dtd

map-0.2.9_styctap_v1.5.dtd

Latest DTD release: Lover-Boy/map-0.2.9_styctap_v1.5.dtd

Pieces

Elements

These are the elements you can have in a map file.

Resource
Map
Settings
Setting
World
Field
Axes
Spawn
Wall
Point
Axis
Zone
Teleport
Color
Move
ShapeCircle

Attributes

These are the attributes that contain value depending on on elements in use.

type
name
version
author
category
comissioner
value
logicalBox
number
normalize
x
y
xdir
ydir
angle
length
effect
rubberVal
team
speed
delay
destX
destY
dirX
dirY
modes
reloc
r
g
b
interact
route
radius
growth
rotate

Usage

Note: This documentation is mostly the special features of the dtd and only briefly covers other options. For more detailed information about creating maps, see Making Maps by Hand

.

Resource

This element contains the main map details such as type, name, version, category and author. Below is the descriptions for these attributes.

  • type: the type of map it is. Default: aamap
  • name: the name of the map file. Make sure to use _ instead of " " spaces.
  • version: the version of the map file. Recommended to only use numbers and decimals.
  • category: the category of the map file. If you have many categories, you write like this: {cagetory1}/{category2}.... You can actually have this blank if you don't want it to have one.
  • author: the name of the author who created the map file.

In the end, it will look similar to this:

<Resource type="aamap" name="test" version="1.0.0" author="your_name" category="">
</Resource>

Map

The map element only contains the version and it doesn't really matter what you put here. Default: 0.2.8

<Resource type="aamap" name="test" version="1.0.0" author="your_name" category="">
 <Map version="0.2.8">
 </Map>
</Resource>

Settings

This is where the console commands or server commands go in. This is an optional element which can be used to store your commands and their values within the map to load once map is parsed. This is how it works:

<Resource type="aamap" name="test" version="1.0.0" author="your_name" category="">
 <Map version="0.2.8">
  <Settings>
   <Setting name="command_name" value="command_value" />
   <Setting name="command_name" value="command_value" />
  </Settings>
 </Map>
</Resource>

World & Field

There isn't much particular thing about these two elements except this is where the actual objects will be parsed.

It will look like this:

<Resource type="aamap" name="test" version="1.0.0" author="your_name" category="">
 <Map version="0.2.8">
  <World>
   <Field>
   </Field>
  </World>
 </Map>
</Resource>

Axes

This element is optional which contains whether should be "number" of axes for players to make turns.

Currently the supported number is from 4 - 32\. Anything lower or higher would tend to create bugs and glitches. So, it is strongly recommended that you choose an axes number that is within 4 - 32.

It will look like this:

<Resource type="aamap" name="test" version="1.0.0" author="your_name" category="">
 <Map version="0.2.8">
  <World>
   <Field>
    <Axes number="4" />
   </Field>
  </World>
 </Map>
</Resource>

Special

Here we will talk more about the new attributes and elements for zones. Elements such as

Color
Move
Teleport

are very useful than to actually use DELAY_COMMAND {time} SPAWN_ZONE .... You can even delay zones by simply using delay attribute in the <Zone ... > element.

While most would prefer to use the command based structure, these have proved to be fully functional!

Remember that these special elements are optional to use. That is because the game automatically gives each zone their default color. So, unless you want to give a color for your zone, do not set any of these within the zone.

Another thing to take note is the use of these special elements. While they are good and functional, they can only be set inside the elements of <ShapeCircle>...</ShapeCircle>.

Color

This element is basically set to give the zone its color.

The attributes it uses are:

r - red amount of color (0 - 15)
g - green amount of color (0 - 15)
b - blue amount of color (0 - 15)

For example, here is how it will appear:

<Zone effect="object">
 <ShapeCircle radius="10">
  <Point x="-30" y="60" />
  <Color r="15" g="6" b="8" />
 </ShapeCircle>
</Zone>

Now, it is not required that you have r, g, b. For instance, you could only have r and b or b only. It is totally up to you on the way you use this element.

One thing you should understand is the default color of each zone will vary by default. So, test properly before you set your final color amounts.

Move

This element basically makes your zone to move around if values don't equal to 0.

The attributes it uses are:

xdir - the speed it should travel along the x axes
ydir - the speed it should travel along the y axes
route - If this is specified, it will this route in moving around (must have either xdir or ydir).

The route is similar to how players use the SPAWN_ZONE command.

SPAWN_ZONE effect L x1 y1 x2 y2 x3 y3... Z radius growth xdir ydir interact r g b target_radius

In this case all you got to do is simply specify the x and y positions.

route="x1 y1 x2 y2 x3 y3..."

Here is an example of how it would look like:

<Zone effect="object">
 <ShapeCircle radius="10">
  <Point x="100" y="100" />
  <Move xdir="10" ydir="10" route="100 400 400 100 400 400 100 100" />
 </ShapeCircle>
</Zone>

Teleport

This element helps users to teleport to a different location on the axes. This could be inside/outside the arena.

The attributes used by this element are:

destX - The x coordinate of destination
destY - The y coordinate of destination
dirX - The x direction to travel on the x axis
dirY - The y direction to travel on the y axis
modes - The type of teleport is this? (rel, cycle, abs). Default: abs.
reloc - The factor of the relocation to apply when teleporting.

Here is an example of how it would look like:

<Zone effect="teleport">
 <ShapeCircle radius="10">
  <Point x="100" y="200" />
  <Teleport destX="400" destY="20" />
 </ShapeCircle>
</Zone>

Checkpoint

This element is the checkpoints which players are required to enter to complete the race. Only useful when RACE_TIMER_ENABLED is set. Also, the only way to complete a race is to enter all checkpoints.

The attibutes used by this element are:

id - the id of which the player should enter in. Must be greater than 0 or will not work
time - the amount of time to add or remove from the player's individual countdown for checkpoints. If it's set to 0, no time is added to the countdown.

Here's an example of how it works:

<Zone effect="checkpoint">
 <ShapeCircle radius="10">
  <Point x="300" y="420" />
  <Checkpoint id="1" time="0" />
 </ShapeCircle>
</Zone>

DTD

<!-- version="map-0.2.9_styctap_V1.5" -->
<!-- for 0.2.9-armagetronad-sty+ct+ap -->

<!ELEMENT Resource (Map)>

<!ATTLIST Resource
       type (aamap) "aamap" 
       name CDATA #REQUIRED
       version CDATA #REQUIRED
       author CDATA "Anonymous"
       category CDATA "unsorted"
       comissioner CDATA #IMPLIED
>

<!ELEMENT Map (Settings?, World)> 

<!ELEMENT Settings (Setting*)>
<!ELEMENT Setting EMPTY>
<!ATTLIST Setting name CDATA #REQUIRED>
<!ATTLIST Setting value CDATA #REQUIRED>

<!-- ATM, a map contain only one Field -->
<!ELEMENT World (Field)>
<!-- a field 
  - may have an axes declared
  - need at least one spawn
  - need at least one wall -->
<!ELEMENT Field (Axes?, (Spawn | Wall | Zone)*)>

<!ELEMENT Axes (Axis*)>
<!ELEMENT Spawn (Spawn*)> 
<!ELEMENT Wall (Point+) >
<!ELEMENT Point EMPTY>
<!ELEMENT Axis EMPTY>
<!ELEMENT Zone (ShapeCircle) >

<!ATTLIST Map version CDATA #REQUIRED>

<!ATTLIST Field logicalBox (true | false) "true">

<!ATTLIST Axes number CDATA "4">
<!ATTLIST Axes normalize (true | false) "true">

<!ATTLIST Spawn x CDATA #REQUIRED>
<!ATTLIST Spawn y CDATA #REQUIRED>
<!ATTLIST Spawn xdir CDATA #IMPLIED>
<!ATTLIST Spawn ydir CDATA #IMPLIED>
<!ATTLIST Spawn angle CDATA #IMPLIED>
<!ATTLIST Spawn length CDATA "1.0">

<!ATTLIST Wall height CDATA #IMPLIED>

<!ATTLIST Point x CDATA #REQUIRED>
<!ATTLIST Point y CDATA #REQUIRED>

<!ATTLIST Axis xdir CDATA #IMPLIED>
<!ATTLIST Axis ydir CDATA #IMPLIED>
<!ATTLIST Axis angle CDATA #IMPLIED>
<!ATTLIST Axis length CDATA "1.0">

<!ATTLIST Zone effect ( win | death | fortress | ball | flag | target | sumo  
                        | blast | koh | teleport | object | soccerball | soccergoal
                        | speed | acceleration | rubber | rubberadjust
                        | checkpoint ) "death" >

<!ATTLIST Zone name CDATA "">
<!ATTLIST Zone rubberVal CDATA "0">   <!-- Only works for rubber, rubberadjust zone types -->
<!ATTLIST Zone team CDATA "">         <!-- Only works for death, fortress, ball, flag, soccergoal zone types -->
<!ATTLIST Zone speed CDATA "0">       <!-- Only works for speed, acceleration zone types -->
<!ATTLIST Zone delay CDATA "0">       <!-- time, in seconds, before zone can actually be spawned -->

<!-- Bellow are used for teleport values -->
<!--  Only works with effect="teleport"  -->
<!ELEMENT Teleport EMPTY>
<!ATTLIST Teleport destX CDATA "0">
<!ATTLIST Teleport destY CDATA "0">
<!ATTLIST Teleport dirX CDATA "0">
<!ATTLIST Teleport dirY CDATA "0">
<!ATTLIST Teleport modes ( rel | cycle | abs ) "abs" >
<!ATTLIST Teleport reloc CDATA "1">

<!-- Below are the elements for the checkpoint -->
<!--  Only works with effect="checkpoint"  -->
<!ELEMENT Checkpoint EMPTY>
<!ATTLIST Checkpoint id CDATA #REQUIRED>
<!ATTLIST Checkpoint time CDATA "0">

<!-- Setting zone it's colors -->
<!ELEMENT Color EMPTY>
<!ATTLIST Color r CDATA "15">
<!ATTLIST Color g CDATA "0">
<!ATTLIST Color b CDATA "0">
<!ATTLIST Color hexCode CDATA #IMPLIED>

<!-- Setting zone it's movement direction and the route to follow-->
<!ELEMENT Move EMPTY>
<!ATTLIST Move xdir CDATA "0">
<!ATTLIST Move ydir CDATA "0">
<!ATTLIST Move interact ( true | false ) "false">
<!ATTLIST Move route CDATA "">

<!ELEMENT ShapeCircle ( Point , Color? , Move? , Teleport?, Checkpoint? )>
<!ATTLIST ShapeCircle radius CDATA #REQUIRED>
<!ATTLIST ShapeCircle growth CDATA "0.0">
<!ATTLIST ShapeCircle rotate CDATA "0.3">

Examples

Default Example Map

Lover-Boy/example-1.0.0.aamap.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE Resource SYSTEM "Lover-Boy/map-0.2.9_styctap_v1.5.dtd">
<Resource type="aamap" name="example" version="1.0.0" author="Lover-Boy" category="">
	<Map version="0.2.9_styctap">
		<World>
			<Field>
				<Spawn x="255" y="50" xdir="0" ydir="1"/>
				<Spawn x="245" y="450" xdir="0" ydir="-1"/>
				<Spawn x="50" y="245" xdir="1" ydir="0"/>
				<Spawn x="450" y="255" xdir="-1" ydir="0"/>

				<Spawn x="305" y="100" xdir="0" ydir="1"/>
				<Spawn x="195" y="400" xdir="0" ydir="-1"/>
				<Spawn x="100" y="195" xdir="1" ydir="0"/>
				<Spawn x="400" y="305" xdir="-1" ydir="0"/>

				<Spawn x="205" y="100" xdir="0" ydir="1"/>
				<Spawn x="295" y="400" xdir="0" ydir="-1"/>
				<Spawn x="100" y="295" xdir="1" ydir="0"/>
				<Spawn x="400" y="205" xdir="-1" ydir="0"/>

				<Wall>
					<Point x="0" y="0"/>
					<Point x="0" y="500"/>
					<Point x="500" y="500"/>
					<Point x="500" y="0"/>
					<Point x="0" y="0"/>
				</Wall>

				<Zone effect="teleport" delay="2">
					<ShapeCircle radius="10">
						<Point x="100" y="200"/>
						<Color r="15" g="15"/>
						<Teleport destX="400" destY="20"/>
					</ShapeCircle>
				</Zone>

				<Zone effect="speed" speed="10">
					<ShapeCircle radius="10">
						<Point x="20" y="200"/>
						<Color b="10" r="10"/>
						<Move xdir="10" ydir="0"/>
					</ShapeCircle>
				</Zone>

				<Zone effect="acceleration" speed="10">
					<ShapeCircle radius="10">
						<Point x="200" y="20"/>
						<Color g="10" r="10"/>
						<Move xdir="10" ydir="0"/>
					</ShapeCircle>
				</Zone>

				<Zone effect="object">
					<ShapeCircle radius="10">
						<Point x="-30" y="60"/>
						<Color r="15" g="6" b="8"/>
					</ShapeCircle>
				</Zone>

				<Zone effect="object">
					<ShapeCircle radius="10">
						<Point x="100" y="100"/>
						<Color r="10" g="0" b="15"/>
						<Move xdir="10" ydir="10" route="100 400 400 100 400 400 100 100"/>
					</ShapeCircle>
				</Zone>

				<Zone effect="rubber" rubberVal="1.0">
					<ShapeCircle radius="10">
						<Point x="300" y="200"/>
						<Color r="6" g="15" b="0"/>
					</ShapeCircle>
				</Zone>

				<Zone effect="rubberadjust" rubberVal="0.0">
					<ShapeCircle radius="10">
						<Point x="200" y="200"/>
						<Color r="1" g="12" b="12"/>
					</ShapeCircle>
				</Zone>

				<Zone effect="checkpoint">
					<ShapeCircle radius="10">
						<Point x="500" y="400"/>
						<Color hexCode="0x3399ff"/>
						<Checkpoint id="1" time="15"/>
					</ShapeCircle>
				</Zone>

				<Zone effect="checkpoint">
					<ShapeCircle radius="10">
						<Point x="300" y="400"/>
						<Color hexCode="0x3399ff"/>
						<Checkpoint id="2" time="15"/>
					</ShapeCircle>
				</Zone>

				<Zone effect="win">
					<ShapeCircle radius="10">
						<Point x="500" y="350"/>
					</ShapeCircle>
				</Zone>
			</Field>
		</World>
	</Map>
</Resource>
Last Author
Armanelgtron
Last Edited
Jan 27 2021, 10:06 PM

Event Timeline

Armanelgtron edited the content of this document. (Show Details)Jun 30 2020, 3:29 PM
Armanelgtron created this object.
Armanelgtron changed the title from dtd to Map-0.2.9 styctap x.dtd.Jun 30 2020, 5:40 PM
Armanelgtron edited the content of this document. (Show Details)
Armanelgtron edited the content of this document. (Show Details)Jun 30 2020, 5:55 PM
Armanelgtron edited the content of this document. (Show Details)Jan 27 2021, 10:04 PM
Armanelgtron edited the content of this document. (Show Details)