Prevents players from exiting the safe-room until all players have connected and are ready. Its features can be disabled so that its only function is providing forwards usable by other plugins.
02-08-2013
, 10:48
[l4d2] Ready Up v3.3.2 [06/24/2014] [Major Update]
Important Information Regarding Versions
Often, when I release new versions, files may be dramatically changed. This means that in order to make sure the plugin and any installed modules function, you should replace all files (this includes configs, translations, etc.) with the new versions in the archive at the bottom of this post. Please help to cull the confusion resulting from posting errors related to older versions of the plugin, or errors that I already know about and am debugging. However, if you have any questions, please don't hesitate to ask!
Modules
Ready Up is comprised of a core plugin; Ready Up, as well as several optional modules. Modules use the functions defined by the core plugin to extend its functionality. Modules can require other modules, or simply work stand-alone, provided the core plugin still exists. The design is in place to allow server owners to pick and choose what features they want.
Module Development
Module development is made easy with Ready Up, with the core plugin doing most of the leg work for you. If you're looking to create a module, the easiest way to get started is to take a look at how I've developed the current modules. With Ready Up, you can register custom commands, so that server owners can define the command string itself in a config file, without ever needing to edit the source code. For a full list of the custom functions, check out the .../include/readyup.inc file.
Description
This plugin is designed to prevent survivor players from leaving the safe-room prior to all clients loading into the game. Its actual features can be disabled so that the plugin only provides the unique forwards which can be used by other plugins. After all clients have loaded, an optional "ready up" phase begins.
Ready Up v3.x uses gametype-specific configs to load variables, making it even more flexible for servers that run multiple gametypes. The list of variables in the core plugin are listed below. This is a direct excerpt from the /configs/readyup/versus.cfg. If you wish to add configs for other gametypes, simply place as many configs in the folder as gametypes you wish to support. If I wanted to add coop for example, I would create /configs/readyup/coop.cfg.
At this time, Ready Up is only compatible with dedicated servers; you cannot run it localhost.
Configs:
Configs for Ready up and its modules are found in the .../configs/readyup/ directory. A config is not generated in the .../cfg/sourcemod/ directory.
For Developers: I've constructed the archive exactly as needed for development purposes. Simply extract it and place the appropriate sourcemod development files into the /scripting/ and /scripting/include/ folders.
The following are the calls available in the readyup.inc
Spoiler
/*
* Called when the first client fully loads into the game.
* @noreturn
*/
forward ReadyUp_FirstClientLoaded();
/*
* Called when the first client spawns, whether it's human or bot.
* @noreturn
*/
forward ReadyUp_FirstClientSpawn();
/*
* Called when all of the currently connected clients have fully loaded into the game.
* @noreturn
*/
forward ReadyUp_AllClientsLoaded();
/*
* Called when the Ready Up Period officially starts.
* @noreturn
*/
forward ReadyUp_ReadyUpStart();
/*
* Called when the Ready Up Period officially ends.
* @noreturn
*/
forward ReadyUp_ReadyUpEnd();
/*
* Called when the round ends. Does not fire in a failed mission in coop mode, instead see ReadyUp_CoopMapFailed.
*
* @param gamemode The gamemode type (0) Error (1) Coop (2) Versus (3) Survival
* @noreturn
*/
forward ReadyUp_RoundIsOver(gamemode);
/*
* Called when the start of map saferoom door opens for the first time.
* @noreturn
*/
forward ReadyUp_CheckpointDoorStartOpened();
/*
* Called when the map transitions in coop gamemodes.
* @noreturn
*/
forward ReadyUp_CoopMapEnd();
/*
* Called when the finale of a campaign is completed.
* @noreturn
*/
forward ReadyUp_CampaignComplete();
/*
* Called when the round ends in coop due to a mission failure.
*
* @param gamemode The gamemode type (0) Error (1) Coop (2) Versus (3) Survival
* @noreturn
*/
forward ReadyUp_CoopMapFailed(gamemode);
/*
* Called when the start of map Saferoom door is first locked.
* @noreturn
*/
forward ReadyUp_SaferoomLocked();
/*
* Called when a client fully loads into the game. This fires after OnClientPostAdminCheck
* and the load screen is no longer present for the user.
*
* @param client The userid of the player who has fully loaded.
* @noreturn
*/
forward ReadyUp_IsClientLoaded(client);
/*
* Called when a ParsedConfig request has completed.
*
* @param key An adt_array holding all of the keys from a config file.
* @param value An adt_array holding all of the values from a config file.
* @noreturn
*/
forward ReadyUp_LoadFromConfig(Handle:key, Handle:value);
/*
* Called when a ParsedConfig request has completed.
*
* @param key An adt_array holding all of the keys from a config file.
* @param value An adt_array holding all of the values from a config file.
* @param section An adt_array holding the current section of the config being parsed.
* @noreturn
*/
forward ReadyUp_LoadFromConfigEx(Handle:key, Handle:value, Handle:section, String:configname[], KeyCount);
/*
* Called when ReadyUp_ParseConfig() fails to parse.
*
* @param config path of config that could not be parsed.
* @param error the error message explaining why the file failed to parse.
* @noreturn
*/
forward ReadyUp_ParseConfigFailed(String:config[], String:error[]);
/*
* Called when a client uses one of the commands in the Ready Up Commands Library.
*
* @param client The userid of the player who used the command.
* @param command The string command the player used.
* @noreturn
*/
forward ReadyUp_Command(client, String:command[]);
/*
* Called when a plugin or player requests the commands in the Ready Up Commands Library.
*
* @param client The userid of the player who used the command.
* @param commands An adt_array holding all of the commands.
* @param descriptions An adt_array holding all of the commands descriptions.
* @param flags An adt_array holding all of the commands flags required.
* @noreturn
*/
forward ReadyUp_ListCommands(client, Handle:commands, Handle:descriptions, Handle:flags);
/*
* Called when a player actually disconnects from the server.
*
* @param client The userid of the player who disconnected.
* @noreturn
*/
forward ReadyUp_TrueDisconnect(client);
/*
* Called when Ready Up is notified of a slot change by a module.
*
* @noreturn
*/
forward ReadyUp_SlotChangeNotice();
/*
* Called when Ready Up is notified of any player being denied entry into the server.
*
* @noreturn
*/
forward ReadyUp_FwdEntryDenied();
/*
* Called when Ready Up is sent a request for the header string.
*
* @param header The header string as defined in the readyup config.
* @noreturn
*/
forward ReadyUp_FwdGetHeader(const String:header[]);
/*
* Called when Ready Up is notified of any player being allowed entry into the server.
*
* @param client The userid of the client who was allowed to enter the server.
* @noreturn
*/
forward ReadyUp_FwdEntryAllowed(client);
/*
* Called when Ready Up is notified of any player being assigned to a team.
*
* @param client The userid of the client who was assigned to a team.
* @param team The team the client was assigned to.
* @noreturn
*/
forward ReadyUp_FwdTeamAssigned(client, team);
/*
* Called when a module asks Ready Up to send information to another module.
*
* @param nameConfig The name of the config of the target module.
* @param nameCommand The name of the command to send to the target module.
* @param value The value of the command to send to the target module.
* @noreturn
*/
forward ReadyUp_FwdCallModule(String:nameConfig[], String:nameCommand[], value);
/*
* Called when a client joins a team.
*
* @param client The userid of the client who joined a team.
* @noreturn
*/
forward ReadyUp_FwdChangeTeam(client, team);
/*
* Called when a module calls ReadyUp_NtvGetMapList from Ready Up requesting the maplist.cfg rotation information.
*
* @noreturn
*/
forward ReadyUp_FwdGetMapList(Handle:MapList1, Handle:MapList2, Handle:MapListIdentifier, Handle:MapListDescription);
/*
* Called when Ready Up is notified when a client controls a survivor.
*
* @param client The userid of the client who is now controlling the survivor.
* @noreturn
*/
native ReadyUp_FwdSurvivorControl(client);
/*
* Called to determine if any other configs are currently being processed.
* This is a test forward to see if it corrects the errors printed to log.
* @return 1 if currently processing, 0 if not processing.
*/
native ReadyUp_NtvConfigProcessing();
/*
* Checks whether or not the teams are flipped.
* @return True if the teams are flipped, false if they are not.
*/
native bool:ReadyUp_IsTeamsFlipped();
/*
* Attempts to parse the specified file path.
*
* @param config The name of the config. .../configs/readyup/ is the base path.
* @noreturn
*/
native ReadyUp_ParseConfig(String:config[]);
/*
* Returns the current gamemode. (0) Error (1) Coop (2) Versus (3) Survival
* @noreturn
*/
native ReadyUp_GetGameMode();
/*
* Attempts to register a command in the Ready Up Commands Library.
*
* @param command The command string to register.
* @param description The command description.
* @param flags The flags required to use the command.
* @return True if successful, otherwise false.
*/
native ReadyUp_RegisterCommand(String:command[], String:description[], flags);
/*
* Attempts to unregister a command in the Ready Up Commands Library.
*
* @param command The command string to unregister.
* @return True if successful, otherwise false.
*/
native ReadyUp_RemoveCommand(String:command[]);
/*
* Calls the ReadyUp_ListCommands forward.
*
* @param client The userid of the player who used the command.
* @noreturn
*/
native ReadyUp_GetCommands(client);
/*
* Called when a module notifies Ready Up of a slot change.
*
* @noreturn
*/
native ReadyUp_SlotChangeSuccess();
/*
* Calls the ReadyUp_FwdGetHeader forward when a module requests the header string.
*
* @noreturn
*/
native ReadyUp_NtvGetHeader();
/*
* Calls the ReadyUp_FwdEntryDenied forward when a module notifies Ready Up of a player being denied entry to the server.
*
* @noreturn
*/
native ReadyUp_NtvEntryDenied();
/*
* Calls the ReadyUp_FwdEntryAllowed forward when a module notifies Ready Up of a player being allowed entry to the server.
*
* @param client The userid of the player who was allowed entry.
* @noreturn
*/
native ReadyUp_NtvEntryAllowed(client);
/*
* Calls the ReadyUp_FwdTeamAssigned forward when a module notifies Ready Up of a player being assigned to a team.
*
* @param client The userid of the client who was assigned to a team.
* @param team The team the client was assigned to.
* @noreturn
*/
native ReadyUp_NtvTeamAssigned(client, team);
/*
* Calls the ReadyUp_FwdChangeTeam forward when a module REQUESTS that a players team change.
* Any module using the assigned forward can manage teams, such as the playerplus module.
*
* @param client The userid of the client who wants to change teams.
* @param team The team the client wants to change to.
* @noreturn
*/
native ReadyUp_NtvChangeTeam(client, team);
/*
* Calls the ReadyUp_FwdSurvivorControl forward when a module notifies Ready Up when a client controls a survivor.
*
* @param client The userid of the client who is now controlling the survivor.
* @noreturn
*/
native ReadyUp_NtvSurvivorControl(client);
/*
* Calls the ReadyUp_FwdCallModule forward when a module asks Ready Up to send information to another module.
*
* @param nameConfig The name of the config of the target module.
* @param nameCommand The name of the command to send to the target module.
* @param value The value of the command to send to the target module.
* @noreturn
*/
native ReadyUp_NtvCallModule(String:nameConfig[], String:nameCommand[], value);
/*
* Calls the ReadyUp_FwdGetMapList forward which sends the maplist.cfg rotation to any modules that use the information.
*
* @noreturn
*/
native ReadyUp_NtvGetMapList();
Optional Modules:
Spoiler
Team Manager
Spoiler
This is a simple teams management plugin that demonstrates how two modules can work together (team manager & player plus) through the use of natives and forwards provided by the ready up core. It calls a request for a team change, and player plus reads it.
This module sets a maximum distance that players can travel ahead of their team. It also allows server owners to set how far behind their team a player can be before it teleports them forward. Only players who rush a significant distance ahead of their team will be punished. Stragglers will not be punished when teleported. Please keep in mind that the actual distance will differ based on the number of valid players.
You must upload the configs for each map that you want this plugin to be active on. I've compiled the stock maps, but you will need to add new configs for any custom maps. If the config isn't found, the module will simply not do anything on the given map.
Locked End of Map Saferoom
Spoiler
This module closes and locks the end of map safe room door when the round begins. It opens automatically when all living survivors are within a set range. I designed it this way instead of assigning a player to hold a key because let's face it: some people might troll and refuse to open the door. With this method, there's no waiting for a player to open it or trying to figure out who has the key.
This module handles the maximum server slots dynamically, taking into account spectators to ensure the server can always fill both teams completely. It also handles reserve slots, using the ADMFLAG_RESERVATION flag. If there are no player slots available, a player with this flag can connect and force a player without it off of the server. If you want to disable the reserve slots feature, just set the reserve slots to 0 in the config.
Player Plus (Superversus / Bebop / Multislots replacement)
Spoiler
This module will make sure there are, always, at a minimum, 4 survivors, creating bots to fill the gaps when necessary. When a survivor player joins a game, if there are no survivor bots available to take control of, the module will create a bot for the player, and remove the bot if the player leaves the game, as long as removing the bot does not result in the survivor count dropping below 4.
Module config: No module config
Friendly fire Prevention / Punishment
Spoiler
This module handles managing and mitigating friendly fire. It's jam-packed with a lot of features, one of which includes the option to store a players data between maps and even if a player disconnects for an amount of time which prevents a troll from shooting up teammates, disconnecting, and returning to wreak havoc again. This is the only friendly fire plugin you'll ever need.
This module handles the map rotation for all game modes. It relies on the .../readyup/maplist.cfg to retrieve its data. Modules (or other plugins using the readyup.inc) can override this plugins ability to control map rotations using a very simple line: ReadyUp_NtvCallModule("rotation.cfg", "ignore rotation", 1); To give the plugin control of map rotations again, simply call the function again, changing the 1 to 0.
Module config: .../configs/readyup/rotation.cfg
Vote Map
Spoiler
This module allowed players to vote for the next map, regardless of game mode. Like the Map Rotation module, it relies on the .../readyup/maplist.cfg to retrieve its data. If Map Rotation module is enabled:
After a successful map vote, it will override the Map Rotation module and control the next map. It will also retrieve the delay before map change, as well as round count rules from the Map Rotation module's config. However, if the map vote is not successful, it will defer to the Map Rotation modules pick. If Map Rotation module is disabled or not on the server:
After a successful map vote, if it's not a versus game mode, it will change the map immediately upon the round ending if the criteria is met; criteria is failing or winning a finale in coop, the round ending in survival, or the second round in versus ending.
Module config: .../configs/readyup/votemap.cfg
Known Issues:
This section details errors that I already know about, and that I may or may not (at this time) be looking into. If you come across these errors, please do not post a response based on them, as there's no reason to notify me about something that I'm already well aware of. It's the same as checking to see if your question has been answered before asking the question, and keeps the clutter off the thread.
Code:
3.2.x
- Locked End Of Map Saferoom; On the first map of campaigns, the first round, the end of map saferoom door may
not properly close and lock.
This issue only occurs if "skip ready up period?" is set to "2" in the game mode config.
v3.1.x
- Not enough space on stack
- Error encountered while processing a dynamic native
Revision history:
Code:
v3.3.2
-Ready Up Core:
+ Added new natives, corrected an issue with the features presented in v3.3.1.
- Player Plus Module:
+ Completely re-written to replace the previous, unstable version. No longer requires config. Will make sure there are a minimum of 4 survivors at all times, while creating a new bot whenever a player joins the survivor team. Team changes are handled through readyup's ReadyUp_FwdChangeTeam(client, team) forward.
- Team Manager Module:
+ Developed to show how modules interact with each other through the use of natives and forwards presented by the core ready up plugin.
v3.3.1
- Ready Up Core:
+ Added "majority ready counter?" and "majority ready timer?" (Refer to included coop.cfg)
v3.2.4
- Ready Up Core:
+ The ready up period will now properly end when the ready up time remaining reaches 0.
v3.2.3
- Ready Up Core:
+ "skip ready up period?" will no longer display messages if set to a value greater than 0.
+ The game will only start after all players have readied up if "ready up time?" is set to 0.
v3.2.2
- Ready Up Core:
+ Option to destroy or not destroy the start of map safe room door when opened.
"delete saferoom door on round start?" "0" (1 to destroy, 0 means to not destroy)
- Player Plus Module:
+ Player health, weapons, etc. will now properly carry over to new levels in Coop game modes.
v3.2.1
- Ready Up Core:
+ "skip readyup period?" has additional functionality. All functionality are as follows:
"0" - Ready Up period performs normally.
"1" - Ready Up period will end when all connecting players have entered the game (untested)
"2" - Ready Up period will end when the first connecting player enters the game.
- Friendly Fire Module:
+ "fire damage limit?" added as an option.
+ "friendly fire disabled during live round?" replaced with "friendly fire damage restored?"
+ If "friendly fire damage restored?" is set to 0, players will now be properly punished even for reaching the
+ appropriate limit.
- Bug fixes:
+ Not enough space on stack
+ Error encountered while processing a dynamic native
+ Other miscellaneous issues and annoyances
v3.1.3
- Should prevent a (rare) issue where Ready Up is notified of the incorrect game mode.
v3.1.2
- Ready Up now properly performs when running in basic mode.
- New functions added for modules.
- Changed how it parses configs, hopefully for the better.
v3.1.1
- No more alpha / beta (private, I know, totally backwards) stages!
- Two new modules! Map Rotation & Vote Map. See module section for details.
- Many, many, many natives and forwards added.
- Some bugs were fixed, some new ones popped up. Fortunately, none affect functionality.
v3.1 alpha
- The Official modules have all received updates, correcting the known issues as of this posting.
- Lock Saferoom: The end of map door will no longer unlock if there are no survivors.
- Official module added: Friendly Fire Prevention / Punishment
- Forwards / Natives: Several Added.
- Survivors who join dead during pre-game will now be spawned (windows signature missing)
- ReadyUp_RegisterCommand and ReadyUp_RemoveCommand allow developers to register custom commands
that server owners can set the command string of in config files.
- Friendly Fire Prevention / Punishment: Corrected an issue that would kill survivors when they reached 1 health
if they attacked another player, regardless of whether they reached a violation limit or not.
- Player Plus: Enforce balance teams now properly functions. If enforcing teams, however, the actual survivors
required value will still be enforced. However, in a later update, the actual value that will be enforced is 4.
- Player Plus: If survivor players are dead during the ready up period, when the ready up period ends, they will be
spawned. The start of map door is locked until the ready up period ends.
v3.0 alpha
- Completely re-written!
- Will bump to v3.1 alpha when the set of Official Modules have been completed.
v2.6
- Fixed (I think) a bug related to the ready up period rarely triggering mid-round.
v2.54
- Added extended module support.
v2.5
- Added new global forward, SaferoomLocked(). This forward is called after the plugin locks the
start of map saferoom door.
- The match will no longer begin prior to the ready up phase, if there are less than two players in the server.
- Added a new option of tracking the ready up period:
readyup_periodic_countdown: Is it enabled?
readyup_periodic_timeframe: How often is it displayed?
v2.4
- readyup_maxrounds added, which is used to track when the map is "over" so the ready up period does
not start up when the last round of a map has been played. This is ignored in coop and ignored on finales.
If you change maps after 1 survival round, your survival config would set this value to 1. In Versus, you set
the value to 2.
- The ReadyUpStart() and ReadyUpEnd() forwards will no longer fire (and their respective functions will not
activate) if there are no survivor players connected to the server when they activate. Instead, a timer will
run until a new player connects to the server, or the map ends. If a player connects prior to the map ending
it will call the ReadyUpStart() function at that time.
v2.3
- Added option to display the ready up time remaining in chat; this option requires the readyup_hidehud 1 and
readyup_loadingplayers_menudisplay 0.
- Two new cvars associated with it, see above.
v2.2
- Corrected an issue where the ready up period would hang if a player disconnected due to a timeout during
the ready up period.
- The "Ready Up Will Automatically Start In..." timer will now automatically restart if a player connects after
all clients have loading, assuming its value is still greater than 0. However, players can ready up and start
the game, even if a player is connecting, as long as all clients had loaded prior to new connections.
- Time remaining in the "Ready Up" phase will pause if a new player starts connecting during ready up.
The timer will resume once all connecting players have loaded, or if the connection timer reaches 0, whichever
of the two occurs first.
v2.11
- Corrected an issue where the ready up period would not end if readyup_freeze_time was set to 0.0.
- Corrected a rare issue where the ready up period would sometimes not occur when a new map loaded.
- The ready up period should no longer occur when the last round of the map is played before a new map loads.
Last edited by Skyy; 06-24-2014 at 05:15.
Reason: Major updates
Inside the zip folder, there is only logs/scripting/translations - and inside of scripting is a "compiled" folder. Do I upload the compiled folder "as is"... or simply remove the .smx plugin and upload that into the plugins folder?
EDIT: I went ahead and extracted the .smx from the compiled folder and uploaded that separately into the plugins folder. Showing as loaded/working in sm plugins list.
Is someone able to let me know what's wrong with my settings? This is my config file below, yet even when everyone is in "ready" mode - nobody can move and rdyup does not end.
Quote:
// This file was auto-generated by SourceMod (v1.4.5-dev)
// ConVars for plugin "readyup.smx"
// The time to wait after ready up ends to force the checkpoint door to open.
// -
// Default: "20.0"
readyup_checkpointdoor_forceopen "60.0"
// If 0.0, all players must have loaded for ready up to start, otherwise forces ready up after this many seconds, even if all players are not fully loaded.
// -
// Default: "60.0"
readyup_connect_timeout "60.0"
// If enabled, infected players will be frozen during the ready up period.
// -
// Default: "0"
readyup_freeze_infected "0"
// If enabled, players are frozen during ready up. If not, the door is locked until ready up ends. Players are always frozen on the first map of a campaign.
// -
// Default: "0"
readyup_freeze_players "0"
// If 0.0, all players MUST ready up to start, otherwise starts when all players have loaded, after this many seconds.
// -
// Default: "60.0"
readyup_freeze_time "0.0"
// If enabled, the hud will be hidden and the ready up period will last its entire time frame.
// -
// Default: "0"
readyup_hidehud "0"
// If enabled, alltalk will be enabled after a round ends and before ready up begins.
// -
// Default: "1"
readyup_intermission_alltalk "1"
// If enabled, the players still loading will be displayed in the menu panel, otherwise a hint text will display the number remaining.
// -
// Default: "0"
readyup_loadingplayers_menudisplay "0"
// If enabled, the round will start as soon as all clients have loaded, or the connection timeout (if applicable) is called.
// -
// Default: "0"
readyup_norup "0"
// If enabled, alltalk will be enabled after a round ends and until ready up ends. Overrides intermission alltalk if enabled.
// -
// Default: "0"
readyup_pregame_alltalk "0"
// If set to 0, there will not be a ready up period before the second round begins.
// -
// Default: "1"
readyup_ready_halftime "1"
// If enabled, players cannot use the spectate command.
// -
// Default: "1"
readyup_spectator_disabled "1"
// The time in seconds before the plugin forces spectators to be ready if they are not. Overridden if all non spectators ready up.
// -
// Default: "10"
readyup_spectatorready_force "20"
// If enabled, players can share their throwables with another player by shoving another survivor.
// -
// Default: "1"
readyup_throwables "0"
However, I've written one that I feel is superior to it; it's the Locked End Of Map Saferoom module. It's included in the zip file and titled rum_antirush. If you have any problems let me know.
v2.6
- optimized code
- logs folder now creates and plugin shoots an error if it doesn't exists and fails to create the folder.
- changed how safe room door protection is handled.
Skyy, do you have any plans to separate the preparation time for regular campaign and survival mode? When paired with fort spawner, this plugins's cooldown time for survival is a bit inadequate in that I have to set the same amount of time in survival as in campaign.
For building servers, it might be more appropriate to set a separate, customizable time cvar for survival maps (i.e. 5 minutes before round starts).
I had never coded this in as an option, since I used my team manager plugin in conjunction with it, which then handled which config was loaded based on game type. However, if you're in a position where you would be unable to use team manager, I can always add in a cvar split for survival modes. (The perks to team manager having different configs completely for each game type that you list in its config file is you can completely change the value of all cvars, as in survival, you may want a continuous timer for ready up period where players cannot ready up and must wait the entire period, as forcing the ready up screen would make it difficult to build.)