I'm working on a new game mode API for Slayer and I wanted your input on it.
This is the extent of the current API:
Slayer.GameModes.addMode("Capture the Flag", "CTF", true, true);
It's very limited and doesn't have any flexibility.
This is a mockup of the new one:
new ScriptGroup(Slayer_GameMode)
{
//Game mode settings
title = "Capture the Flag";
scriptName = "CTF";
useTeams = true;
useRounds = true;
//Default minigame settings - player can change these
//Anything not defined here will use the global defaults.
default_title = "test minigame";
default_weaponDamage = false;
//Locked minigame settings - player cannot change these
locked_playerDatablock = nameToID("PlayerStandardArmor");
//Teams
new ScriptObject()
{
//Prevent team from being deleted
disable_delete = true;
disable_edit = false;
//Default team settings
default_name = "Red";
default_botFillLimit = -1;
//Locked team settings
locked_color = 0;
};
};
This allows the game mode to specify its own default settings and to prevent players from editing settings. ("locking" them) The game mode can also create teams.
What do you think about the design and how can I improve it?