<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to PodballModLua</title><link>https://sourceforge.net/p/podball/wiki/PodballModLua/</link><description>Recent changes to PodballModLua</description><atom:link href="https://sourceforge.net/p/podball/wiki/PodballModLua/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 30 Jul 2014 12:09:45 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/podball/wiki/PodballModLua/feed" rel="self" type="application/rss+xml"/><item><title>PodballModLua modified by Lars Ruoff</title><link>https://sourceforge.net/p/podball/wiki/PodballModLua/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -1,4 +1,4 @@
-# The Lua language scripting interface
+# The Lua Language Scripting Interface

 Podball control modules can be coded as [Lua](http://en.wikipedia.org/wiki/Lua_(programming_language)) scripts.

@@ -18,7 +18,8 @@
 This module needs to contain the functions of the Podball API:

-### Lua Podball API Functions
+
+### Podball Lua API Functions

 * function **getModuleInfo()**
 This stateless function must return a table with static info about the module.
@@ -37,6 +38,7 @@
         return t
     end
 ~~~~~
+

 * function **initMatchTeam(gameSettingsParam, matchSettingsParam)**
@@ -76,7 +78,7 @@

 Be sure to also have a look at the [Lea](https://sourceforge.net/p/podball/code/ci/default/tree/bin/modules/lea/lea.lua) sample module as an example on how to use these functions.

-### Simple Debug Drawing Interface
+### Simple debug drawing interface

 For debugging purposes, it is possible to draw simple shapes on the arena.
 Those will be visible every just after every time step when the control modules have been called. (Use the single step button to step over these time steps). The functions are the following:
@@ -89,4 +91,4 @@

 Draws a line from arena position *from* (a {x,y} vector table) to arena position *to* (a {x,y} vector table).

-As with all coordinates, they are automatically adjusted (remapped) when the team is playing in the right side. So you don't need to worry about that.
+As with all coordinates, they are automatically adjusted (remapped) when the team is playing on the right side. So you don't need to worry about that.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lars Ruoff</dc:creator><pubDate>Wed, 30 Jul 2014 12:09:45 -0000</pubDate><guid>https://sourceforge.net4b1f603b881f4c1845ce97dd4515326813d7dc84</guid></item><item><title>PodballModLua modified by Lars Ruoff</title><link>https://sourceforge.net/p/podball/wiki/PodballModLua/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -3,6 +3,8 @@
 Podball control modules can be coded as [Lua](http://en.wikipedia.org/wiki/Lua_(programming_language)) scripts.

 (Podball needs to be compiled with precompiler directive WITH_MOD_LUA for this to work.)
+
+### Configuration

 Lua modules are specified with type="lua" in the match.settings file.
 Other parameters are:
@@ -15,7 +17,10 @@
 The file name of the main Lua control module.
 This module needs to contain the functions of the Podball API:

-* function getModuleInfo()
+
+### Lua Podball API Functions
+
+* function **getModuleInfo()**
 This stateless function must return a table with static info about the module.

 For example:
@@ -34,14 +39,14 @@
 ~~~~~

-* function initMatchTeam(gameSettingsParam, matchSettingsParam)
+* function **initMatchTeam(gameSettingsParam, matchSettingsParam)**

 This function is called for every new match and once per team.
 For parameter gameSettingsParam, see struct GAMEINFO defined in [podtypes.h](https://sourceforge.net/p/podball/code/ci/default/tree/src/podball/podtypes.h).
 For parameter matchSettingsParam, see struct CMatchSettings defined in [podball.h](https://sourceforge.net/p/podball/code/ci/default/tree/src/podball/podball.h).

-* function getTeamActions(world)
+* function **getTeamActions(world)**

 This function is called for every time step the engine needs a control module action for a team.
 Input: world - The state of the game world containing all object positions among others.
@@ -64,8 +69,24 @@
 A table podActions[1..NPODS] with a vector "a" and the action "action" to perform.
 action is one of 0-do nothing; 1-move; 2-shoot

-* function disposeMatchTeam()
+* function **disposeMatchTeam()**

 This function is called once at the end of a match. It can be used to dispose of allocated resources.

+
 Be sure to also have a look at the [Lea](https://sourceforge.net/p/podball/code/ci/default/tree/bin/modules/lea/lea.lua) sample module as an example on how to use these functions.
+
+### Simple Debug Drawing Interface
+
+For debugging purposes, it is possible to draw simple shapes on the arena.
+Those will be visible every just after every time step when the control modules have been called. (Use the single step button to step over these time steps). The functions are the following:
+
+* function **drawCircle(center, radius)**
+
+Draws a circle at the arena position given by *center* (a {x,y} vector table), with radius given by *radius*.
+
+* function **drawLine(from, to)**
+
+Draws a line from arena position *from* (a {x,y} vector table) to arena position *to* (a {x,y} vector table).
+
+As with all coordinates, they are automatically adjusted (remapped) when the team is playing in the right side. So you don't need to worry about that.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lars Ruoff</dc:creator><pubDate>Wed, 30 Jul 2014 11:58:22 -0000</pubDate><guid>https://sourceforge.netfe4a8086297148daa9f7e48e714073d4074f94d2</guid></item><item><title>PodballModLua modified by Lars Ruoff</title><link>https://sourceforge.net/p/podball/wiki/PodballModLua/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -16,6 +16,56 @@
 This module needs to contain the functions of the Podball API:

 * function getModuleInfo()
+This stateless function must return a table with static info about the module.
+
+For example:
+
+~~~~~
+    function getModuleInfo()
+        local t = {}
+        t["name"] = "Lea"        -- The module's name
+        t["version"] = "1.0.0"   -- A version number of the module
+        t["author"] = "Me"       -- The author of the module
+        t["date"] = "2014-06-01" -- The release date of this module
+        t["min_pods"] = 1        -- The minimum number of pods per team this module supports
+        t["max_pods"] = 12       -- The maximum number of pods per team this module supports
+        return t
+    end
+~~~~~
+
+
 * function initMatchTeam(gameSettingsParam, matchSettingsParam)
+
+This function is called for every new match and once per team.
+For parameter gameSettingsParam, see struct GAMEINFO defined in [podtypes.h](https://sourceforge.net/p/podball/code/ci/default/tree/src/podball/podtypes.h).
+For parameter matchSettingsParam, see struct CMatchSettings defined in [podball.h](https://sourceforge.net/p/podball/code/ci/default/tree/src/podball/podball.h).
+
+
 * function getTeamActions(world)
+
+This function is called for every time step the engine needs a control module action for a team.
+Input: world - The state of the game world containing all object positions among others.
+See WORLDSTRUCT in [podtypes.h](https://sourceforge.net/p/podball/code/ci/default/tree/src/podball/podtypes.h).
+
+As an example:
+
+    world.ball.q.x
+
+Is the x-coordinate of the position of the ball.
+
+    world.team.pods[1].v.y
+
+Is the y-coordinate of the velocity of the first pod of the own team.
+The enemy team is called "otherteam".
+
+NOTE: In order to respect common habits of Lua, pod indices go from 1 to NPODS.
+This includes the variable world.ball.owningpod.
+Return value: Actions of all the pods of the own team:
+A table podActions[1..NPODS] with a vector "a" and the action "action" to perform.
+action is one of 0-do nothing; 1-move; 2-shoot
+
 * function disposeMatchTeam()
+
+This function is called once at the end of a match. It can be used to dispose of allocated resources.
+
+Be sure to also have a look at the [Lea](https://sourceforge.net/p/podball/code/ci/default/tree/bin/modules/lea/lea.lua) sample module as an example on how to use these functions.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lars Ruoff</dc:creator><pubDate>Mon, 21 Jul 2014 19:24:29 -0000</pubDate><guid>https://sourceforge.netd266ee02bacd5dc4f7fda9fcc62d5c8a6ce70d32</guid></item><item><title>PodballModLua modified by Lars Ruoff</title><link>https://sourceforge.net/p/podball/wiki/PodballModLua/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="the-lua-language-scripting-interface"&gt;The Lua language scripting interface&lt;/h1&gt;
&lt;p&gt;Podball control modules can be coded as &lt;a class="" href="http://en.wikipedia.org/wiki/Lua_(programming_language)" rel="nofollow"&gt;Lua&lt;/a&gt; scripts.&lt;/p&gt;
&lt;p&gt;(Podball needs to be compiled with precompiler directive WITH_MOD_LUA for this to work.)&lt;/p&gt;
&lt;p&gt;Lua modules are specified with type="lua" in the match.settings file.&lt;br /&gt;
Other parameters are:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;path&lt;/em&gt;&lt;br /&gt;
The Lua package path. This is where podball tries to search for the Lua file given below. Podball also sets this as the Lua package path, so that the main Lua file can import ("require") other modules located here. It can be given as a relative path to where podball is executed.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;file&lt;/em&gt;&lt;br /&gt;
The file name of the main Lua control module.&lt;br /&gt;
This module needs to contain the functions of the Podball API:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;function getModuleInfo()&lt;/li&gt;
&lt;li&gt;function initMatchTeam(gameSettingsParam, matchSettingsParam)&lt;/li&gt;
&lt;li&gt;function getTeamActions(world)&lt;/li&gt;
&lt;li&gt;function disposeMatchTeam()&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lars Ruoff</dc:creator><pubDate>Tue, 24 Jun 2014 09:54:04 -0000</pubDate><guid>https://sourceforge.net1f080a6846602164a85c13b3210830a6e8481707</guid></item></channel></rss>