The Ship Single-Player: Adding a Mission to a Map
This article is an orphan, meaning that few or no articles link to it.
You can help by adding links to this article from other relevant articles.
January 2024
You can help by adding links to this article from other relevant articles.
January 2024
Note:For the sake of this article,
MODDIR
represents your mod's directory name.Examples
Download this example mission to see examples of what it takes to make a mission.
Note:The only file in
scripts
that's worth noting is scripts/sp/mission_obj.txt
.Creating the Script
Before adding a mission to a map, you must add it first to scripts/sp/mission_obj.txt
. The following is a short example of what goes in this file. Remember to add all referenced localized strings to resource/MODDIR_english.txt
(and/or other languages).
// Template Mission Objective Definition: // (use this to create new objectives in this file) // // ============================ // "SP_Mission_<mis_num>" // { // "SP_Mission_<mis_num>_Obj_<obj_num>_<obj_name>" // { // "text" "#sp_mission<mis_num>_obj<obj_num>" // "hint" // { // "text" "<local token>" // "time" "<time in secs after which to display>" // } // } // } // ============================ "Missions" { "SP_Mission_1_KillQuarry" { "SP_Mission_1_Obj_1_KillQuarry" { "text" "#sp_mission1_obj1" "hint" { "text" "sp_mission1_hint2" "time" "10" } "hint" { "text" "sp_mission1_hint1" "time" "30" } } "SP_Mission_1_Obj_2_TalkToBellboy" { "text" "#sp_mission1_obj2" } } }
Adding It to a Map
Create a ship_mission
entity for each objective in the mission.
- The entity should be given a
targetname
that corresponds to its mission number and objective number. - Be sure to set the
mission
andobjective
keyvalues correctly to the name of the entry in the missions file. - The
hud_location
keyvalue should be set to theship_trigger_room
the objective can be completed in. - If there is to be no image to represent the objective, leave the
hud_model
keyvalue blank. Otherwise, the keyvalue should be set to an entry inscripts/hud_textures.txt
andresource/MODDIR_english.txt
(and other languages) that represents the target person/object for the objective.- See
scripts/hud_textures.txt
inthe ship common.gcf
andscripts/ship_sp_english.txt
inthe ship single player content.gcf
for examples.
- See
- When the entity gets the
OnCompleted
output, it should either trigger theEnable
input on the nextship_mission
entity or a choreographed scene that triggers theEnable
input. - When the entity gets the
OnFailed
output, it should trigger theTrigger
input on alogic_relay
entity that will reset the map to the start of the mission. Decompilemaps/cotopaxi_sp.bsp
for an example of what to do.