1 (edited by Pata 2012-05-31 09:11:08)

Topic: [Tutorial] How to set up a Lua-Server

How to set up a Lua-Server?

Requirements: ability to set up a normal server, the newest n-Server (Download) or use the one which comes with the Zomb-Mod ), the n-client in order to play on the server (Download ), and a Lua Mod (we will use the Zomb-Mod by Map94 in this tutorial (Download ) )


Step 1: Extract all the files
Step 2: Now make a new directory (call it "Lua-Teeworlds" or whatever u want)
Step 3: Put all the files from the server and the client into your new directory
It should look like this: http://patabanana.de/images/own/Luateeworls.png

Step 4: add the mod by copying the files of the mod into your Lua-Teeworlds directory.
(Note: If the mod is not splitted in folders and there are no further instructions, just copy all mod-files into the lua folder)

Step 5: Open the autoexec.cfg in your application data folder for teeworlds

Step 6: Add the command "add_lua_file NameOfFile.lua" to bind a lua script to your server,
in this example write "add_lua_file server.lua" (which is the main lua script of the Zomb-Mod)
You can split your mod in subdirectories such as /lua/Zomb/, in order to add the file now just write the relative path from your lua folder. You can rename the .lua file in most cases too. (e.g.: "add_lua_file Zomb/main.lua").
You can add a lua file while the server is running via the rcon too.

(In order too play Zomb you have to deactivate teambalancing, and the command "add_vote "Start" lua StartRound" in your autoexec.cfg is recommened, but you can also start a round with the rcon command "lua StartRound")

Step 7: Start the Serverand be happy big_smile



Lua-documentation for server functions and events:
https://github.com/MAP94/teeworlds/blob … tation.lua

2

Re: [Tutorial] How to set up a Lua-Server

I'm sorry but what is Lua / what does it stand for? is it the Zombie mod?

3

Re: [Tutorial] How to set up a Lua-Server

Lua itself is a programming language. In combination with teeworlds you are allowed to bind lua files to your running client/server which is like modding your client while its running smile

4

Re: [Tutorial] How to set up a Lua-Server

Let's say modding without recompiling, not while it's running?

5

Re: [Tutorial] How to set up a Lua-Server

Thank you Patafix smile

6

Re: [Tutorial] How to set up a Lua-Server

:*

7

Re: [Tutorial] How to set up a Lua-Server

Here is a documentation for lua-functions and events:
https://github.com/MAP94/teeworlds/blob … tation.lua

8

Re: [Tutorial] How to set up a Lua-Server

Hey, this looks like really good work, congratulations !

I have a few questions :
- Does this run under linux ?
- Is there an event for when the game ends ?
- Can the modded server be played using the official teeworlds client ?

Also, are there other mods besides Zomb using your lua support ?
I see how it makes modding a lot easier smile

Developper of teeworlds-stats.info