<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Python modding</title><link>https://sourceforge.net/p/opl2/wiki/Python%2520modding/</link><description>Recent changes to Python modding</description><atom:link href="https://sourceforge.net/p/opl2/wiki/Python%20modding/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 11 Dec 2013 19:10:19 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/opl2/wiki/Python%20modding/feed" rel="self" type="application/rss+xml"/><item><title>Python modding modified by ingen58</title><link>https://sourceforge.net/p/opl2/wiki/Python%2520modding/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v10
+++ v11
@@ -19,4 +19,4 @@

 Recently OPL2 has added support to "hook" your own functions to OPL2 functions. This makes it easier to add functionality to existing features of the game by not making you rewrite the whole code of that feature and just add parts to run before or after it. More info in the API reference.

-
+-PAGE UNDER CONSTRUCTION-
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ingen58</dc:creator><pubDate>Wed, 11 Dec 2013 19:10:19 -0000</pubDate><guid>https://sourceforge.netec03114e33f4423e4d965ebb13a1e8c1028b84f2</guid></item><item><title>Python modding modified by ingen58</title><link>https://sourceforge.net/p/opl2/wiki/Python%2520modding/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v9
+++ v10
@@ -16,3 +16,7 @@

 Also check out the "OPL2 manual" and "OPL2 API reference" here: https://sourceforge.net/projects/opl2/files/docs/
+
+Recently OPL2 has added support to "hook" your own functions to OPL2 functions. This makes it easier to add functionality to existing features of the game by not making you rewrite the whole code of that feature and just add parts to run before or after it. More info in the API reference.
+
+
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ingen58</dc:creator><pubDate>Wed, 11 Dec 2013 19:09:40 -0000</pubDate><guid>https://sourceforge.netacbece8d37135162f7b39e1424cada5dd842cd42</guid></item><item><title>WikiPage Python modding modified by ingen58</title><link>https://sourceforge.net/p/opl2/wiki/Python%2520modding/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v8
+++ v9
@@ -14,4 +14,5 @@
     dir = pl2base.getCurrentDir(__file__) # the current dir
     file = open(dir + 'test.txt', 'r')

+
 Also check out the "OPL2 manual" and "OPL2 API reference" here: https://sourceforge.net/projects/opl2/files/docs/
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ingen58</dc:creator><pubDate>Wed, 06 Feb 2013 11:42:18 -0000</pubDate><guid>https://sourceforge.net20382da7be86ddac07733eeea251c602bbcafed5</guid></item><item><title>WikiPage Python modding modified by ingen58</title><link>https://sourceforge.net/p/opl2/wiki/Python%2520modding/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v7
+++ v8
@@ -13,3 +13,5 @@
     import os
     dir = pl2base.getCurrentDir(__file__) # the current dir
     file = open(dir + 'test.txt', 'r')
+
+Also check out the "OPL2 manual" and "OPL2 API reference" here: https://sourceforge.net/projects/opl2/files/docs/
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ingen58</dc:creator><pubDate>Wed, 06 Feb 2013 11:41:58 -0000</pubDate><guid>https://sourceforge.netf22c8b5aec71585054aa8b191d30455bcf1641fd</guid></item><item><title>WikiPage Python modding modified by ingen58</title><link>https://sourceforge.net/p/opl2/wiki/Python%2520modding/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -11,5 +11,5 @@
 A tip to plugin writers: if your plugin needs some media/data files, here's how have them in the same folder (or subfolder) as the plugin and be able to open them with Python:

     import os
-    dir = os.path.dirname(__file__) # the current dir
+    dir = pl2base.getCurrentDir(__file__) # the current dir
     file = open(dir + 'test.txt', 'r')
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ingen58</dc:creator><pubDate>Tue, 05 Feb 2013 21:26:23 -0000</pubDate><guid>https://sourceforge.net78091361b8c7bda0dd23866ac101563d5847272a</guid></item><item><title>WikiPage Python modding modified by ingen58</title><link>https://sourceforge.net/p/opl2/wiki/Python%2520modding/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -10,8 +10,6 @@

 A tip to plugin writers: if your plugin needs some media/data files, here's how have them in the same folder (or subfolder) as the plugin and be able to open them with Python:

-&lt;code&gt;
-import os
-dir = os.path.dirname(__file__) # the current dir
-file = open(dir + 'test.txt', 'r')
-&lt;/code&gt;
+    import os
+    dir = os.path.dirname(__file__) # the current dir
+    file = open(dir + 'test.txt', 'r')
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ingen58</dc:creator><pubDate>Mon, 07 Jan 2013 14:36:45 -0000</pubDate><guid>https://sourceforge.net21378f125646ebd48b3a248790487b6fedbaa611</guid></item><item><title>WikiPage Python modding modified by ingen58</title><link>https://sourceforge.net/p/opl2/wiki/Python%2520modding/</link><description>&lt;pre&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ingen58</dc:creator><pubDate>Sun, 22 Apr 2012 11:09:56 -0000</pubDate><guid>https://sourceforge.nete657b16de5ef98279aa5963ef253f24b6b749565</guid></item><item><title>WikiPage Python modding modified by ingen58</title><link>https://sourceforge.net/p/opl2/wiki/Python%2520modding/</link><description>&lt;pre&gt;--- v3 
+++ v4 
@@ -13,5 +13,5 @@
 &lt;code&gt;
 import os
 dir = os.path.dirname(__file__) # the current dir
-file = open(dir + 'test.txt, 'r')
+file = open(dir + 'test.txt', 'r')
 &lt;/code&gt;
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ingen58</dc:creator><pubDate>Sun, 22 Apr 2012 11:09:26 -0000</pubDate><guid>https://sourceforge.net59d6db122344652d92b9c5c39531e2ad7bdfafeb</guid></item><item><title>WikiPage Python modding modified by ingen58</title><link>https://sourceforge.net/p/opl2/wiki/Python%2520modding/</link><description>&lt;pre&gt;--- v2 
+++ v3 
@@ -10,8 +10,8 @@
 
 A tip to plugin writers: if your plugin needs some media/data files, here's how have them in the same folder (or subfolder) as the plugin and be able to open them with Python:
 
-`
+&lt;code&gt;
 import os
 dir = os.path.dirname(__file__) # the current dir
 file = open(dir + 'test.txt, 'r')
-`
+&lt;/code&gt;
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ingen58</dc:creator><pubDate>Sat, 21 Apr 2012 18:40:57 -0000</pubDate><guid>https://sourceforge.netb389a3acccd336c7eac6dd27b76e70de7c40a32b</guid></item><item><title>WikiPage Python modding modified by ingen58</title><link>https://sourceforge.net/p/opl2/wiki/Python%2520modding/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -1,1 +1,17 @@
-TODO: Python script mods will be added in the next release.
+Python plugins (mods) have been added in R2.
+
+Any Python script put in the folder "opl2_data/plugins/startup" is imported on startup.
+Also an additional "%PY" command has been added to the PL2 scripting language, which allows you to import Python scripts from PL2 TXT scripts, from the folder "opl2_data/plugins".
+Keep in mind that the "%PY" command is obviously not available in the original game, so by using it you make your TXT script invalid for the original PL2 game engine.
+
+Another very important thing must be noted: Python is a general-purpose programming language, which means Python plugins for OPL2 can do anything any other program can: from downloading files from the internet to erasing entire folders. So "with great power, comes great responsibility", don't sue us if someone made a fake plugin which is really virus.
+
+There are some example plugins here: http://sourceforge.net/projects/opl2/files/sample-plugins/
+
+A tip to plugin writers: if your plugin needs some media/data files, here's how have them in the same folder (or subfolder) as the plugin and be able to open them with Python:
+
+`
+import os
+dir = os.path.dirname(__file__) # the current dir
+file = open(dir + 'test.txt, 'r')
+`
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ingen58</dc:creator><pubDate>Sat, 21 Apr 2012 18:38:53 -0000</pubDate><guid>https://sourceforge.net9f06acc04c6942d273cd430f89b8159e9bd06bc7</guid></item></channel></rss>