<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openclonk.org/index.php?action=history&amp;feed=atom&amp;title=Script%3A_Overview</id>
	<title>Script: Overview - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openclonk.org/index.php?action=history&amp;feed=atom&amp;title=Script%3A_Overview"/>
	<link rel="alternate" type="text/html" href="https://wiki.openclonk.org/index.php?title=Script:_Overview&amp;action=history"/>
	<updated>2026-04-06T07:53:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.3</generator>
	<entry>
		<id>https://wiki.openclonk.org/index.php?title=Script:_Overview&amp;diff=1368&amp;oldid=prev</id>
		<title>Andriel: Added link to next part</title>
		<link rel="alternate" type="text/html" href="https://wiki.openclonk.org/index.php?title=Script:_Overview&amp;diff=1368&amp;oldid=prev"/>
		<updated>2013-08-25T10:55:36Z</updated>

		<summary type="html">&lt;p&gt;Added link to next part&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:55, 25 August 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l24&quot;&gt;Line 24:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 24:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that in Clonk a lot of things are proplists: even objects! You can access the local variables of an object like any proplist elements.&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that in Clonk a lot of things are proplists: even objects! You can access the local variables of an object like any proplist elements.&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Proplists can also contain functions, which are then called with the arrow notation as described above.&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Proplists can also contain functions, which are then called with the arrow notation as described above.&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br/&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The next part of this tutorial about callbacks and timers is [[Script: Callbacks and Timers|&#039;&#039;&#039;here&#039;&#039;&#039;]].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Scripting Tutorial]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Scripting Tutorial]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Andriel</name></author>
	</entry>
	<entry>
		<id>https://wiki.openclonk.org/index.php?title=Script:_Overview&amp;diff=1309&amp;oldid=prev</id>
		<title>Zapper: moved Script:Overview to Script: Overview</title>
		<link rel="alternate" type="text/html" href="https://wiki.openclonk.org/index.php?title=Script:_Overview&amp;diff=1309&amp;oldid=prev"/>
		<updated>2013-01-20T23:02:11Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/w/Script:Overview&quot; class=&quot;mw-redirect&quot; title=&quot;Script:Overview&quot;&gt;Script:Overview&lt;/a&gt; to &lt;a href=&quot;/w/Script:_Overview&quot; title=&quot;Script: Overview&quot;&gt;Script: Overview&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:02, 20 January 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Zapper</name></author>
	</entry>
	<entry>
		<id>https://wiki.openclonk.org/index.php?title=Script:_Overview&amp;diff=1308&amp;oldid=prev</id>
		<title>Zapper at 23:01, 20 January 2013</title>
		<link rel="alternate" type="text/html" href="https://wiki.openclonk.org/index.php?title=Script:_Overview&amp;diff=1308&amp;oldid=prev"/>
		<updated>2013-01-20T23:01:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:01, 20 January 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l25&quot;&gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Proplists can also contain functions, which are then called with the arrow notation as described above.&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Proplists can also contain functions, which are then called with the arrow notation as described above.&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Script &lt;/del&gt;Tutorial]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Scripting &lt;/ins&gt;Tutorial]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zapper</name></author>
	</entry>
	<entry>
		<id>https://wiki.openclonk.org/index.php?title=Script:_Overview&amp;diff=1305&amp;oldid=prev</id>
		<title>Zapper: moved Script:Introduction to Script:Overview</title>
		<link rel="alternate" type="text/html" href="https://wiki.openclonk.org/index.php?title=Script:_Overview&amp;diff=1305&amp;oldid=prev"/>
		<updated>2013-01-20T22:48:29Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/w/Script:Introduction&quot; class=&quot;mw-redirect&quot; title=&quot;Script:Introduction&quot;&gt;Script:Introduction&lt;/a&gt; to &lt;a href=&quot;/w/Script:Overview&quot; class=&quot;mw-redirect&quot; title=&quot;Script:Overview&quot;&gt;Script:Overview&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:48, 20 January 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Zapper</name></author>
	</entry>
	<entry>
		<id>https://wiki.openclonk.org/index.php?title=Script:_Overview&amp;diff=1304&amp;oldid=prev</id>
		<title>Zapper: Created page with &quot;This page should give you a short overview about the characteristics of C4Script in OpenClonk. It should be helpful if you either know some programming and quickly want to see...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.openclonk.org/index.php?title=Script:_Overview&amp;diff=1304&amp;oldid=prev"/>
		<updated>2013-01-20T22:44:06Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This page should give you a short overview about the characteristics of C4Script in OpenClonk. It should be helpful if you either know some programming and quickly want to see...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page should give you a short overview about the characteristics of C4Script in OpenClonk. It should be helpful if you either know some programming and quickly want to see how C4Script feels like or if you come from CR and want to see what changed.&amp;lt;br /&amp;gt;&lt;br /&gt;
If you come from CR scripting, you might want to jump directly to [[#Proplists]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Script files =&lt;br /&gt;
In OpenClonk one script-file usually belongs to an object or is in the global System.ocg directory.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Variables and Data types =&lt;br /&gt;
OpenClonk does not use strict typing, you declare function-local variables with &amp;#039;&amp;#039;var&amp;#039;&amp;#039;, object local variales outside of functions with &amp;#039;&amp;#039;local&amp;#039;&amp;#039; and global variables with &amp;#039;&amp;#039;static&amp;#039;&amp;#039;. Such &amp;#039;&amp;#039;static&amp;#039;&amp;#039; variables might also be declared constant with &amp;#039;&amp;#039;static const&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
Variables which have not been assigned any value yet, contain the value &amp;#039;&amp;#039;nil&amp;#039;&amp;#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameters can have a type that is checked when the function is called.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
Functions can be either declared &amp;#039;&amp;#039;global&amp;#039;&amp;#039; or without an access specifier which would make them object-local.&amp;lt;br /&amp;gt;&lt;br /&gt;
You can call functions from the same object like you would expect with &amp;#039;&amp;#039;FunctionName(parameters...)&amp;#039;&amp;#039;. If you want to call a function in another object, use the arrow notation (&amp;#039;&amp;#039;my_object-&amp;gt;MyFunctionCall(par1, par2, par3);&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
= Arrays =&lt;br /&gt;
Arrays in Clonk are declared with brackets (&amp;#039;&amp;#039;var a = [];&amp;#039;&amp;#039; or &amp;#039;&amp;#039;var a = [3];&amp;#039;&amp;#039;) and grow dynamically when a field is assigned a value for the first time. You can get the length of arrays with &amp;#039;&amp;#039;GetLength()&amp;#039;&amp;#039;.&amp;lt;br/&amp;gt;&lt;br /&gt;
Indices start at 0.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Proplists =&lt;br /&gt;
Proplists are like assoziative arrays (if you come from another programming language, think of a map) and are declared with curly braces (&amp;#039;&amp;#039;var p = {};&amp;#039;&amp;#039; or &amp;#039;&amp;#039;var p = { foo = 1, bar = 2 };&amp;#039;&amp;#039;).&amp;lt;br /&amp;gt;&lt;br /&gt;
You can access elements from a proplist with either the dot-notation &amp;#039;&amp;#039;p.key&amp;#039;&amp;#039; and &amp;#039;&amp;#039;p.key = value;&amp;#039;&amp;#039; or with the brackets and the key as a string (&amp;#039;&amp;#039;p[&amp;quot;key&amp;quot;] = value;&amp;#039;&amp;#039;).&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that in Clonk a lot of things are proplists: even objects! You can access the local variables of an object like any proplist elements.&amp;lt;br/&amp;gt;&lt;br /&gt;
Proplists can also contain functions, which are then called with the arrow notation as described above.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Tutorial]]&lt;/div&gt;</summary>
		<author><name>Zapper</name></author>
	</entry>
</feed>