How do you change lua variables for servers?

SenorBeefSenorBeef 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?

Comments

  • VitdomVitdom Join Date: 2012-04-30 Member: 151345Members, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow, WC 2013 - Shadow
    "Now - can I just alter VoteManager.lua and change votepercentage from .3 to .5?"
    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.
  • ZekZek Join Date: 2002-11-10 Member: 7962Members, NS1 Playtester, Constellation, Reinforced - Shadow
    You can modify the Lua file directly, but you will have to remove that file from consistency checking which may or may not be safe. The alternative is to upload your changes to the Workshop as a mod.
  • SenorBeefSenorBeef Join Date: 2012-11-05 Member: 167400Members
    The server consistency-checks itself? Even for server-only mechanics like changing number of votes required for a commander ejection, which I can't imagine the client settings would affect?
Sign In or Register to comment.