LESM Installation: Difference between revisions

From MyGamingTalk
(Added Commands info)
(Begin to add config options)
Line 131: Line 131:
}</pre>
}</pre>
If you want more examples I can do them. Please request.
If you want more examples I can do them. Please request.
== Config ==
Found in '''/LESM/save/Config.json''' saves all your config keys it can be edited directly or from ingame. If you are editing ingame with the config commmand you need to use <code>!config save</code> after you have made your changes. Also the config only gets loaded when map restarts, this means if you change the file directly, and then go ingame and type use <code>!config save</code> your changes will be overwritten by what is currently loaded on the server. Now on to the keys
=== AdminWatchConsole ===
If enabled will send adminwatch messages to console print(So it will show up in server log and similar stuff). Only really useful for when you have access to direct server console output.
<br />'''Values:''' ''true'' or ''false''
=== BlockNoSilentFlag ===
If the player does not have the silent command flag '''3''' it will block silent commands that output messages to everyone, such as !afk and !me. For example it will block <code>/me Slaps players</code> & <code>/!me Slaps player</code> & <code>/lua me Slaps player</code>. But it will still allow commands to be used in chat: <code>!me slaps player</code>
<br />'''Values:''' ''true'' or ''false''
=== ConvertNoSilentFlag ===
If the player does not have the silent command flag '''3''' it will convert command to a chat command if enabled. Example: <code>/me Slaps player</code> turns into <code>!me Slaps player</code> in the global chat.
<br />'''Values:''' ''true'' or ''false''
=== ClassHPMax ===
Experimental, only works on silent mod. If enabled it will take the value defined in '''/LESM/extra/Classes.json''' for each class and make it their maximum health.
<br />'''Values:''' ''true'' or ''false''
=== ClassHPRegen ===
Experimental, only works on silent mod. If enabled it will take the value defined in '''/LESM/extra/Classes.json''' for each class and regenerate that amount of health each second.
<br />'''Values:''' ''true'' or ''false''
=== DamagePrint ===
Experimental, only works on silent mod. Allows players to see how much damage they are taking each hit.
<br />'''Warning''' this enabled g_debugBullets which spams the console log with a lot of messages(each hit), use at own risk.
<br />On legacy this feature is greatly expanded with more info on each hit, hopefully silent mod will soon bring et_Damage callback for this feature.
<br />'''Values:''' ''true'' or ''false''
=== DisplayRegister ===
Displays information on how to register and why to register when player connects.
<br />'''Values:''' ''true'' or ''false''
=== EncryptSha1 ===
Uses sha1 for passwords and other similar things. Downside adds about 3/4 a second to load time, upside is no one is gonna figure out the passwords. If not enabled uses a weak string jumbler instead.
<br />'''Values:''' ''true'' or ''false''
=== FreezeStart ===
Uses lua to force clients into the same position for '''FreezeStartTime''' seconds, will also add that time onto the timelimit so no time is lost. Useful to allow clients with bad computers or connections to start at the same time as everyone else. Also prevents bots from being 60 feet ahead at beginning of map.
<br />'''Values:''' ''true'' or ''false''
=== FreezeStartTime ===
Seconds to remain frozen at map start. My suggestion is around 8.
<br />'''Values:''' ''number''
=== PauseStart ===
Similar to '''FreezeStart'''. This will pause the game and immediately unpause the game at the start of the map, so no one can get an unfair start. Disadvantages to this one is that you can't tweak the time paused.
<br />'''Values:''' ''true'' or ''false''
=== MapEnts ===
Enables the map entity functions, for disabling objectives.
<br />'''Values:''' ''true'' or ''false''
=== MapListStart ===
Number to determine where your nextmap variables start. (Usually 1) if in your mapcycle.cfg you have vstr d1 at the end then set this value to '''1'''.
<br />'''Values:''' ''number''
=== MapListVarName ===
Variable name to determine where your nextmap variables start. (Usually d) if in your mapcycle.cfg you have vstr d1 at the end then set this value to '''d'''.
<br />'''Values:''' ''string''
=== MaxReports ===
Number of allowed reports (Through the /report command) per game.
<br />'''Values:''' ''number''
=== ReportToMail ===
Whether or not reports should report to admin mail(Only players with '''Config.Level.Admin''' level and plus can read). If not enabled then reports will save in a json format in '''/LESM/save/''' directory.
<br />'''Values:''' ''true'' or ''false''
=== MetricDistance ===
Whether or not to use metric distance by default in distance output. (Users can change this them self with the metricdistance profile key)
<br />'''Values:''' ''true'' or ''false''
=== MinNameLength ===
Minmum name length before getting renamed to a random name.
<br />'''Values:''' ''number''
=== Rename ===
A list of names to be automatically renamed to a random name.
Example: <code>"Rename": [ "ETPlayer", "UnnamedPlayer" ],</code>
<br />'''Values:''' ''list''
=== SetLevelMax ===
Maximum allowed level distance allowed to promote to. Example: If this were '''2''' and you were level ''10'' you could only promote to level ''8''.
<br />'''Values:''' ''number''
=== ShrubCommandFix ===
A temporary bug fix for using certain shrub commands alongside lua commands of the same name. Shouldn't need this, unless told.
<br />'''Values:''' ''list''
=== SpamProtect ===
Amount of time in seconds (float value) that must pass before using another command.
<br />'''Values:''' ''float number''
=== SpawnWalkthrough ===
If enabled players spawning (Only from spawn, not revive) will be able to walk through players for as long as they have their spawn shield.
<br />Works with g_spawnInvulFair
<br />'''Values:''' ''true'' or ''false''
=== Spec999 ===
Amount of seconds to pass after map has started to check if clients that have no ping/are downloading still should be moved spec.
<br />Set to 0 to disable.
<br />'''Values:''' ''number''
=== TeamBlock ===
Amount of seconds to pass before blocking the team command. To be used with '''TeamBlockMultiplier'''. If a certain player is switch a lot their teamblock will keep getting larger until eventually it will take 10-60 seconds before they can switch team again. This prevents players from constantly switching to the better team, if configured correctly.
<br />Resets each map. Set to 0.0 to disable.
<br />'''Values:''' ''float number''
=== TeamBlockMultiplier ===
Amount to multiply '''TeamBlock''' by. Suggested is between 1.0 and 3.0.
<br />Set to 0.0 to disable.
<br />'''Values:''' ''float number''
=== AutoLevel ===
=== Balance ===
=== Banner ===
=== Blacklist ===
=== ClanTag ===
=== ConnectPrint ===
=== DeathPrint ===
=== Debug ===
=== DynamiteCounter ===
=== Intermission ===
=== JSON ===
=== Karma ===
=== Level ===
=== Log ===
=== Message ===
=== PingMonitor ===
=== Prefix ===
=== Profile ===
=== Sound ===
=== Vote ===
=== Warn ===
=== XpSave ===

Revision as of 01:52, 2 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.

Config

Found in /LESM/save/Config.json saves all your config keys it can be edited directly or from ingame. If you are editing ingame with the config commmand you need to use !config save after you have made your changes. Also the config only gets loaded when map restarts, this means if you change the file directly, and then go ingame and type use !config save your changes will be overwritten by what is currently loaded on the server. Now on to the keys

AdminWatchConsole

If enabled will send adminwatch messages to console print(So it will show up in server log and similar stuff). Only really useful for when you have access to direct server console output.
Values: true or false

BlockNoSilentFlag

If the player does not have the silent command flag 3 it will block silent commands that output messages to everyone, such as !afk and !me. For example it will block /me Slaps players & /!me Slaps player & /lua me Slaps player. But it will still allow commands to be used in chat: !me slaps player
Values: true or false

ConvertNoSilentFlag

If the player does not have the silent command flag 3 it will convert command to a chat command if enabled. Example: /me Slaps player turns into !me Slaps player in the global chat.
Values: true or false

ClassHPMax

Experimental, only works on silent mod. If enabled it will take the value defined in /LESM/extra/Classes.json for each class and make it their maximum health.
Values: true or false

ClassHPRegen

Experimental, only works on silent mod. If enabled it will take the value defined in /LESM/extra/Classes.json for each class and regenerate that amount of health each second.
Values: true or false

DamagePrint

Experimental, only works on silent mod. Allows players to see how much damage they are taking each hit.
Warning this enabled g_debugBullets which spams the console log with a lot of messages(each hit), use at own risk.
On legacy this feature is greatly expanded with more info on each hit, hopefully silent mod will soon bring et_Damage callback for this feature.
Values: true or false

DisplayRegister

Displays information on how to register and why to register when player connects.
Values: true or false

EncryptSha1

Uses sha1 for passwords and other similar things. Downside adds about 3/4 a second to load time, upside is no one is gonna figure out the passwords. If not enabled uses a weak string jumbler instead.
Values: true or false

FreezeStart

Uses lua to force clients into the same position for FreezeStartTime seconds, will also add that time onto the timelimit so no time is lost. Useful to allow clients with bad computers or connections to start at the same time as everyone else. Also prevents bots from being 60 feet ahead at beginning of map.
Values: true or false

FreezeStartTime

Seconds to remain frozen at map start. My suggestion is around 8.
Values: number

PauseStart

Similar to FreezeStart. This will pause the game and immediately unpause the game at the start of the map, so no one can get an unfair start. Disadvantages to this one is that you can't tweak the time paused.
Values: true or false

MapEnts

Enables the map entity functions, for disabling objectives.
Values: true or false

MapListStart

Number to determine where your nextmap variables start. (Usually 1) if in your mapcycle.cfg you have vstr d1 at the end then set this value to 1.
Values: number

MapListVarName

Variable name to determine where your nextmap variables start. (Usually d) if in your mapcycle.cfg you have vstr d1 at the end then set this value to d.
Values: string

MaxReports

Number of allowed reports (Through the /report command) per game.
Values: number

ReportToMail

Whether or not reports should report to admin mail(Only players with Config.Level.Admin level and plus can read). If not enabled then reports will save in a json format in /LESM/save/ directory.
Values: true or false

MetricDistance

Whether or not to use metric distance by default in distance output. (Users can change this them self with the metricdistance profile key)
Values: true or false

MinNameLength

Minmum name length before getting renamed to a random name.
Values: number

Rename

A list of names to be automatically renamed to a random name. Example: "Rename": [ "ETPlayer", "UnnamedPlayer" ],
Values: list

SetLevelMax

Maximum allowed level distance allowed to promote to. Example: If this were 2 and you were level 10 you could only promote to level 8.
Values: number

ShrubCommandFix

A temporary bug fix for using certain shrub commands alongside lua commands of the same name. Shouldn't need this, unless told.
Values: list

SpamProtect

Amount of time in seconds (float value) that must pass before using another command.
Values: float number

SpawnWalkthrough

If enabled players spawning (Only from spawn, not revive) will be able to walk through players for as long as they have their spawn shield.
Works with g_spawnInvulFair
Values: true or false

Spec999

Amount of seconds to pass after map has started to check if clients that have no ping/are downloading still should be moved spec.
Set to 0 to disable.
Values: number

TeamBlock

Amount of seconds to pass before blocking the team command. To be used with TeamBlockMultiplier. If a certain player is switch a lot their teamblock will keep getting larger until eventually it will take 10-60 seconds before they can switch team again. This prevents players from constantly switching to the better team, if configured correctly.
Resets each map. Set to 0.0 to disable.
Values: float number

TeamBlockMultiplier

Amount to multiply TeamBlock by. Suggested is between 1.0 and 3.0.
Set to 0.0 to disable.
Values: float number

AutoLevel

Balance

Blacklist

ClanTag

ConnectPrint

DeathPrint

Debug

DynamiteCounter

Intermission

JSON

Karma

Level

Log

Message

PingMonitor

Prefix

Profile

Sound

Vote

Warn

XpSave