Page 1 of 2
I found some errors in my assassination tutorial.
Posted: Tue Dec 17, 2002 9:36 am
by mohaa_rox
I found some errors in my assassination tutorial. So, please don't use that tut first until Surgeon uploads my corrected version.
Posted: Tue Dec 17, 2002 10:34 am
by Surgeon
Ok tutorial has been updated @ the same link as before
Posted: Tue Dec 17, 2002 10:48 am
by mohaa_rox
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
Posted: Tue Dec 17, 2002 11:52 am
by jv_map
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.
Posted: Tue Dec 17, 2002 1:58 pm
by mohaa_rox
Oops! No wonder. Seems like I'm a lousy script writer.

Posted: Tue Dec 17, 2002 2:01 pm
by mohaa_rox
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
Posted: Tue Dec 17, 2002 2:08 pm
by mohaa_rox
Thanks jv_map. You're a great help.
Posted: Tue Dec 17, 2002 2:11 pm
by jv_map
Thank you for your tutorial.
Any tutorial is a great addition for the site 8) .
Posted: Tue Dec 17, 2002 5:52 pm
by Surgeon
To be honest i'm still playing catchup with the scripting side of things - Jv_map is far more advanced in that area - i'm gonna try and learn (and relearn) some more stuff over the holidays....I'm sure JV can edit the tutorial with the correct code if you ask him nicely

Posted: Tue Dec 17, 2002 5:55 pm
by [-[usf]-] commando
i wouldnt have the first clue bout scripting but will b trying later to get a usable spotlight later on as my map is a night 1
Ay!
Posted: Tue Dec 17, 2002 6:28 pm
by jv_map
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

Posted: Wed Dec 18, 2002 4:43 am
by mohaa_rox
Well, I guess I need more practice on scripting.

Any way, jv_map, can you help me edit and test it?
Posted: Wed Dec 18, 2002 6:38 am
by jv_map
Yeah I can, but I'm a bit busy at the moment. However, I can pay nearly full attention to this starting on Friday.
Anyway, I think the suggestion I posted above will do the job.
Posted: Wed Dec 18, 2002 9:42 am
by mohaa_rox
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
Posted: Sun Dec 22, 2002 2:46 pm
by mohaa_rox
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.