I found some errors in my assassination tutorial.

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

It might work, but...

Post 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: .
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post 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.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

This one looks good 8) .

No need for more editing I think :?
Image
Post Reply