By now you know how to make your room make doors place
triggers and write scripts. Okay time to dig a bit deeper
into the editor and the games excellent scripting language
(hard but so nice). Its time to kick ass.
-------------------------------------------------------------------------------
(1) How to place Enemy AI.
-------------------------------------------------------------------------------
Okay open Mohradiant now make a room with lights say
1024x1024x192 (remember caulk those surfaces you don't
need) and place your playerstart in bottom middle of
map. Now add your enemy, right click ai->german->wehrmact->soldier.
Now press the I key you should now see a popup window
with that ai`s parameters. Apply the following settings:
notice he wont shoot at you. That is intentional, but
get to close and he'll whoop your ass..
-------------------------------------------------------------------------------
(2) How to make a patrol route.
-------------------------------------------------------------------------------
Now place a info_waypoint in the bottom left area of
room give it (key value)
$targetname path1
target path2
Now place a info_waypoint in the bottom right area
of room give it (key value)
$targetname path2
target path1
Okay now make a trigger_multiple place above your inf_playerstart
in xy view, give it the (key value)
target badguy
Also build a small brush to remind you where the trigger
is if needed (don't worry brush can overlap trigger)
If done correctly you should see lines connecting all
four entities.
At this point save yourmap.map
Now open your script editor (notepad/word) and enter
the following lines
objectives:
waitthread global/objectives.scr::add_objectives
1 2 "Kill the guards." $obj1.origin
set_objective_pos $obj1
thread objective1
end
objective1:
waitthread global/objectives.scr::current_objectives
1
$player stufftext "tmstart sound/music/mus_04f_suspense.mp3"
iprintln "kill the guards"
if (IsAlive $badguy1)
$badguy1 waittill death
if (IsAlive $badguy)
$badguy waittill death
thread levelend
end
Now if you want you can run this map and the german
soldier should walk from a to b to a to b.
-------------------------------------------------------------------------------
(3) How to script a patrol route.
-------------------------------------------------------------------------------
Right now lets do the same sort of thing but lets script
the soldiers movements. Place an ai->german->wehrmact->soldier
entity in the top middle of your room press the I key
and enter these values.
Now place an info_pathnode in top left. Give each one
of the following (key value)
$targetname path11
and one in top right and use these keys and values
$targetname path12
righty open your script backup and add the following
lines