How do you change lua variables for servers?
SenorBeef
Join Date: 2012-11-05 Member: 167400Members
Ok, so I don't really know how to manage the server, and there's no real documentation on this.
Let's say I want to make a change like requiring more votes to eject a commander. These lines are in the VoteManager.lua file.
VoteManager.kMinVotesNeeded = 2
VoteManager.kTeamVotePercentage = .3
Now - can I just alter VoteManager.lua and change votepercentage from .3 to .5?
Could I just stick that variable in one of the json files, maybe serverconfig.json sort of like how you'd change cvars in source engine by putting them in the server.cfg file?
That way I could keep track of all my changes in one places.
Do either of those even work? What's the proper way to change variables like that? Does the server become listed as modded if you make those sorts of changes?
Let's say I want to make a change like requiring more votes to eject a commander. These lines are in the VoteManager.lua file.
VoteManager.kMinVotesNeeded = 2
VoteManager.kTeamVotePercentage = .3
Now - can I just alter VoteManager.lua and change votepercentage from .3 to .5?
Could I just stick that variable in one of the json files, maybe serverconfig.json sort of like how you'd change cvars in source engine by putting them in the server.cfg file?
That way I could keep track of all my changes in one places.
Do either of those even work? What's the proper way to change variables like that? Does the server become listed as modded if you make those sorts of changes?
Comments
Yes.
"Could I just stick that variable in one of the json files, maybe serverconfig.json sort of like how you'd change cvars in source engine by putting them in the server.cfg file?"
Yes but you have to add Lua scriptcode to load from the config file.
"What's the proper way to change variables like that?"
It's not designed to be changed, only modded or altered by UWE. I think this is a very bad design as well, but there are of course other more important designs which require immediate alteration at this very moment, so this will hopefully be addressed later.
"Does the server become listed as modded if you make those sorts of changes?"
No. A server ONLY becomes listed as modded if you activate a Workshop mod. Workshop mods are required by Client-Side mods, but not really Server-Side-Only mods although they work as well. Server-Side-Only mods can be hardcoded into the game Lua scripts or manually installed as a mod with the executable parameter -game "modfolder" where modfolder is located in the same directory as NS2.exe or Server.exe, and this will not flag the server as modded.