1 (edited by ertug 2011-02-13 15:52:43)

Topic: Plugin system for mods

I am starting to work on a plugin system that will use Python or Lua (I haven't decided yet). It is also suggested in the forum as "Plug-in system to allow for new game modes without the need of recompiling" (http://www.teeworlds.com/forum/viewtopic.php?id=5070).

If you have suggestions or want to help, please let me know.

2

Re: Plugin system for mods

matricks tried that too. For 0.6.0_Lua release. I suggest you should try it with Lua either.

3

Re: Plugin system for mods

Post your repo as soon as you got something, I'm interested in it.

4

Re: Plugin system for mods

Yes, Lua seems to be a good choice.

I couldn't found much info or code about the 0.6.0_Lua release, do you have some pointers?


heinrich5991 wrote:

matricks tried that too. For 0.6.0_Lua release. I suggest you should try it with Lua either.

5 (edited by heinrich5991 2011-02-13 14:54:27)

Re: Plugin system for mods

It was abandoned. The project was in the old trac, which isn't hosted anymore. You may ask matricks for that, in IRC (irc.quakenet.org, #teeworlds-dev), but afaik there wasnt much done.

Edit: But you could ask matricks, how he planned to do the Lua integration into teeworlds.

6

Re: Plugin system for mods

I have a PoC commit here:
https://github.com/ertug/teeworlds/comm … e3168f2726

You can clone my repo, it is in plugin_system branch:
git://github.com/ertug/teeworlds.git

It currently sends only tick events to Lua and Lua can call SendChat but it is not hard to add more events and functions.

modname = "LUA"

tickcount = 0

function tick()
   tickcount = tickcount + 1
   if (tickcount % 20) == 0 then
      tw.sendchat(-1, -2, "tick count from lua: " .. tickcount)
   end
end

Help and ideas are welcome.


m!nus wrote:

Post your repo as soon as you got something, I'm interested in it.