Call of Duty 4: SP - Checkpoints/ Autosaves

From COD Modding & Mapping Wiki
Jump to navigation Jump to search

Overview

Autosaves/checkpoints are a common functionality in Singleplayer/Co-Op, they provide players spots to pick up from in the event that they die.

Whenever an autosave happens and a player dies, all players will spawn exactly where they were at when the autosave happened.


Implementation

There are two common ways to execute an autosave, by trigger or by script.

  • Trigger

Make a trigger of your choice and give it the Key Value Pair:

"targetname" "trigger_autosave"
You can apply the Autosave texture to the trigger found under the Tools area in the texture browser. The texture does nothing technical, it is just a visual reminder for designers on what the specific trigger does and will help you keep organized in the future when your map becomes filled with various triggers doing different things.

When the trigger is triggered, it will make an autosave.

  • Script

To make an autosave via script, we pass a save name string into autosave_by_name function.

autosave_by_name( "Player just grabbed documents" );