I found some errors in my assassination tutorial.
Moderator: Moderators
I found some errors in my assassination tutorial.
I found some errors in my assassination tutorial. So, please don't use that tut first until Surgeon uploads my corrected version.
I've also updated my script. Can someone check it for me? I tried to use the script, but it didn't work in the game. Any way, this should be correct.
//Test Assassination
//Architecture: mohaa_rox
//Scripting: mohaa_rox
exec global/ai.scr
exec global/loadout.scr maps/test_assassination.scr
main:
level waittill prespawn
exec global/ambient.scr test_assassination
level waittill spawn
$player item weapons/thompsonsmg.tik
$player ammo smg 300
$player weaponclass smg
fade in 2 0 0 0 1
wait 2
level.script= "maps/test_assassination.scr"
thread objectives
end
/////////////OBJECTIVES
objectives:
waitthread global/objectives.scr::add_objectives 1 2 "Kill the officer." $obj1.origin
set_objective_pos $obj1 // this will make the compass point to the officer
waitthread global/objectives.scr::current_objectives 1
end
//////////
objective1:
waitthread globa/objectives.scr::current_objectives 1
If (IsAlive $officer)
$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
iprintIn "The officer has been killed. Mission complete!"
wait 1
exec global/missioncomplete.scr test_assassination 1
end
//Test Assassination
//Architecture: mohaa_rox
//Scripting: mohaa_rox
exec global/ai.scr
exec global/loadout.scr maps/test_assassination.scr
main:
level waittill prespawn
exec global/ambient.scr test_assassination
level waittill spawn
$player item weapons/thompsonsmg.tik
$player ammo smg 300
$player weaponclass smg
fade in 2 0 0 0 1
wait 2
level.script= "maps/test_assassination.scr"
thread objectives
end
/////////////OBJECTIVES
objectives:
waitthread global/objectives.scr::add_objectives 1 2 "Kill the officer." $obj1.origin
set_objective_pos $obj1 // this will make the compass point to the officer
waitthread global/objectives.scr::current_objectives 1
end
//////////
objective1:
waitthread globa/objectives.scr::current_objectives 1
If (IsAlive $officer)
$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
iprintIn "The officer has been killed. Mission complete!"
wait 1
exec global/missioncomplete.scr test_assassination 1
end
exec global/ai.scr
This has no use at all.
exec global/loadout.scr maps/test_assassination.scr
This won't do something neither.
main:
Rather put the 'main:' on top.
fade in 2 0 0 0 1
'fadein' should be one word.
$player weaponclass smg
Should be 'useweaponclass'.
level.script= "maps/test_assassination.scr"
Why is this below a 'wait'? Actually you don't need this line anyway.
iprintIn
Should be iprintln (with a 'l'). However, rather use 'iprintln_noloc' to prevent localization errors.
That's about it. The rest of it seems fine to me.
This has no use at all.
exec global/loadout.scr maps/test_assassination.scr
This won't do something neither.
main:
Rather put the 'main:' on top.
fade in 2 0 0 0 1
'fadein' should be one word.
$player weaponclass smg
Should be 'useweaponclass'.
level.script= "maps/test_assassination.scr"
Why is this below a 'wait'? Actually you don't need this line anyway.
iprintIn
Should be iprintln (with a 'l'). However, rather use 'iprintln_noloc' to prevent localization errors.
That's about it. The rest of it seems fine to me.
So, Surgeon, can you help me rewrite the script part? I'm tired of resending the tut to you. (It will also do your mail box good.) The correct script should be:
//Test Assassination
//Architecture: mohaa_rox
//Scripting: mohaa_rox
main:
exec global/ai.scr
exec global/loadout.scr maps/test_assassination.scr
level waittill prespawn
exec global/ambient.scr test_assassination
level waittill spawn
$player item weapons/thompsonsmg.tik
$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
set_objective_pos $obj1 // this will make the compass point to the officer
waitthread global/objectives.scr::current_objectives 1
end
//////////
objective1:
waitthread globa/objectives.scr::current_objectives 1
If (IsAlive $officer)
$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
iprintln_noloc "The officer has been killed. Mission complete!"
wait 1
exec global/missioncomplete.scr test_assassination 1
end
//Test Assassination
//Architecture: mohaa_rox
//Scripting: mohaa_rox
main:
exec global/ai.scr
exec global/loadout.scr maps/test_assassination.scr
level waittill prespawn
exec global/ambient.scr test_assassination
level waittill spawn
$player item weapons/thompsonsmg.tik
$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
set_objective_pos $obj1 // this will make the compass point to the officer
waitthread global/objectives.scr::current_objectives 1
end
//////////
objective1:
waitthread globa/objectives.scr::current_objectives 1
If (IsAlive $officer)
$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
iprintln_noloc "The officer has been killed. Mission complete!"
wait 1
exec global/missioncomplete.scr test_assassination 1
end
-
[-[usf]-] commando
- Sergeant Major
- Posts: 103
- Joined: Sun Dec 15, 2002 4:09 pm
- Location: australia
- Contact:
Ay!
Another problem with the tutorial I think, that 'objective1' thread is never started is it?
I guess you need to put:
waitthread objective1
just above the end of the objectives thread.
Or am I mistaken?
Anyway, someone's having difficulties with a script that looks pretty much alike
: http://www.modtheater.com/forum/showthr ... stid=34255

I guess you need to put:
waitthread objective1
just above the end of the objectives thread.
Or am I mistaken?
Anyway, someone's having difficulties with a script that looks pretty much alike
Surgeon, I can't find my updated tutorial. Anyway, you can take a look at my tut here:
http://mohaarox.netfirms.com/tutorials/index.html
http://mohaarox.netfirms.com/tutorials/index.html
Last edited by mohaa_rox on Sun Dec 22, 2002 2:47 pm, edited 1 time in total.
I think I know the answer:
//Test Assassination
//Architecture: mohaa_rox
//Scripting: mohaa_rox
main:
exec global/ai.scr
exec global/loadout.scr maps/test_assassination.scr
level waittill prespawn
exec global/ambient.scr test_assassination
level waittill spawn
$player item weapons/thompsonsmg.tik
$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
waitthread global/objectives.scr::current_objectives 1
end
//////////
objective1:
waitthread globa/objectives.scr::current_objectives 1
If(IsAlive $officer)
$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
iprintln_noloc "The officer has been killed. Mission complete!"
wait 1
exec global/missioncomplete.scr test_assassination 1
end
This should be the script, if I'm not wrong. Can any of the staff help me correct it? Thanks.
//Test Assassination
//Architecture: mohaa_rox
//Scripting: mohaa_rox
main:
exec global/ai.scr
exec global/loadout.scr maps/test_assassination.scr
level waittill prespawn
exec global/ambient.scr test_assassination
level waittill spawn
$player item weapons/thompsonsmg.tik
$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
waitthread global/objectives.scr::current_objectives 1
end
//////////
objective1:
waitthread globa/objectives.scr::current_objectives 1
If(IsAlive $officer)
$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
iprintln_noloc "The officer has been killed. Mission complete!"
wait 1
exec global/missioncomplete.scr test_assassination 1
end
This should be the script, if I'm not wrong. Can any of the staff help me correct it? Thanks.

