Page 2 of 2

It might work, but...

Posted: Sun Dec 22, 2002 3:52 pm
by jv_map
I'd say:

Code: Select all

main: 
	level waittill prespawn 
	
	level waittill spawn 
	
	$player item weapons/thompsonsmg.tik 
	$player ammo smg 300
	$player useweaponclass smg 
	
	fadein 2 0 0 0 1 
	wait 2 

	waitthread global/objectives.scr::add_objectives 1 2 "Kill the officer." $obj1.origin 
	
	If(IsAlive $officer) 
		$officer waittill death // if the officer is killed, then the mission will complete 
	
	waitthread global/objectives.scr::add_objectives 1 3 "Kill the officer." $obj1.origin 
	waitthread global/objectives.scr::current_objectives 0 
	
	iprintln_noloc "The officer has been killed. Mission complete!" 
	wait 1 
	exec global/missioncomplete.scr test_assassination 1 
end
I think this version is easier to understand for beginners :roll: .

Posted: Mon Dec 23, 2002 2:20 am
by mohaa_rox
Hold it! Hold it! I think I got it! The final test is correct! Here's the script:

//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

Presto! I adapted the script from one of Manstein's test_winter3 map. I studied it, but not copied the script. Thanks anyway. Can any staff help me edit the scripting part? That would be helpful. Thanks.

Posted: Mon Dec 23, 2002 7:30 am
by jv_map
This one looks good 8) .

No need for more editing I think :?