LESM Installation: Difference between revisions

From MyGamingTalk
Jump to navigation Jump to search
(Added updating section)
(Added Commands info)
Line 89: Line 89:
Grammar is more of a spellcheck and is used when players have the ''grammarcheck'' key.
Grammar is more of a spellcheck and is used when players have the ''grammarcheck'' key.
SwearFilter replace swear words with less vulgar words.
SwearFilter replace swear words with less vulgar words.
== Commands ==
The '''/LESM/save/Commands.json''' file decides what command gets loaded, and who can use it. This file needs to be updated each time a new command is added in a new version. When it comes with the release package it only contains a list of paths to lua commands. After it LESM loads it will then update the Commands.json to include: '''auth force level load login''' keys. These keys you can toggle to control loading commands(Explained below).
=== load ===
If load is set to '''true''' the command will load if the conditions are right. Almost all commands will be loaded, except for certain ones on certain mods, for example: Admintest on silent mod, since silentmod already has admintest. If load is set to '''false''' then the command will not load no matter what. By default all the commands '''load''' will be set to '''true'''.
=== force ===
If force is set to '''true''' it will force the command to load even if the command isn't supposed to load(Like admintest in the above example). If set to '''false''' nothing special happens and it will continue on default behavior. If you force load a command it may produce odd results. By default all of the commands '''force''' are set to '''false'''.
=== level ===
Set this to the minimum level required to use this command, or set to 0 to allow everyone to use the command. By default this key is set to either 0, Config.Level.Admin, or Config.Level.Leader depending on the command on first run.
=== login ===
If login is set to '''true''' then you must be logged into a profile to use this command. If set to '''false''' you are not required to be logged in. The default value for this depends on the command.
=== auth ===
If auth is set to '''true''' then you must be logged into a profile '''and''' have the '''authorize''' profile key set to '''true''' to use this command. The default value for this depends on the command.
=== path ===
Path is the path to the lua command file relative to '''/fs_homepath/fs_game/'''
=== Examples ===
Let's say for example you want to give all your admins level 5 and up access to the ammo command. What I changed here from default is I set login and auth to false, and set level to 5.
<pre>{
    "auth": false,
    "force": false,
    "level": 5,
    "load": true,
    "login": false,
    "path": "LESM/commands/ammo.lua"
}</pre><br />
Now let us say we do not like the afk command, so we want to disable the afk and back command.
So we simply change load to false in both commmands: <pre>
{
    "auth": false,
    "force": false,
    "level": 0,
    "load": false,
    "login": false,
    "path": "LESM/commands/afk.lua"
}, {
    "auth": false,
    "force": false,
    "level": 0,
    "load": false,
    "login": false,
    "path": "LESM/commands/back.lua"
}</pre>
If you want more examples I can do them. Please request.

Revision as of 01:22, 1 May 2015

Lua Enhanced Server Mod Install Guide

This guide will teach you how to install LESM on your server. Please read it carefully. When I refer to the server's mod directory I mean: /etdirectory/mod/ Your qagame.mp.i386.so or qagame.mp.i386.dll will be in this directory. Example: /home/et/silent/ JSON Files can be picky when editing them, you can use jsonformatter to ensure you have valid JSON format, if they are not valid it will cause errors.

Requirements

The only requirement is that you have lua 5.1 installed on your server. For silent mod, it comes with the mod and you do not need to make any further adjustments. For other mods you will need to follow their instructions on how to install it. Usually it just requires you to download the lua 5.1 library, and using a specific qagame.

Download LuaESMod

Download LuaESMod and extract it to some temporary folder on your computer.

Install

The Files/Folders you need are: LuaESMod.lua and the entire LESM folder. Upload those to your server's mod directory. Next you will need to go into your server config edit your lua_modules cvar to include LuaESMod.lua Will look something like set lua_modules "LuaESMod.lua" or set lua_modules "LuaESMod.lua test.lua testlua2.lua" Note: If your server uses a seperate fs_homepath you will need to manually create the following directories: /fs_homepath/mod/LESM/ /fs_homepath/mod/LESM/save/ /fs_homepath/mod/LESM/extra/ /fs_homepath/mod/LESM/logs/ (Also you will need to make sure Commands.json is in /fs_homepath/mod/LESM/save/Commands.json Basic rule of thumb is you keep luas in fs_basepath/fs_game/ and everything else can go into fs_homepath/fs_game/

First Run

Restart/start your server. You can verify if the script is running by typing: lua_status in rcon If it is running then you can continue on to configuring the server. The configuration file is /LESM/save/Config.json you may edit values there. If your config fails to load for some reason or there are keys that were missing, a ConfigDefaults.json will be created with your old values and new values. This file is just for you to read and copy to Config.json if you wish, it is not actually loaded ever. The most important values are Level.Leader and Level.Admin as this determines the level at which you can use some commands.

Updating

If you are updating from a previous version it is basically the same thing as installing, you will overwrite all the lua files. There is Commands.json shipped with releases so the lua will know which commands were added. This only needs to be replaced if the new lua version adds a command, if it doesn't then you do not need to bother. If it does add a command but you have already edited your Commands.json and you do not want to lose your changes, you will need to find out which commands were added and add a section for each new command to your Commands.json.

Other Config Files

Other specific configuration files:

Colors

Colors are saved in /LESM/save/Colors.json If you want to change the color scheme you can that do that in this file. There are 3 keys in here you probably want to change to match your server's theme Primary Is your main message color, white is a safe bet, definitely don't use black as it is hard to see. Secondary Is the color used to highlight important information Tertiary Is used for symbols or brackets surrounding text The capital letter keys like LIGHT_BLUE are currently not used, in the future they may be used. The rest are command colors, used in the help command.

Banners

Banners are saved in /LESM/save/Banners.json See related config options here If you want to use banners you will need to edit this file. Each message in a quote is a new banner. When making banner messages you can use <color1> to use your Color.Primary <color2> to use Color.Secondary and <color3> to use Color.Tertiary You can still use normal color codes though if you wish. The beginning of the file must start with a [ and end of the file must end with ] Also every new message must end with , UNLESS it is the last one which ends with nothing In the example will Color.Primary equals ^7 Color.Secondary equals ^5 and Color.Tertiary equals 2 So for example: [ "<color1>Registration <color2>required<color1> for xpsave and admin level<color3>!", "<color1>Autolevel up to level <color2>600", "<color3>/<color2>lua help<color1> to view all your commands<color3>!" ] Means the messages are: ^7Registration ^5required^7 for xpsave and admin level^2! ^7Autolevel up to level ^5600 ^2/^5lua help^7 to view all your commands^5!

Rules

Sounds are saved in /LESM/save/Rules.json If you want to use the rules command, or add rules to banners then you will need to edit this file. Same rules apply to Rules that apply to Banners

Sounds

Rules are saved in /LESM/save/Sounds.json Sounds are kind of complex, and are not meant to be created manually, though they could if you really wanted. I package a python script that will create a Sounds.json from all the sounds in a pk3 named sounds.py If you do not know how to use a python script, post on forums with a link to your sounds pk3 I can easily get you setup. Once you have your generated Sounds.json you are good to go However if you want to edit what level each sound requires to play you can do that before you put it on your server You can also do this ingame with the playsound command !playsound hello level 5 you need to be a leader of authorized to do this

Maps

Maps is just a list of your map vote pool and is found in /LESM/save/Maps.json Will look something like this: [ "adlernest", "oasis", "frostbite" ] To get info for this list type in rcon: dir maps bsp You can try manually creating this list. Or post on forums and we will create one for you.

Grammar/SwearFilter

Found in /LESM/save/Grammar.json and /LESM/save/SwearFilter.json Grammar is more of a spellcheck and is used when players have the grammarcheck key. SwearFilter replace swear words with less vulgar words.

Commands

The /LESM/save/Commands.json file decides what command gets loaded, and who can use it. This file needs to be updated each time a new command is added in a new version. When it comes with the release package it only contains a list of paths to lua commands. After it LESM loads it will then update the Commands.json to include: auth force level load login keys. These keys you can toggle to control loading commands(Explained below).

load

If load is set to true the command will load if the conditions are right. Almost all commands will be loaded, except for certain ones on certain mods, for example: Admintest on silent mod, since silentmod already has admintest. If load is set to false then the command will not load no matter what. By default all the commands load will be set to true.

force

If force is set to true it will force the command to load even if the command isn't supposed to load(Like admintest in the above example). If set to false nothing special happens and it will continue on default behavior. If you force load a command it may produce odd results. By default all of the commands force are set to false.

level

Set this to the minimum level required to use this command, or set to 0 to allow everyone to use the command. By default this key is set to either 0, Config.Level.Admin, or Config.Level.Leader depending on the command on first run.

login

If login is set to true then you must be logged into a profile to use this command. If set to false you are not required to be logged in. The default value for this depends on the command.

auth

If auth is set to true then you must be logged into a profile and have the authorize profile key set to true to use this command. The default value for this depends on the command.

path

Path is the path to the lua command file relative to /fs_homepath/fs_game/

Examples

Let's say for example you want to give all your admins level 5 and up access to the ammo command. What I changed here from default is I set login and auth to false, and set level to 5.

{
     "auth": false,
    "force": false,
    "level": 5,
     "load": true,
    "login": false,
     "path": "LESM/commands/ammo.lua"
}


Now let us say we do not like the afk command, so we want to disable the afk and back command.

So we simply change load to false in both commmands:

{
     "auth": false,
    "force": false,
    "level": 0,
     "load": false,
    "login": false,
     "path": "LESM/commands/afk.lua"
}, {
     "auth": false,
    "force": false,
    "level": 0,
     "load": false,
    "login": false,
     "path": "LESM/commands/back.lua"
}

If you want more examples I can do them. Please request.