This is an intermediate tutorial, and I assume you
can make a basic room and light. You should also know
basic scripting.
-------------------------------------------------------------------------------
Getting Started
-------------------------------------------------------------------------------
Ok, first make a room and apply any texture. Create
an info_player_start.
Make a small area away from the player_start. Place
some of your enemies inside this small room. Make sure
the room is accessible, or you won't be able to reach
the enemies.
Make an officer and press "i" to bring up
the properties. Give the officer a targetname of "officer"
or anything else. Place him with other German soldiers
to sort of be his bodyguards.
Place a script origin above the officer and give it
a targetname of obj1
Ok, now for the scripting part.
Let's say our map is called test_assassination. Save
your scripts as test_assassination.scr and test_assassination_precache.scr
.
This is for the test_assassination.scr:
// Test Assassination
// Architecture: mohaa_rox
// Scripting: mohaa_rox
main: exec global/ai.scr
level waittill
prespawn level waittill
spawn $player item
weapons/thompsonsmg.tik //
gives you a gun $player ammo
smg 300 $player useweaponclass
smg fadein 2 0
0 0 1 wait 2 thread objectives
end
/////////////OBJECTIVES
objectives: waitthread
global/objectives.scr::add_objectives 1 2 "Kill
the officer." $obj1.origin //this
makes the compass point to the officer set_objective_pos
$officer // this makes
the officer to be killed an objective thread objective1
end
//////////
objective1: waitthread
global/objectives.scr::current_objectives 1 if (IsAlive
$officer) // the "if"
must be a lower case, MOHAA is case sensitive $officer waittill
death // if the officer
is killed, then the mission will complete thread mission_complete
end
///////////
mission_complete: waitthread
global/objectives.scr::add_objectives 1 3 "Kill
the officer." $obj1.origin waitthread
global/objectives.scr::current_objectives 0
// clears objectives iprintln_noloc
"The officer has been killed. Mission complete!" wait 1 exec global/missioncomplete.scr
test_assassination 1 //
loads the mission complete screen
end