Server Clearance - Script Release


(phisherman) #1

Hi everybody

Our clan’s gameserver that has been dead and empty for half a year is now finally closing down by the end of this month. Since I have invested a lot of time and effort in that server, I don’t want all my work to fade away with it. That’s why I decided to share it with you and release everything. We’re basically talking about some ETpro-mapscripts and lua-scripts here. I’ll be starting with the custom-vote-lua today, and as soon as we’re done with discussing that, we’ll go on with another script. That’s just some basic information so you know what I’m talking about and why I’m doing that, so let’s get started:

That’s what I’ve got so far:

[post=361738]Episode I - Advanced Voting LUA[/post]
[post=363044]Episode II - Clantag Protection LUA[/post]
[post=376939]Episode III - Nextmap Announce LUA[/post]
[post=377700]Episode IV - Connect Announce LUA[/post]
[post=389434]Episode V - Axis Lab Mapscript[/post]
[post=495424]Episode VI - Italy FP2 Mapscript[/post]
[post=508963]Episode VII - No Pro LUA[/post]
[post=541023]Episode VIII - Showmaps Client Command LUA[/post]
[post=556190]Episode IX - Team Balance LUA[/post]


Team Force Balance
(twt_thunder) #2

Nice will these work on etpub and other with lua scripting?


(ailmanki) #3

Very nice!
There are already so many options, hard to think of any…
After long thinking :D, botwar and botskill could be add.

Mapvoting could be interessting, to let vote for nextmap ~7min before map ends. A vote which shows a selection of 5 maps, but difficult to manage the vote for more then 2 maps by f1/f2…

I know this kind of voting system from another game, and I prefer it to what is available today in etpub.


(Avoc) #4

I once saw on a server, that someone could write questions on the server that people then voted yes or no on. Is there such a luascript for etpro?


(iddqd) #5

Well done! Really great work.

@Avoc, it was “/callvote cointoss [message]” or like in NoQuarter “/callvote poll [message]


(stealth6) #6

Isn’t this a default voting option?

/callvote generic “Vote yes or no”

EDIT: just tried it, but seems to be a jaymod feature


(phisherman) #7

[QUOTE=thunderpwn;333602]Nice will these work on etpub and other[/QUOTE]Partially yes, but not entirely. I created this script for NQ, but to ensure compatibility with other mods I made a list of what each command does so you can see whether or not the used commands/cvars are available for jaymod/etpub/etpro etc. Since somebody decided that [table] is a useless BBtag, you can find the list here. EDIT: DOWNLOAD REMOVED

I would really appreciate if somebody who really knows about a certain mod could go through the list and tell me “Look this feature does work with this mod but you need to use this cvar instead of that one, and the next feature does not work at all with this mod…”. That would help me a lot in making this script mod-independent because especially the wars and the bot-settings vary from mod to mod, I guess. Oh and please tell me whether or not cointoss is already built into that mod.[QUOTE=ailmanki;333871]After long thinking […], botwar and botskill could be add.[/quote]I’ll sure do, but you have to enlighten me what these two options should actually do… [noparse]:p[/noparse]


(Mateos) #8

Botwar put the bots one side, so you obtain players vs bots.

Command is /bot botwar <botTeam> <humanTeam> <botsPerHuman> client side, !botwar etc in server side.
Related omni-bot.cfg part (This one is the default):
[Versus]
BotTeam = -1
HumanTeam = 1
BotsPerHuman = 3

Botskills should modify the bots skill level, from 0 to 6 if I’m not wrong… Can’t find it…


(ailmanki) #9

Mateos is right, botskill would be for changing difficulty of the bots. /bot difficulty #

I will make a list of the commands you have there for other mods. Have to test a few, like g_knifeonly for the knifewar.
I am curious how you implemented the voting, if its also shown where the original vote is?


(phisherman) #10

[QUOTE=ailmanki;334336]I am curious how you implemented the voting, if its also shown where the original vote is?[/QUOTE]Yes, it’s not a big thing actually. I just added buttons that call polls when you hit them. And the lua script is parsing the print events on the server, and if one of the pre-defined polls pass, something happens.

Thanks for the explanations of botwar and botskill, I’ll add that. About the implementation: Botskill is not difficult, I’ll just add 6 buttons, one for each difficulty. But since botwar has more than one parameter, we need something more complicated. This is what I got so far:

What we need to do now is find reasonable values for <botsPerHuman>. I need to part the VAR button for that, so we should maybe limit the amount of available options to 4 or 5. What would be good values for <botsPerHuman>? “0.5/1/2/3”? I really dont know and I’m open to almost anything.

//Or is it a bad idea to let people actually choose? Should the admin define a static value for <botsPerHuman> and players can only vote on humanteam/botteam?[quote=ailmanki;334336]I will make a list of the commands you have there for other mods.[/quote]Big thanks, this would really help me a lot. [noparse]:)[/noparse]


(phisherman) #11

[QUOTE=ailmanki;334336]I am curious how you implemented the voting, if its also shown where the original vote is?[/QUOTE]Yes, it’s not a big thing actually. The buttons simply call pre-defined polls when you hit them. And the lua script is parsing the prints on the server, and if one of the pre-defined polls pass, something happens.

Thanks for the explanations of botwar and botskill, I’ll add that. About the implementation: Botskill is not difficult, I’ll just add 6 buttons, one for each difficulty. But since botwar has more than one parameter, we need something more complicated…

I’ll add a cvar or lua variable that allows the admin to set a value for <botsPerHuman>. And players can call votes on botwar and choose the team the human players shall be on. Any concern about that?
//Ah, we need another button to disable it again…[quote=ailmanki;334336]I will make a list of the commands you have there for other mods.[/quote]Big thanks, this would really help me a lot. [noparse]:)[/noparse]

//I was thinking about maxBots: On our server, we used a range from 8-14. But the maxbots-settings differ significantly from server to server. So how can I find a solution that fits for everybody? The key might be to select percentages instead of absolute numbers. The admin would define a maxbots-setting inside the lua-script and players would just see percentages. But then players wouldnt be able to see how many bots they actually vote for…


(Mateos) #12

Selecting MaxBots would open a submenu with different values?

By pourcentage, it would need to check the maxclients cvar as 100%?


(Tr3B) #13

I would like to bundle your scripts with ETXreaL.


(ailmanki) #14

“ENDMAP” “g_timelimit .05”
“THIRDPERSON MODE” (Toggle) “forcecvar cg_thirdperson [1/0]”
“HEADSHOT MODE” (Toggle) “g_headshot [1/0]”
“FLY MODE” (Toggle) “g_gravity [200/800]”
“TIMELIMIT +5” “g_timelimit [+5]”
“TIMELIMIT +10” “g_timelimit [+10]”
“ADD BOTS” “bot maxbots [8/10/12/14]”
“KICK BOTS” “bot maxbots -1 ; bot kickall”
“UNLOCK TEAMS” “![un]lock [b/r]”

NoQuarter:
“GLOW MODE” (Toggle) “!glow” + “!glow %playername%” on every playerspawn
“DOUBLEJUMP” (Toggle) “g_doublejump [1/0]”
“KNIFEWAR” (Toggle) “nq_war [2053/0] ; jp_insanity [+16/-16]”
“PANZERWAR” (Toggle) “nq_war [2057/0] ; jp_insanity [+16/-16]”
“SNIPERWAR” (Toggle) “nq_war [2065/0] ; jp_insanity [+16/-16]”

Jaymod (2.2.0):
“GLOW MODE” (toggle) “g_glow [1/0]”
“DOUBLEJUMP” (bitflag) “g_misc [+1/-1]”
“KNIFEWAR” (Toggle) “g_knifeonly [1/0]”
“PANZERWAR” (Toggle) “g_panzewar [1/0]”
“SNIPERWAR” (Toggle) “g_sniperwar [1/0]”

silEnTmod (0.3.3)
“GLOW MODE” (toggle) “” not existing
“DOUBLEJUMP” (bitflag) “g_misc [+1/-1]”
“KNIFEWAR” (Toggle) “g_knifeonly [1/0]”
“PANZERWAR” (Toggle) “g_panzewar [1/0]”
“SNIPERWAR” (Toggle) “g_sniperwar [1/0]”
“RIFLEWAR” (Toggle) “g_riflewar [1/0]” add this one…

etpub (0.8.1)
“GLOW MODE” (toggle) “” not existing according to this :confused:
“DOUBLEJUMP” (bitflag) “g_misc [+1/-1]”
“KNIFEWAR” (Toggle) “g_knifeonly [1/0]”
“PANZERPARTY” (Toggle) “g_partyPanzersEnabled [1/0]”
“SNIPERWAR” (Toggle) “”

etpub (0.9.1)
“GLOW MODE” (toggle) “” not existing
“DOUBLEJUMP” (bitflag) “g_misc [+1/-1]”
“KNIFEWAR” (Toggle) “g_knifeonly [1/0]”
“PANZERWAR” (Toggle) “g_panzewar [1/0]”
“PANZERPARTY” (Toggle) “g_partyPanzersEnabled [1/0]” its in docu, but I thought its not existing anymore … :confused:
“SNIPERWAR” (Toggle) “g_sniperwar [1/0]”
“RIFLEWAR” (Toggle) “g_riflewar [1/0]” add this one…

I wonder if this ‘print’ can be catpured with every mod, I guess when I tried I made some misstake.


(phisherman) #15

[QUOTE=Mateos;335291]Selecting MaxBots would open a submenu with different values?[/quote]Exactly. If nobody comes up with a great idea I havent thought about yet, I think I’ll leave it like that.[QUOTE=Mateos;335291]By pourcentage, it would need to check the maxclients cvar as 100%?[/QUOTE]No, I’ll add a variable (or probably a cvar) to the lua script that defines the maxbots setting. Clients can see the absolute numbers of the corresponding percentages by hitting the “QUERY MAXBOTS SETTING”-button. It’ll print the information to the console and open it. It’s not professional, but it’s all I can do with UIscript. If one of the maxbots-votes is called, the lua script will print a line to chat displaying the related absolute number so the other players can see it at a glance and don’t have to open the console and check themselves.

@ailmanki: Big thanks for the list! You really did me a favour with that. [noparse]:)[/noparse] As long as nobody comes up with a list for another mod, these are going to be the only mods supported: NoQuarter/Jaymod/silEnTmod/etpub. If anybody out there wants support for other mods, please give me such a list for it![QUOTE=ailmanki;335494]“THIRDPERSON MODE” (Toggle) “forcecvar cg_thirdperson [1/0]”
“HEADSHOT MODE” (Toggle) “g_headshot [1/0]”[/quote]Are you sure that both of them are vanillaET-features? I’m not sure about forcecvar, but according to the NQwiki g_headshot is a NQ-feature. Do all your suggested mods support g_headshot (at least bitflag 1, the rest most likely is NQ-only anyway)?[QUOTE=ailmanki;335494]“RIFLEWAR” (Toggle) “g_riflewar [1/0]” add this one…[/quote]]>added to TODO…[QUOTE=ailmanki;335494]“PANZERPARTY” (Toggle) “g_partyPanzersEnabled [1/0]”[/quote]What is that? o.O[quote=ailmanki;335494]I wonder if this ‘print’ can be catpured with every mod, I guess when I tried I made some misstake.[/quote]The function is called et_Print and unfortunately there’s no way I could do without it…[QUOTE=Tr3B;335391]I would like to bundle your scripts with ETXreaL.[/QUOTE]Help yourself, as soon as I’m done with it everybody’s free to do with it whatever they want to. [noparse]:)[/noparse]


(ailmanki) #16

oh g_headshot overlooked that one.
etpub 0.81 - could not find a easy equivalent. Though it seems possible, there are many cvars for damage.
g_dmg* so setting each one to 0 , and the minheadshot to something… might work - I never tried that.

etpub 0.91, jaymod and silEnTmod share the same settings for this cvar.
“HEADSHOT MODE” (bitmask) “g_headshot [+1/-1]”

All these mods can do ‘forcecvar’.

for etpub 0.81 is another speciality, it has only support for omnibot 0.66, that version has no botwar cmd AFAIK.

et_print, well no wonder I couldnt capture it, I tried capturing it by et_ConsoleCommand, now the misstake is kinda obvious ;D.


(Nitrox_) #17

Good job with the scripts, will definitely be useful for a lot of server admins :slight_smile:

Well N!tmod has LUA support, so why not :slight_smile:

Here are the cvars and their values:

“GLOW MODE” (Toggle) “!glow -1” (glow all players until they die) OR “!glow [name|slot#]” on every playerspawn
“DOUBLEJUMP” (Toggle) “g_doublejump [0/1/2]” (0: Disabled, 1: Jaymod style, 2: NQ Style)
“KNIFEWAR” (Toggle) “g_knifeonly [0/1]”
“PANZERWAR” (Toggle) “g_war [0/1]”
“SNIPERWAR” (Toggle) “g_war [0/2]”
“RIFLEWAR”" (Toggle) “g_war [0/4]”
“HEADSHOT MODE” (Bitflag) “g_headshot [0/1/2]” (0: Disabled, 1: Only headshots do damage, 2: Headshot = instagib)


(phisherman) #18

Phew, finally!

I’m really sorry for the delay, but whenever I finished a feature, a new one crossed my mind that I wanted to include. But now I’m finished and I hope it’s worth the work:

Episode I - Advanced Voting LUA

[SCREENSHOT]

Since imho the vanilla ET vote-menu is largely useless, I decided to use LUA and a little UIscript to add some new functions. Read a detailed list of features and configuration possibilities in the .lua-file.

I decided to ditch support for other mods and develop/release it only for NQ as this is the only mod I know and have ever worked with. I don’t know about the settings of other mods, I don’t know about possible missing lua entity fields, so the only thing I could do is a conversion that I would neither test nor debug. That’s why I decided to let other people do it, people who know about a certain mod. The code is already there, the only problem that might arise is to understand what the hell this and that’s supposed to do. If somebody out there wants to convert this script to ETpub or whatever and encounters problems concerning code understanding, please pm me and I’ll tell you. I have to admit that I don’t comment code, so if you need a commented version tell me too, and I’ll make one.
If you successfully converted and tested the script, please upload it here (make sure to rename the pk3 if you changed it).

The script + pk3 was developed for NQ 1.2.9, I do not know about compatibility to other mods/older versions.

The script has two known “bugs”:[ul][li]During BotWar, I had to find a system to stop players from joining the bot-team. Of course !lock was the first thing that came to my mind, but NQ shrubbot unlocks a team again as soon as it’s empty, so I had to discard that.
[/li]What I made instead should do the trick although it might raise a spam problem: If somebody joins the bot team, he’s immediately put to spec and printed an info message. If somebody has a better idea, please tell me.[li]If Glow Mode is disabled, the players are not “unglowed”. This is due to the fact that I could not find an appropriate hook to safely unglow each player. ps.eFlags is not accessible via lua, so we’re stuck with this system: “Disable Glow Mode” does nothing but not !glow players on respawn, so until the players do not die, they’re still glowing. If somebody knows a entity field that tells about a player’s “alive”-state (alive/wounded-dead/limbo-dead), please tell me.[/ul]
[/li]@everybody who wants to dare and convert this script: I added a report about some kind of “bug” that I encountered. It’s in the lua script, right below the config section. Reading it might save you a lot of anger… :wink:

Please report any bug you might encounter and make sure to carefully read the instructions concerning configuration to avoid unwanted behaviour.

As always, if I release sth: Everybody’s free to download, share, modify and publish this script in altered form. But please, for the sake of players, rename the pk3 if you change it!!

This work is dedicated to ailmanki, who showed so much patience. [noparse]:)[/noparse]

//Alternative download link, thanks shagileo

//Edit: I’ve found a bug in the script that allows to make the spam-protection mechanism collapse although most likely nobody will ever notice any weird behaviour. I might release a fix for this some time.


(ailmanki) #19

Amazing, thanks a very lot!
Now have to upgrade(:p) it for silEnTmod and etpub…

For preventing team join, in etpro afaik you can capture the clientcommand “team”, I think that is also how a player joins a team in other mods (“team r/b/s/…” There are quite alot keys for team defined - can’t remember which but one is even random team)

I saw in the script you use ref, to let admins access more functions. I already forgot about ref… I dont use etpro anymore. Is there a special reason for using ref instead of shrubbot system?
I don’t know lua’s nq good enough - if it allows to check for a players shrublevel.

Interesting stuff :smiley:
Enemy-Territory ftw


(phisherman) #20

[QUOTE=ailmanki;361909]For preventing team join, in etpro afaik you can capture the clientcommand “team”, I think that is also how a player joins a team in other mods (“team r/b/s/…” There are quite alot keys for team defined - can’t remember which but one is even random team)[/quote]I thought about this but dismissed it because of the load of possible keys. Would be worth a thought though to block all except r/b/s. Wouldn’t be !put-proof though, and I’ve lost my trust in the server admins over the years…[QUOTE=ailmanki;361909]Is there a special reason for using ref instead of shrubbot system?[/quote]ref is a vanilla ET feature and since the other votes use it as well I adopted it. It’s not possible to add shrubbot !commands to the game (at least none that are documented or listed with !help). But I added console commands for all the settings so it’s possible for admins to create shrubbot commands for each and allocate them to levels/admins.[QUOTE=ailmanki;361909]I don’t know lua’s nq good enough - if it allows to check for a players shrublevel.[/quote]NQ provides the function et.G_shrubbot_level(), I don’t know about other mods (which is one reason why I leave this to you ;)…

//Let’s keep moving…

Episode II - Clantag Protection LUA

On request, my next project is a lua script that is supposed to stop players from wearing clantags without permission. What I have in mind is a cycle that checks the playernames every X seconds and kicks/bans/warns/renames a player if he’s wearing the tag without being listed in some kind of admin database.
For feature requests or advice, now it’s the time…