Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Respawn Controls

Custom player spawn point layout manager and in-game visual spawn editor for Soldat Dedicated Server 2.8.2 (Soldat 1.7.1) running ScriptCore 3.

Author: Dominik (TryHackX) — MIT License. Designed to operate safely alongside ZitroStats and server protection tools.


Overview

In vanilla Soldat, changing spawn points requires decompiling and modifying .pms map files. Respawn Controls allows server administrators to override player spawn points dynamically on a per-map basis using plain text layout files, without altering original map binaries.

The script intercepts map change events, deactivates default player spawns, loads custom coordinates, repositioning players smoothly with zero fall damage and full compatibility with Survival mode and external team balancers.

Key Highlights

  • Non-Destructive Overrides: Replaces only player spawns (styles 0–4). Flags, medkits, grenade kits, and weapon spawns are strictly preserved.
  • In-Game Live Editor: Add, delete, move (pixel-by-pixel with movement keys), and test spawn points in real time directly from the game client.
  • Visual Spawn Overlay: Displays active spawns on the map using color-coded markers (+ID) corresponding to team colors, staggered across clock cycles to eliminate client-side draw lag.
  • Smooth Map Transition: Built-in invulnerability window (OnDamage = 0) and delayed placement (Move_Delay) during map loads to prevent client desynchronization, spawn death, or unintended round triggers.
  • Survival & Balancer Safe: Teleports players via coordinate shifts (Players[].Move) rather than force-killing or invoking artificial team swaps, preventing false suicides, stat corruption, or unwanted round resets.
  • Server Safety Queuing: Console feedback is metered via internal output queues (Lines_Per_Tick = 3) to prevent server freeze bugs caused by massive console packet bursts.

Directory Structure

soldatserver/
`-- scripts/
    `-- Respawn-Controls/
        |-- main.pas
        |-- README.md
        `-- data/                      created automatically / holds layouts
            |-- ctf_Ash
            |-- ctf_Maya
            `-- ctf_Laos

Installation

  1. Copy the script folder into your server's scripts/ directory:
    soldatserver/scripts/Respawn-Controls/
    
    (Ensure the folder path does not contain spaces).
  2. Ensure the data/ directory exists inside scripts/Respawn-Controls/ so layouts can be saved.
  3. Add the script entry to your scripts/scripts.ini:
    [Scripts]
    Respawn-Controls
  4. Start or recompile your server (/recompile).

Commands

All commands require Admin privileges (/ prefix in-game). Commands /countspawns and /saveallspawns can also be run directly from the server console.

Command Arguments Description
/displayspawns none Toggles visual display of active player spawns (+ID with team colors).
/createspawn [0-4] Creates a new spawn point at admin's current location (0 = FFA/No Team, 1 = Alpha, 2 = Bravo, 3 = Charlie, 4 = Delta). Default: 0.
/editnearspawn none Starts/stops moving the nearest spawn point (within 50px). Use Jump / Crouch / Left / Right to adjust position; Reload or typing the command again saves and exits.
/removenearspawn none Removes the nearest player spawn point within 50 pixels.
/removeallspawn none Disables all player spawn points on the current map in memory (does not overwrite saved disk layout until saved).
/testrespawn [id|next] Silent-respawns and teleports the admin onto the specified spawn ID, the nearest spawn, or iterates sequentially (next).
/countspawns none Displays active player spawn points breakdown per team.
/saveallspawns none Flushes current in-memory active spawn points to disk (data/<MapName>).

Marker Colors (/displayspawns)

  • Grey (#808080): Style 0 (FFA / No Team / Deathmatch)
  • Red (#FF0000): Style 1 (Alpha Team)
  • Blue (#0000FF): Style 2 (Bravo Team)
  • Yellow (#FFFF00): Style 3 (Charlie Team)
  • Green (#00FF00): Style 4 (Delta Team)

Layout File Format

Layout files are saved inside scripts/Respawn-Controls/data/<mapname> (e.g. data/ctf_Ash). On Linux systems, filenames are checked with both original and lowercase names for case-sensitivity tolerance.

Each spawn point entry consists of 4 lines:

true
<style>
<X>
<Y>
  • Line 1 (Active): true to enable, false to disable.
  • Line 2 (Style): Spawn style integer (0 to 4).
  • Line 3 (X): Horizontal map coordinate in pixels.
  • Line 4 (Y): Vertical map coordinate in pixels.

Example excerpt from data/ctf_Ash:

true
1
450
320
true
1
480
320
true
2
1850
315

Technical Details

Map Load Lifecycle

  1. OnBeforeMapChange: Intercepts the upcoming map name ~5 seconds before rotation. Reads data/<mapname> into memory and flags incoming layout substitution.
  2. OnAfterMapChange: Once the map loads, the script disables the map's original player spawns matching the styles present in the layout, injects the new coordinates via Map.AddSpawnPoint, and queues players to be shifted.
  3. Move Phase: After Move_Delay (30 ticks), all active players are positioned onto random layout spawn points without triggering damage or artificial team-swap deaths.

Integration Notes

  • ZitroStats & Balancers: Because players are moved via positional coordinates instead of ChangeTeam, external scripts do not trigger join penalties, false death counts, or team balance interventions.
  • Survival Mode: When /testrespawn is used in Survival, it moves the player rather than killing/re-spawning, keeping rounds intact.

License

This project is licensed under the MIT License.

About

Dynamic player spawn point layout manager and live in-game visual spawn editor for Soldat Dedicated Server 2.8.2 (Soldat 1.7.1, ScriptCore 3).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages