This mod adds ranks in chat and in nametags and takes heavy inspiration and a lot of the mechanics and apis from Salzar's staffranks, with an different twist
This mod has been developed heavily by AI with manual understanding of some lua logic and lua theory to troubleshoot, fix bugs and figure out features.
** Base BattleRanks
** Flanker ** Rear_Guard ** Front_Guard ** Back_Guard ** Medic ** Shephard ** Reconnoiterer
(Special Rank with its own function on elections and assigning ranks, i recommand do not touch this one in ranks.lua) ** Commander
All ranks can be found in ranks.lua.
** Customization
If you want to modify existing ranks or create new ones, simply add the `{name = "id", prefix = S("rankname"), color = "hexcode"}, to the return function in ranks.lua, replace "id" with the desired technical name, and replace rankname with the desired rank name, also replace "hexcode" with the desired hexcode (color) you want.
support:
this mode supports "smart_chat" and "party" as a optionial depends.
privs: "commander" priv which is given when a commander is elected, commanders can give or clear ranks to players. "electofficial" priv which should only be given to trusted players, they can manage elections, run or cancel, or revoke "commander" priv/rank from the player in emergency cases.
election config: local APPLY_TIME = -- local VOTE_TIME = -- local REMINDER_INTERVAL = --
you can replace the -- with the amount of seconds you want to add to the election, apply_time is how long the application phase will last, vote_time is how long the voting phase will last, and reminder_interval is how often it should remind about the election phase.
logging: battleranks.txt can be found in your world folder.