Results 1 to 3 of 3

Thread: Prespawn question

  1. #1

    Default Prespawn question

    Technically,

    What kinds of things need to be done before "prespawn" as opposed to before "spawn"?

  2. #2

    Default

    It's not so much what "needs" to be done, but what "can" be done if desired.

    Here's the order of waittills that the map runs through (that I know of):
    prespawn, spawn, postthink, playerspawn, roundstart.

    all server, gamemode, and map-related cvars should be set before "level waittill prespawn" (before any players, objects, loops, scripts, triggers, etc. are spawned). server.cfg runs before prespawn.

    level waittill prespawn = level just loaded; no players, nothing script-related has spawned yet. i.e. loops and setthreads have not begun yet. only objects in the .bsp have spawned.
    Also, entities have not been assigned entnums yet.

    level waittill spawn = loops started, setthreads ready for triggering, entities have finished spawning and have been assigned entnums.

    level waittill postthink = never really used, but it waits until the 1st player to be "preparing for deployment" (just connected to the server, but hasn't joined the game yet).

    level waittill playerspawn = waits until the 1st player has "entered the battle." (before that player joins a team).

    level waittill roundstart = only for round-based, objective, and tug-of-war gamemodes; waits until 2 players have joined and waits until at least 1 player is on Allies and Axis teams.

    You can pretty much add anything you need before prespawn, between prespawn and spawn, or after spawn. Doesn't really matter.
    However, if you want to do stuff with $targetnames that were already in the .bsp, you have to wait until after "level waittill prespawn".
    If you want to do stuff with .entnums, you have to wait until after "level waittill spawn".

  3. #3

    Default

    thanks that's great! I've always done things by following others examples and never clompletly understood why things go in certain places.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •