Changelevel delay, or as it is usually refered to, CLD, is a glitch present in GoldSRC and Old Engine Source games.
It allows the player to delay a level transition, or make it not happen at all, meaning the player can move away from the transition area before it occurs. It is also the basis for Save Warping.
CLD is only possible in runs utilizing Scripts.
First, make sure that you have executed the Wait Table with the exec command. It is required to perform CLD using the standard method.
Now, bind one of the "w" aliases to a key. Each "w" corresponds to 1 frame in both Source and GoldSRC.
This means that "w500" will give the player 500 frames to work with for CLD. This is affected by the fps_max value.
bind KEY "w500"
Now, the player can run at a changelevel trigger, and press this bind right before touching it.
The map transition will occur after 500 frames as opposed to instantly, but in the time between touching the trigger and the transition, the player will be unable to execute any commands (like for example, stopping moving forward).
If the requested wait is too long, the game will throw a buffer overflow and the transition will be completely skipped.
Something to keep in mind, is that going too far away from the trigger_changelevel will result in the player losing their weapons, as the entity will be outside of the PVS of transition landmark.
GoldSRC and Old Engine games use a command queue system. The game goes through that queue whenever a frame happens, and executes the commands which are inside of it.
This includes commands like +jump
(jumping) or +forward
(moving forward).
Most triggers function differently and are unaffected by the command queue, but Changelevel Triggers are an exception.
Whenever the player enters a changelevel trigger, it simply throws the "changelevel2" command to the end of the command queue with the parameters specified in the map.
In GoldSRC and Old Engine the "wait" command functions by simply telling the engine to skip processing the queue in this frame.
this means that "wait;wait;wait;wait;wait"
will cause the game to skip 5 frames.
Now, let's see what happens if we enter a changelevel trigger, but input 5 wait commands into the queue right before:
"wait;wait;wait;wait;wait;changelevel2 map landmark"
This means that we get 5 frames of movement before the game gets to the changelevel command.
Unfortunately, since movement inputs are processed in the same way (by being thrown into the queue), if we try to stop moving forward while CLD is happening, nothing will happen as the -forward
input will be thrown to the end of the queue.
"wait;wait;wait;wait;wait;changelevel2 map landmark;-forward"
Utilising CLD in "Get a Life" to get Out of Bounds
https://youtu.be/IFakBGE-E1g