docs: Add an index to the table of contents

This adds everything that has an id as well as functions.
Günther Brammer 2011-09-05 22:37:47 +02:00
parent 6d6737a022
commit cd75b0a3d2
30 changed files with 96 additions and 128 deletions

View File

@ -31,12 +31,23 @@ class Clonkparser(xml.sax.handler.ContentHandler):
if self.curcat not in self.cats:
self.cats[self.curcat] = { }
self.subcats[self.curcat] = { }
def _addToIndex(self, title, href):
if not title in self.files:
self.files[title] = { self.title: href }
else:
if self.title in self.files[title]:
print "WARNING: duplicate " + title + " in " + href + " and " + self.files[title][self.title]
self.files[title][self.title] = href
def startDocument(self):
self.cur = ""
self.curcat = ""
self.title = ""
self.func = 0
self.state = None
self.id = None
self.idTitle = None
self.idStackdepth = 0
self.Stackdepth = 0
def startElement(self, name, attr):
# subcat inside category?
if self.state == 'category' and self.cur != "":
@ -44,11 +55,18 @@ class Clonkparser(xml.sax.handler.ContentHandler):
# is func
if name == 'funcs':
self.func = 1
self.cur = ""
self.cur = unicode("")
self.state = name
self.Stackdepth = self.Stackdepth + 1
if 'id' in attr:
self.id = attr["id"]
self.idTitle = unicode("")
self.idStackdepth = self.Stackdepth
def characters(self, content):
if self.state in ['category', 'subcat', 'version', 'extversion', 'title', 'funcs']:
self.cur += content
if self.id:
self.idTitle += content
def endElement(self, name):
self.cur = self.cur.strip()
if name == 'category':
@ -87,78 +105,26 @@ class Clonkparser(xml.sax.handler.ContentHandler):
self.func = 0
elif name == 'title':
self.title = self.cur
self.files[self.title] = self.htmlfilename
if self.func == 1:
self._addToIndex(self.title, self.htmlfilename + '#' + self.title.encode('utf-8'))
self.funcs[self.title] = self.htmlfilename
else:
self._addToIndex(self.title, self.htmlfilename)
self.Stackdepth = self.Stackdepth - 1
if self.id and (self.idStackdepth > self.Stackdepth or name == 'col' or name == 'literal_col'):
title = self.idTitle.strip()
href = self.htmlfilename + '#' + self.id.encode('utf-8')
if title == "":
print "WARNING: id " + self.id.encode('utf-8') + " without text content in " + self.filename
else:
self._addToIndex(title, href)
self.id = None
self.idTitle = None
self.cur = ""
self.state = None
def printcontents1(f, _):
f.write('\n <UL>\n')
cats = parser.cats.keys()
cats.sort()
for cat in cats:
f.write(' <LI> <OBJECT type="text/sitemap">\n' +
' <param name="Name" value="' + _(cat) + '">\n' +
' </OBJECT>\n' +
' <UL>\n')
subcats = parser.subcats[cat].keys()
subcats.sort()
for subcat in subcats:
f.write(' <LI> <OBJECT type="text/sitemap">\n' +
' <param name="Name" value="' + _(subcat) + '">\n' +
' </OBJECT>\n' +
' <UL>\n')
titles = parser.subcats[cat][subcat].keys()
titles.sort()
for title in titles:
f.write(' <LI> <OBJECT type="text/sitemap">\n' +
' <param name="Name" value="' + _(title) + '">\n' +
' <param name="Local" value="' +
parser.subcats[cat][subcat][title] + '#' + _(title) + '">\n' +
' </OBJECT>\n')
f.write(' </UL>\n')
titles = parser.cats[cat].keys()
titles.sort()
for title in titles:
f.write(' <LI> <OBJECT type="text/sitemap">\n' +
' <param name="Name" value="' + _(title) + '">\n' +
' <param name="Local" value="' +
parser.cats[cat][title] + '#' + _(title) + '">\n' +
' </OBJECT>\n')
f.write(' </UL>\n')
f.write(' </UL>\n')
def printcontents2(f, _):
f.write(' <UL>\n')
versions = parser.versions.keys()
versions.sort()
for version in versions:
f.write(' <LI> <OBJECT type="text/sitemap">\n' +
' <param name="Name" value="' + _(version) + '">\n' +
' </OBJECT>\n' +
' <UL>\n')
titles = parser.versions[version].keys()
titles.sort()
for title in titles:
f.write(' <LI> <OBJECT type="text/sitemap">\n' +
' <param name="Name" value="' + _(title) + '">\n' +
' <param name="Local" value="' +
parser.versions[version][title] + '#' + _(title) + '">\n' +
' </OBJECT>\n')
titles = parser.extversions[version].keys()
titles.sort()
for title in titles:
f.write(' <LI> <OBJECT type="text/sitemap">\n' +
' <param name="Name" value="' + _(title) + ' (' + _('erweitert') + ')">\n' +
' <param name="Local" value="' +
parser.extversions[version][title] + '#' + _(title) + '">\n' +
' </OBJECT>\n')
f.write(' </UL>\n')
f.write(' </UL>\n')
def printcontents3(f, _):
def printfunctions(f, _):
def folder(name):
f.write("<li>" + name + "\n<ul>\n")
def sheet(url, name):
@ -185,26 +151,23 @@ def printcontents3(f, _):
sheet(parser.cats[cat][title] + '#' + _(title), _(title))
f.write('</ul></li>\n')
f.write('</ul></li>\n')
# folder("Functions by Version")
# versions = parser.versions.keys()
# versions.sort()
# for version in versions:
# folder(_(version))
# titles = parser.versions[version].keys()
# titles.sort()
# for title in titles:
# sheet(parser.versions[version][title] + '#' + _(title), _(title))
# titles = parser.extversions[version].keys()
# titles.sort()
# for title in titles:
# sheetE(parser.extversions[version][title] + '#' + _(title), _(title))
# f.write('</ul></li>\n')
# f.write('</ul></li>\n')
folder("All functions")
funcs = parser.funcs.keys()
funcs.sort()
for func in funcs:
sheet(parser.funcs[func] + '#' + _(func), _(func))
def printindex(f, _):
def folder(name):
f.write("<li>" + name + "\n<ul>\n")
def sheet(url, name):
f.write("<li><emlink href='" + url[4:] + "'>" + name.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;') + "</emlink></li>\n")
folder("Index")
titles = parser.files.keys()
titles.sort(key=unicode.lower)
for title in titles:
ctitles = parser.files[title].keys()
ctitles.sort(key=unicode.lower)
if len(ctitles) == 1:
sheet(parser.files[title][ctitles[0]], _(title))
else:
for ctitle in ctitles:
sheet(parser.files[title][ctitle], _(title + " (" + ctitle + ")"))
f.write('</ul></li>\n')
parser = Clonkparser()
@ -244,7 +207,9 @@ _ = lambda s: s.encode('utf-8')
f, fin = (file("sdk/content.xml", "w"), file("sdk/content.xml.in", "r"))
for line in fin:
if line.find("<!-- Insert Functions here -->") != -1:
printcontents3(f, _)
printfunctions(f, _)
elif line.find("<!-- Insert Index here -->") != -1:
printindex(f, _)
else:
f.write(line)
f.close()
@ -265,12 +230,14 @@ for f, fin in ((file("chm/en/Output.hhk", "w"), file("Template.hhk", "r")),
(file("chm/de/Output.hhk", "w"), file("Template.de.hhk", "r"))):
for line in fin:
if line.find("</UL>") != -1:
for title, filename in parser.files.iteritems():
f.write(" <LI> <OBJECT type=\"text/sitemap\">\n" +
" <param name=\"Name\" value=\"" + _(title) + "\">\n" +
" <param name=\"Local\" value=\"" + filename + "#" + _(title) + "\">\n" +
" </OBJECT>\n")
for title, filenames in parser.files.iteritems():
for ctitle, filename in filenames.iteritems():
f.write(" <LI> <OBJECT type=\"text/sitemap\">\n" +
" <param name=\"Name\" value=\"" + _(title) + "\">\n" +
" <param name=\"Local\" value=\"" + filename + "\">\n" +
" </OBJECT>\n")
f.write(line)
f.close()
fin.close()
_ = lambda s: gt.ugettext(s).encode('iso-8859-1')

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../clonk.xsl"?>
<doc>
<title>Command Line Parameters</title>
<h id="cmdline">Command Line Parameters</h>
<h>Command Line Parameters</h>
<text>The installation directory of Clonk contains various executable program files. Usually programs are started with a double click or from a start menu without additional parameters. When starting programs from a command line shell or script file (batch file), additional command line parameters can be specified.</text>
<part>
<h id="Clonk">Clonk.exe (Windows) clonk (Linux) Clonk (Mac)</h>

View File

@ -115,13 +115,14 @@
<!-- Insert Functions here -->
</ul>
</li>
<!-- Insert Index here -->
</ul>
</part>
<script>
<![CDATA[
(function() {
if (parent == window) return;
var l = parent.location.pathname;
var l = parent.location.href;
// recognize index file as such
if(l.charAt(l.length-1) == "/") l += "index";
@ -129,10 +130,10 @@
var i = 0, a;
var firsta;
while (a = as[i++]) {
if (a.pathname.indexOf(l) != -1) {
//if (!firsta) {
if (a.href.indexOf(l) != -1) {
if (!firsta) {
firsta = a;
//}
}
if (a.parentNode.tagName == "LI") {
if (a.parentNode.className == 'invisi') tb(a.parentNode.firstElementChild.id.slice(3));
}

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>ActMap</title>
<h id="ActMap">ActMap</h>
<h>ActMap</h>
<part>
<text>The ActMap property describes possible actions (i.e., activities like walking and scaling for clonks; or opening/closing doors of buildings), of an object. It is almost always inherited from their definition. The animation phases of each activity are placed as adjacent images in the Graphics.png (and/or Overlay.png). These animations are being referenced using image coordinates in the ActMap. Animations may be started by script (see <emlink href="script/fn/SetAction.html">SetAction</emlink>) or directly by the engine. Some activities - especially those of clonks and animals - use an engine-internal <emlink href="definition/procedures.html">procedure</emlink>, which controls the movement of an object while such an activity is set.</text>
<text>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Animations</title>
<h id="Animations">Animations</h>
<h>Animations</h>
<part>
<text>One of the new possibilities in OC to use 3D models as an object's graphics (see <emlink href="definition/meshes.html">meshes</emlink>) is to combine individual animations. This way the Clonk can easily throw an object while running or jumping, or there can be smooth transitions between single animations.</text>
<text>Every object has a so-called animation stack. It consists of an arbitrary number of entries with a unique priority, called slots. Slots with higher priority overwrite slots with lower priority, however this is only <code>true</code> for bones affected by one of the animations in the higher priority slot. To expand on the example above the throwing animation should be assigned a higher priority then the walking animation so that the movement of the Clonk's arms is taken from the throwing, not from the walking or jumping animation. However since there is no leg movement in the throwing animation the clonk continues to run or jump, respectively.</text>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Object Categories</title>
<h id="Objektkategorien">Object Categories</h>
<h>Object Categories</h>
<part>
<text>An object's category specifies parts of its behavior. For a definition it is set by the Category entry in the DefCore.txt file. Multiple categories can be combined using the binary OR operator.</text>
<text>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>CNAT - Contact Attachment</title>
<h id="CNAT">CNAT - Contact Attachment</h>
<h>CNAT - Contact Attachment</h>
<text>In multiple places the engine uses ContactAttachment values (a bitmask) to manage the orientation of objects and processes. For example, a vertex of an object can have the CNAT bit <em>left</em>. If that object has <emlink href="definition/defcore.html">ContactCalls</emlink> activated, the engine calls on every contact of that vertex with the landscape the object script function <em>ContactLeft</em>. CNAT values are composed of the following bits:</text>
<text>
<table>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Object Definitions</title>
<h id="Objektdefinitionen">Object Definitions</h>
<h>Object Definitions</h>
<part>
<text>Object definitions are used for all game objects in clonk: fire monsters, the wooden hut, and the clonk himself. An object definition is a group file composed from the following components:</text>
<h id="Properties">Object properties</h>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Meshes</title>
<h id="Meshes">Meshes</h>
<h>Meshes</h>
<part>
<text>It is possible to directly use 3D models (meshes) as object graphics. To do so they need to be in OGRE format. For most modeling tools there exist exporter tools, a list can be found on the <a href="http://www.ogre3d.org/wiki/index.php/Exporters">OGRE Wiki</a>. Both the OGRE binary format (*.mesh) and the OGRE XML format(*.mesh.xml) are supported, however it is recommended to always use the binary format whenever possible since it is smaller in size and can be loaded more quickly by the engine. The tool <a href="http://www.ogre3d.org/wiki/index.php/OgreXmlConverter">OgreXMLConverter</a> can convert between the two formats.</text>
<text>The exporter normally creates a mesh file (*.mesh or *.mesh.xml), a skeleton file (*.skeleton or *.skeleton.xml) if the mesh contains bones, a material script (*.material) and potentially used textures. To use the mesh as a Clonk object all generated files need to be copied into the <emlink href="definition/index.html">object definition</emlink> and the mesh file needs to be renamed to Graphics.mesh or Graphics.mesh.xml, respectively. Textures are supported in PNG, JPG and BMP format.</text>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Procedures</title>
<h id="Prozeduren">Procedures</h>
<h>Procedures</h>
<text>For object activity the engine offers various standard procedures which perform typical physcial behaviour. In procedure WALK, for instance, the activity automatically changes to "Jump" if the ground under the feet is lost.</text>
<text>
<table>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Properties</title>
<h id="Properties">Properties</h>
<h>Properties</h>
<part>
<text>Every object has a number of properties that are handled by the engine. Typically, these are inherited from the object's Prototype, an <emlink href="definition/index.html#Objektdefinitionen">Object Definition</emlink>. A Property of an Object Definition is defined with the <code>local</code> keyword in the <emlink href="definition/script.html#Objektscripte">Definition's script</emlink>:</text>
<code>local Name = "$Name$";
@ -19,7 +19,7 @@ Stand = {
</code>
<text>
<table>
<caption id="PropertiesTable">Properties</caption>
<caption id="PropertiesTable">Object Properties</caption>
<rowh>
<col>Name</col>
<col>Data type</col>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Object Scripts</title>
<h id="Objektscripte">Object Scripts</h>
<h>Object Scripts</h>
<part>
<text>Object scripts control the complex behaviour of an object. For details on scripting see the <emlink href="script/index.html">C4Script</emlink> documentation.</text>
<h>Creation</h>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Vertices</title>
<h id="Vertices">Vertices</h>
<h>Vertices</h>
<text>Vertices are the collision points of an object. The outer shape of the object should be rougly marked by vertices. In most cases, four to five vertices are sufficient. Vertex coordinates are relative to the object center.<br/><br/>At these points it is checked whether the object has collided with solid material in the landscape. If an object collides with the landscape, it is slowed down, rotated and/or deviated into another direction. If a vertex gets covered by solid material teh object will be stuck. The friction value of a vertex determines how easily the object will slide at that corner.<br/><br/>If a vertex contains a direction indication (see <emlink href="definition/cnat.html">CNAT - ContactAttachment</emlink>) and ContactCalls are specified, the corresponding contact functions are called in the object script. In this way, an object might react to hitting a wall on the left, the ground at the bottom, etc.<br/><br/>If the object has a SolidMask you should take care that each vertex has at least one pixel of space from the solid area, else the object will be stuck in itself.</text>
<author>Sven2</author><date>2002-04</date>
</doc>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Visibility</title>
<h id="Visibility">Visibility</h>
<h>Visibility</h>
<part>
<text>Every object has a <emlink href="definition/properties.html">property</emlink>, which controls its visibility for players. It may be either <funclink>VIS_All</funclink> or <funclink>VIS_None</funclink> or a bit mask of <funclink>VIS_Owner</funclink>, <funclink>VIS_Allies</funclink>, <funclink>VIS_Enemies</funclink> and <funclink>VIS_God</funclink>, or an array starting with <funclink>VIS_Select</funclink> followed by bools setting the visibility for each player. If the object has a layer, it will only be visible if the layer is visible, unless <funclink>VIS_LayerToggle</funclink> is set for the layer.</text>
<code>this.Visibility = <funclink>VIS_God</funclink> | <funclink>VIS_Owner</funclink> // The object will only be visible for it's owner and the spectators.

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../clonk.xsl"?>
<doc>
<title>Game Data</title>
<h id="Spieldaten">Game Data</h>
<h>Game Data</h>
<text>The game data of clonk is stored in compressed group files which each contain one component or further group files.</text>
<dl>
<dt id="Spielerdateienocp"><img height="16" src="../images/icon_player.png" width="16"/>Player Files (ocp)</dt>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>FolderMap.txt</title>
<h id="FolderMaptxt">FolderMap.txt</h>
<h>FolderMap.txt</h>
<part>
<text>Scenario folders can also contain graphical folder maps for the selection of scenarios. These will be displayed only in the fullscreen menu, not in the editor. See the Western pack for samples.</text>
<text>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Scenario Folder</title>
<h id="Folders">Scenario Folder</h>
<h>Scenario Folder</h>
<part>
<text>Scenario folders are used to group a number of scenarios. Scenario folders are displayed with a book icon in the startup screen which can then be opened to list contained scenarios.</text>
<h id="Components">Scenario Components (ocs)</h>

View File

@ -6,7 +6,7 @@
<title>OpenClonk Documentation</title>
<h>OpenClonk Documentation</h>
<part>
<img src="../images/cpem.gif" width="52" height="52" id="cpem"/>
<img src="../images/cpem.gif" width="52" height="52" alt=""/>
<text>Welcome to the developer documentation for the creation of custom game content. This documentation includes a thorough reference of the game data and its file hierarchy. <br/>
Also included is a script reference which explains the syntax and semantics of Clonk's own scripting language - C4Script. In the script reference, all functions, constants and callbacks that are available for the scripter are documented with example usages.
</text>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Material Definitions</title>
<h id="Materialdefinitionen">Material Definitions</h>
<h>Material Definitions</h>
<part>
<text>Using material definitions you can specify looks and behaviour of the landscape materials.</text>
<h id="MaterialdefinitionsKomponentenMaterialocg">Material Definition Components (Material.ocg)</h>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Material Definitions (ocm)</title>
<h id="ocm">Material Definitions (ocm)</h>
<h>Material Definitions (ocm)</h>
<part>
<text>Material definitions determine looks and behaviour of landscape materials.</text>
<text>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Particle</title>
<h id="Partikel">Particle</h>
<h>Particle</h>
<part>
<text>Particles are lightweight objects which are not synchronized in a network game. This means that on the one hand you can create huge amounts of particles without slowing down the game too much but on the other hand there are only limited options for control of particle behaviour. If the particles are not sufficient for a given effect you have in mind, you can always use true objects instead.</text>
<text>If a particle is defined in a ocd group, any object definition located in the same group is ignored. This used to be a way to allow loading of placeholder options in the old graphics system which didn't support particles.</text>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../clonk.xsl"?>
<doc>
<title>Player controls</title>
<h id="Controls">Player controls</h>
<h>Player controls</h>
<part>
<text>The engine allows to define control commands completely arbitrarily. Own keyboard commands can be added and modified. All supported input devices such as mouse, keyboard and gamepads can be mapped freely and commands can consist of any key combinations or sequences.</text>
<h id="ControlFiles">PlayerControls.txt</h>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Map Generator</title>
<h id="Kartengenerator">Map Generator</h>
<h>Map Generator</h>
<part>
<text>Besides simple dynamic maps defined in Scenario.txt there is also a powerful dynamic map generator for highly complex yet fully random maps.</text>
<text>This generator works with nested layers that can be combined using various operators and to which a material value and various attributes can be assigned to describe their resulting shape. The map generator will generate a map using these layers. The map is then later zoomed to the landscape as a static map would be.</text>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Teams.txt</title>
<h id="Scenariotxt">Teams.txt</h>
<h>Teams.txt</h>
<text>Via the Teams.txt component you can specify in which way groups of players play with or against together in multiplayer melees.</text>
<text>
<table>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Scenarios</title>
<h id="Szenarien">Scenarios</h>
<h>Scenarios</h>
<part>
<text>Scenarios are the playing worlds which the player can select and start from the menu. With their components the scenario designer can adjust freely everything from the landscape, the goals and rules, the available objects and materials to the look in the menu.</text>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Scenario.txt</title>
<h id="Scenariotxt">Scenario.txt</h>
<h>Scenario.txt</h>
<text>In Scenario.txt you can define basic scenario settings including simple dynamic maps, player presets and starting material, game goals, weather conditions etc. Most of these settings can also be made in the scenario properties of the menu system. For more complex settings and mission sequences you will have to write a <emlink href="scenario/script.html">script</emlink>.</text>
<text>Some of the values require four numbers which specify mean, deviation, minimum and maximum. The value which is actually used is computed by <code>BoundBy(mean+Random(2*deviation+1)-deviation,minimum,maximum);</code>.</text>
<text>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Scenario Scripts</title>
<h id="SzenarioScripte">Scenario Scripts</h>
<h>Scenario Scripts</h>
<part>
<text>Scenario scripts can control a general mission sequence or define specific features such as rejoins or special player placement. For documentation of the scripting language see <emlink href="script/index.html">C4Script</emlink>.</text>
<h id="Callbacks">Callbacks overview</h>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>break and continue</title>
<h id="BreakContinue">break and continue</h>
<h>break and continue</h>
<part>
<text>The keywords <code>break</code> and <code>continue</code> are used for finer control of loops:</text>
<text>

View File

@ -7,7 +7,7 @@
<h>Effects</h>
<part>
<text>Any number of effects can be attached to an object. Effects can perform various tasks, thus eliminating the need for helper objects. This is especially of interest for magic spells that act with a given duration.</text>
<h id="Intro">Introduction</h>
<h>Introduction</h>
<text>Effects are, roughly put, dynamic timers with properties that can be attached to objects. Effects themselves have no visible or acoustic representation - for this you would use objects or particles instead - effects are pure scripting helpers. They also offer a general interface that can be used to resolve conflicts of temporary status changes made to objects by other objects at the same time.</text>
<text>Here an example of implementing an invisibility spell without effects:</text>
<code>/* Invisibility spell without effect system */

View File

@ -4,16 +4,16 @@
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Script</title>
<h id="C4ScriptDokumentation">Script</h>
<h>Script</h>
<part>
<h id="Scripte">Introduction</h>
<h>Introduction</h>
<text>Clonk supports its own scripting language: C4Script.</text>
<text>Object definitions and scenarios can contain a script. Function calls made from scenario scripts are considered "global" calls. Function calls made within an object script are considered "local" calls.</text>
<text>For further information on the two types of script see <emlink href="definition/script.html">object scripts</emlink> and <emlink href="scenario/script.html">scenario scripts</emlink>.</text>
<text>C4Script uses a C-style syntax. It includes <emlink href="script/operatoren.html">operators</emlink>, <emlink href="script/NamedVar.html">variable declarations</emlink>, compound statements, conditional statements (<funclink>if</funclink>) and loops (<funclink>for</funclink> and <funclink>while</funclink>).</text>
<h id="Debugging">Debugging</h>
<text>Activate the debug mode in the developer section of the game options to have additional error messages displayed. Anyone writing scripts should do this.</text>
<h id="Funktionen">Functions</h>
<h>Functions</h>
<text>As in other programming languages you can define <emlink href="script/Funcs.html">functions</emlink> in C4Script:</text>
<code>func CreateRock()
{