Page 1 of 1
I need some scripting Help - Please
Posted: Sun Jan 05, 2003 11:50 pm
by Shifty
Ok in my map "War in a hall" i have two objectives
01. Kill The German Officer
02. Steal the Documents
I've got the 1st objective working fine and i made a small stealing documents map (to see if I could do it) now I just need to put the 2nd objective into my script - How do i seperate the objectives in the scripts - ie how do I write it with 2 objectives?
Thanks
Posted: Mon Jan 06, 2003 9:04 am
by mohaa_rox
Maybe you can make your first objective:
//blah blah blah
thread 1st_objective
end
1st_objective:
//your code here
thread 2nd_objective
end
2nd_objective:
//your code here
thread allied_victory
end
//axis victory
allied_victory:
//blah blah blah
end
Thx
Posted: Mon Jan 06, 2003 1:04 pm
by Shifty
Ok Thanks mohaa_rox ill try that out
oh dear
Posted: Mon Jan 06, 2003 7:16 pm
by Shifty
So i looked at what u puit put and I don't really get it
You must understand that when it comes to scripting i aint the cleverest man in town - could you make it a little easier to understand?
This is what I have in for the Killing Objective how/where do I integrate the stealing documents objective?
Code: Select all
// War In a Hall (Obj)
// ARCHITECTURE: Shifty
// SCRIPTING: Shifty
main:
exec global/ai.scr //*** Putting these in seems to make him act realistic, hiding for
exec global/friendly.scr //*** grenades & stuff. Add some patnodes around him to enhance this effect.
level waittill prespawn
exec global/DMprecache.scr
level.script = maps/obj_warhall.scr //*** Name of your script file, should be same as your map, just .scr in stead of .bsp
exec global/ambient.scr obj_warhall
exec global/door_locked.scr::lock
exec global/exploder.scr
setcvar "g_obj_alliedtext1" "- Kill the Nazi Officer"
setcvar "g_obj_alliedtext2" "-Steal the Documents"
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "Protect the officer"
setcvar "g_obj_axistext2" "at all costs."
setcvar "g_obj_axistext3" "Stop the Allies"
setcvar "g_scoreboardpic" "none"
level waittill spawn
level.dmrespawning = 0 //*** 1 (wave based) or 0 (round based)
level.dmroundlimit = 5 //*** round time limit in minutes
level.clockside = axis //*** set to axis, allies, kills, or draw
level waittill roundstart
thread targetguy_deathtracker
thread axis_win_timer
end
//*** --------------------------------------------
//*** "Check for Targetguy's death"
//*** --------------------------------------------
targetguy_deathtracker:
if (isAlive $targetguy)
$targetguy waittill death
thread targetguy_was_killed
end
//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------
axis_win_timer:
level waittill axiswin
end
//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------
targetguy_was_killed:
teamwin allies
end
anyone????
Posted: Wed Jan 08, 2003 1:29 pm
by Shifty
Can't someone Help????
Posted: Wed Jan 08, 2003 2:17 pm
by jv_map
shifty wrote:
exec global/ai.scr
//*** Putting these in seems to make him act realistic, hiding for grenades & stuff. Add some patnodes around him to enhance this effect.
Nooo! 
That script is used for enemy spawners
I suppose you've got a documents code somewhere? For example with a trigger and a setthread? Then set a variable when this objective is done, for example level.obj_docs = 1.
Also set a variable when $targetguy is killed. E.g. level.obj_officer = 1.
Make sure to remove the reference to 'targetguy_was_killed' thread, or the allies will win whenever they've killed the officer.
Then, remove the call to the axis_win_timer thread and the thread itself, because it doesn't do anything at all. Below that, paste the following win code or something alike:
Code: Select all
while(level.obj_docs != 1)
wait 0.5
while(level.obj_officer != 1)
wait 0.5
teamwin allies
Maybe that helps.
Thank you, thank you, thank you :)
Posted: Sun Feb 02, 2003 6:52 pm
by Shifty