The Ship Single Player: Adding a Mission to a Map
From Valve Developer Community
[edit]
Examples
Download this example mission (http://files.filefront.com/The_Ship_SP_Example_Mission/;6272640;;/fileinfo.html) to see examples of what it takes to make a mission.[edit]
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"
}
}
}
[edit]
Adding it to a Map
Create a ship_mission entity for each objective in the mission.
- The entity should be given a
targetnamethat corresponds to its mission number and objective number. - Be sure to set the
missionandobjectivekeyvalues correctly to the name of the entry in the missions file. - The
hud_locationkeyvalue should be set to theship_trigger_roomthe objective can be completed in. - If there is to be no image to represent the objective, leave the
hud_modelkeyvalue blank. Otherwise, the keyvalue should be set to an entry inscripts/hud_textures.txtandresource/MODDIR_english.txt(and other languages) that represents the target person/object for the objective.- See
scripts/hud_textures.txtinthe ship common.gcfandscripts/ship_sp_english.txtinthe ship single player content.gcffor examples.
- See
- When the entity gets the
OnCompletedoutput, it should either trigger theEnableinput on the nextship_missionentity or a choreographed scene that triggers theEnableinput. - When the entity gets the
OnFailedoutput, it should trigger theTriggerinput on alogic_relayentity that will reset the map to the start of the mission. Decomplemaps/cotopaxi_sp.bspfor an example of what to do.

