STRAFTAT
You are viewing a potentially older version of this package. View Latest Version
Install

Details

Date Uploaded
4 days ago
Downloads
86
Size
185KB
Dependency string
doms-CaptureTheFlag-1.0.4

Capture the Flag

Two-team Capture the Flag for STRAFTAT.

Each team gets a flag and a base. Walk into the enemy flag to take it, bring it back to your own base to score. Getting killed drops the flag where you fell, and you respawn a few seconds later instead of sitting out the rest of the take. First team to three captures wins the round, and the match carries on exactly as it normally would.

Everything else about STRAFTAT is untouched — same weapons, same movement, same maps, same match-point progression.

Everyone in the lobby needs this mod, at the same version. The host will not start a CTF match until every player has reported it.

Installing

  1. In r2modman, pick STRAFTAT and the profile you play on.
  2. Install BepInExPack and MyceliumNetworking.
  3. Install CaptureTheFlag.
  4. Launch with Start modded.

Everyone you play with does the same. That is the whole setup — there is nothing to configure to get a game going.

Playing

Put players on exactly two teams and start a map. CTF picks the two furthest-apart spawn points as bases and works out which one belongs to which team from where each team spawned.

  • Walk into the enemy flag to pick it up.
  • Bring it to your base to capture. By default your own flag has to be home for it to count.
  • Touch your own dropped flag to send it straight back.
  • A dropped flag returns on its own after 15 seconds. It flashes faster as the timer runs out.
  • Killing the carrier drops the flag where they died.
  • First to three captures wins the round.

The HUD shows the score, both flags' states, and what you should be doing. Off-screen markers point at the flags and, when you are carrying, at your own base.

Placing bases by hand

Automatic placement works on the official maps, but if a map puts a base somewhere awkward the host can override it:

Key What it does
F8 Save the first team's base where you are standing
F9 Save the second team's base where you are standing
F10 Forget this map's saved bases and go back to automatic

Positions are saved per map and reused next time. The keys are rebindable in the config.

If CTF does not start

CTF tells you why on screen rather than failing silently. The usual reasons:

  • "needs exactly two teams with players on them" — everyone is on one team, or there are three or more teams in play. CTF only handles two.
  • "waiting for everyone to report Capture the Flag" — somebody in the lobby has not installed it, or has a different version.
  • "the two bases are only Xm apart" — the map's spawn points are too close together for a fair game. Place the bases by hand with F8 / F9.
  • "no usable base positions found" — a map with no usable spawn points. Same fix.

Configuration

Settings live in BepInEx/config/com.straftatmods.capturetheflag.cfg, or in Mod Menu if you have it. Worth knowing about:

Setting Default Notes
CapturesToWin 3 Set to 0 to follow the lobby's own "takes to win" setting instead
RespawnDelay 3 Seconds spent spectating after a kill
SmartRespawns true Choose where players come back instead of taking a random spawn point
RespawnUsesAllSpawnPoints true Use every spawn point in the map, not just the group the lobby size picked
RespawnVariety 0.35 How far the choice may wander from the best spawn point. Near 0 is safest and completely predictable
RespawnEnemyClearance 10 Metres of room to try to leave from an enemy who can see you
RespawnHazardRadius 6 Refuse a spawn point with a live mine, grenade or damage zone this close. 0 skips the check
RequireOwnFlagHome true Turn off for faster, messier games
DroppedReturnSeconds 15 How long a dropped flag stays contestable
CarrierSpeedPenalty 0 Optional handicap for the flag carrier
ShowFlagBeacons true The light shafts above flags and bases
ShowWorldMarkers true Off-screen pointers
HudScale 1 Size of the CTF HUD
VerboseLogging false Extra diagnostics, worth enabling before reporting a problem

Rule settings only matter on the host — it decides everything. Display and audio settings are per-player.

Notes on how it works

  • The host decides everything. Pickups, returns, captures, score, respawns and round end are all resolved on the machine that is both the game server and the Steam lobby host. Clients render what they are told and cannot author state, so there is no capture or score a client can fabricate.
  • Flags are local props, not networked objects. Every client builds its own flags and bases from replicated state. There is no custom network prefab to mismatch and nothing for a late joiner to fail to receive — they just get the next snapshot.
  • Respawns are placed, not rolled. The game picks a spawn point at random, which suits a mode where everyone spawns at once and not one where people come back mid-fight. CTF rates the map's spawn points on what is standing near them, what is about to explode near them, who can see them, which half of the map they are on and where the flags currently are — then picks at random between the best few, so a good spawn does not become a predictable one. SmartRespawns = false gives you the game's own placement back.
  • The game's own systems do the heavy lifting. Round wins go through STRAFTAT's scoring, its end-of-round screen and its next-map load. Sounds come from the game's own audio and respect your volume settings. Event text goes into the game's match log.
  • A game update will not break your match silently. Every hooked method is checked at load. If one is missing, CTF logs which one and stays switched off, and the game plays normally.

Logs

BepInEx/LogOutput.log in your profile. Search for Capture the Flag. On a healthy start you should see the hooks applied, the version advertised to the lobby, and then the match starting once two teams are in.

Building from source

Needs the game installed, a profile with BepInEx and Mycelium, and a C# compiler (csc) plus mono.

./scripts/test.sh      # protocol and validation tests
./scripts/build.sh     # compile
./scripts/deploy.sh    # compile and install into a profile
./scripts/package.sh   # build a Thunderstore zip
./scripts/make-icon.sh # regenerate icon.png

Point them somewhere else with environment variables if your install is not in the default place:

STRAFTAT_DIR=/path/to/STRAFTAT R2_PROFILE=~/.config/r2modmanPlus-local/STRAFTAT/profiles/CTF ./scripts/deploy.sh

See PLAN.md for the design and STATE_OF_THE_PROJECT.md for current status and what has actually been tested.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.