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

User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

I found some errors in my assassination tutorial.

Post 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.
Surgeon
Site Admin
Posts: 1386
Joined: Tue Jun 04, 2002 1:15 am
Location: Stirling, Scotland
Contact:

Post by Surgeon »

Ok tutorial has been updated @ the same link as before
Admin
Image

.map Forums

Truth and Honor.
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

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

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

Post by mohaa_rox »

Oops! No wonder. Seems like I'm a lousy script writer. :oops:
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

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

Post by mohaa_rox »

Thanks jv_map. You're a great help.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Thank you for your tutorial.

Any tutorial is a great addition for the site 8) .
Image
Surgeon
Site Admin
Posts: 1386
Joined: Tue Jun 04, 2002 1:15 am
Location: Stirling, Scotland
Contact:

Post 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 :wink:
Admin
Image

.map Forums

Truth and Honor.
[-[usf]-] commando
Sergeant Major
Posts: 103
Joined: Sun Dec 15, 2002 4:09 pm
Location: australia
Contact:

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

Ay!

Post 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

:roll:
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Well, I guess I need more practice on scripting. :oops: Any way, jv_map, can you help me edit and test it?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

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

Post 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
Last edited by mohaa_rox on Sun Dec 22, 2002 2:47 pm, edited 1 time in total.
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post 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.
Post Reply