Writing Multi-Game SourceMod Plugins

From AlliedModders Wiki
Revision as of 15:01, 21 March 2014 by Powerlord (talk | contribs) (Another minor fix)
Jump to: navigation, search

Different Source games tend to have different quirks. This page discusses the more common quirks you'll run into.

Round Start

Most plugin writers assume that hooking round_start will make things work on all games. Those plugin writers would be wrong.

Several games use other events instead or have behavior that needs to be taken into account.

Game Fires round_start? Alternate Event Extra Quirks
Half-Life 2: DeathMatch Yes teamplay_round_start teamplay_round_start is only fired for Team Deathmatch
Day of Defeat: Source No dod_round_start
Team Fortress 2 No teamplay_round_start full_round will be false if this is not the first round of a multi-round map. In Arena mode, the [Fortress 2 Events#arena_round_start|arena_round_start] event fires when players can start moving.
Counter-Strike: Global Offensive Yes round_start is fired during warmup round

Round End

round_end, like round_start, isn't the same across all games.

Most of the time, winner is the team ID of the winning team: 0 for stalemate, 2 for team 1 (Combine, Allies, Terrorists, RED, or Survivors), or 3 for team 2 (Rebels, Axis, Counter-Terrorists, BLU, or Infected).

Game Fires round_end? Alternate Event Extra Quirks
Half-Life 2: DeathMatch Yes winner is a userid for Deathmatch or a team ID for Team Deathmatch
Day of Defeat: Source No dod_round_win team is the winning team.
Team Fortress 2 No See next section See next section
Nuclear Dawn No round_win team is the winning team. type is the win reason.

Team Fortress 2

Round End is so complicated in Team Fortress 2 that I'm giving it its own section. TF2 has not just one, but four different events for round end.

Game Mode Event Quirks
All teamplay_round_win team is the winning team. winreason was only recently fixed and its meaning depends on the game mode.
All but Arena or MvM teamplay_win_panel Win Panel screen, includes each team's score and the scores of the top 3 players. winning_team is the winning team. winreason includes captured all points, time ran out, captured flags, etc...
Arena arena_win_panel Arena Win Panel screen, includes each team's score and the scores of the top 3 players for each team. winning_team is the winning team. winreason can only be killed all players on the other team and captured point.
MvM pve_win_panel MvM Win Panel screen. winning_team is the winning team. Most data is not present in this event and is instead interpolated from the CTFPlayerResource netprops.