the training centre map

please keep scripting in here only

Moderators: Q-dad~TAG, EXP STAFF, Moderator

the training centre map

Postby loa » 01-06-2007 01:24 PM

this is a realy sweet set of scripts from my bro HkySk8r187's map called training centre, the scripts allow you to set up moving targets and pop up targets and so on.... lol this is allso the map that got him hired with activision...



// TRAINING CENTER
// ARCHITECTURE: Chad "HkySk8r187" Grenier
// SCRIPTING: Chad "HkySk8r187" Grenier
// Authors Website: http://www.3dchad.com

main:
setcvar "g_obj_alliedtext1" "Training Center"
setcvar "g_obj_alliedtext2" "by: HkySk8r187"
setcvar "g_obj_alliedtext3" "www.3dchad.com"
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "TrainingCenterLoading"

///////////////////////
level waittill prespawn
///////////////////////

level.script = maps/dm/TrainingCenter.scr

level.dmrespawning = 1 // 1 or 0
level.dmroundlimit = 0 // round time limit in minutes
level.clockside = draw // set to axis, allies, kills, or draw

//Script to create fog
$world farplane_color ".75 .75 .75"
$world farplane 9000

///////////////////////
level waittill spawn
///////////////////////

level.target01 = 0
level.target02 = 0
level.target03 = 0
level.popuptargets = 10
level.enemytargetsdead = 0
level.enemytargets = 22
level.hostagetargets = 3
level.cage = 0

waitthread popups_setup
waitthread enemytargets_setup
waitthread blacktargets_setup
thread cage_setup
thread popups_go
thread blacktargets_run
$outofcombat_trigger nottriggerable
$switch1 anim idle

///////////////////////
//level waittill roundstart
///////////////////////

end

///////////////////////////////////////////////
/////** For TARGET PRACTICE////////////////////
///////////////////////////////////////////////

pullback_target1:
$pullback_target1_trigger nottriggerable
if ( level.target01 == 0 )
{
$target1_switch anim on
$target1_switch playsound alarm_switch
$target1 bind $target1_holder
$target1_track loopsound m2l1_gate_open
$target1_holder time 3
$target1_holder movewest 1360
$target1_holder waitmove
$target1_track stoploopsound m2l1_gate_open
level.target01 = 1
}
else
{
$target1_switch anim off
$target1_switch playsound alarm_switch
$target1 bind $target1_holder
$target1_track loopsound m2l1_gate_open
$target1_holder time 3
$target1_holder moveeast 1360
$target1_holder waitmove
$target1_track stoploopsound m2l1_gate_open
level.target01 = 0
}
$pullback_target1_trigger triggerable
end

pullback_target2:
$pullback_target2_trigger nottriggerable
if ( level.target02 == 0 )
{
$target2_switch anim on
$target2_switch playsound alarm_switch
$target2 bind $target2_holder
$target2_track loopsound m2l1_gate_open
$target2_holder time 1.5
$target2_holder movewest 672
$target2_holder waitmove
$target2_track stoploopsound m2l1_gate_open
level.target02 = 1
}
else
{
$target2_switch anim off
$target2_switch playsound alarm_switch
$target2 bind $target2_holder
$target2_track loopsound m2l1_gate_open
$target2_holder time 1.5
$target2_holder moveeast 672
$target2_holder waitmove
$target2_track stoploopsound m2l1_gate_open
level.target02 = 0
}
$pullback_target2_trigger triggerable
end

pullback_target3:
$pullback_target3_trigger nottriggerable
if ( level.target03 == 0 )
{
$target3_switch anim on
$target3_switch playsound alarm_switch
$target3 bind $target3_holder
$target3_track loopsound m2l1_gate_open
$target3_holder time 1
$target3_holder movewest 432
$target3_holder waitmove
$target3_track stoploopsound m2l1_gate_open
level.target03 = 1
}
else
{
$target3_switch anim off
$target3_switch playsound alarm_switch
$target3 bind $target3_holder
$target3_track loopsound m2l1_gate_open
$target3_holder time 1
$target3_holder moveeast 432
$target3_holder waitmove
$target3_track stoploopsound m2l1_gate_open
level.target03 = 0
}
$pullback_target3_trigger triggerable
end

///////////////////////////////////////////////
/////** For SHOOTING RANGE 1///////////////////
///////////////////////////////////////////////
popups_setup:
//move all popuptargets to the down position
for( local.i = 1; local.i <= level.popuptargets; local.i++ )
{
thread popup_down local.i
}
end

popups_go:
wait 2
local.popup = ((randomint (level.popuptargets)) + 1)
thread popup_up local.popup
end

popup_up local.popupnum:
//bind parts together
$("popup" + local.popupnum) bind $("popup" + local.popupnum + "_origin")
$("popup" + local.popupnum + "_holder") bind $("popup" + local.popupnum + "_origin")

//move it down now
$("popup" + local.popupnum + "_origin") speed 2.5
$("popup" + local.popupnum + "_origin") rotatezupto 0
$("popup" + local.popupnum + "_origin") waitmove

//enable the triggers
$("popup_trigger" + local.popupnum) triggerable
end

popup_down local.popupnum:
//disable the triggers
$("popup_trigger" + local.popupnum) nottriggerable

//bind parts together
$("popup" + local.popupnum) bind $("popup" + local.popupnum + "_origin")
$("popup" + local.popupnum + "_holder") bind $("popup" + local.popupnum + "_origin")

//move it down now
$("popup" + local.popupnum + "_origin") speed 2
$("popup" + local.popupnum + "_origin") rotatezdownto -90
$("popup" + local.popupnum + "_origin") waitmove
end

popup1_hit:
waitthread popup_down 1
thread popups_go
end

popup2_hit:
waitthread popup_down 2
thread popups_go
end

popup3_hit:
waitthread popup_down 3
thread popups_go
end

popup4_hit:
waitthread popup_down 4
thread popups_go
end

popup5_hit:
waitthread popup_down 5
thread popups_go
end

popup6_hit:
waitthread popup_down 6
thread popups_go
end

popup7_hit:
waitthread popup_down 7
thread popups_go
end

popup8_hit:
waitthread popup_down 8
thread popups_go
end

popup9_hit:
waitthread popup_down 9
thread popups_go
end

popup10_hit:
waitthread popup_down 10
thread popups_go
end

///////////////////////////////////////////////
/////** For PISTOL WHIP ARENA//////////////////
///////////////////////////////////////////////
cage_setup:
$cage time .1
$cage movedown 132
$cage waitmove
end

cage:
$cagetrigger nottriggerable
if ( level.cage == 0 )
{
$switch1 anim move
iprintln_noloc "Players get in the arena and wait for the bell!"
wait 6
$cage time 5
$cage moveup 132
$cage loopsound m2l1_gate_open
$cage waitmove
$cage stoploopsound m2l1_gate_open
wait 5
$ringbell playsound roundbell
level.cage = 1
}
else if ( level.cage == 1 )
{
$cage time 5
$cage movedown 132
$cage loopsound m2l1_gate_open
$cage waitmove
$cage stoploopsound m2l1_gate_open
$switch1 anim idle
level.cage = 0
}
wait 2
$cagetrigger triggerable
end

///////////////////////////////////////////////
/////** For Combat Training////////////////////
///////////////////////////////////////////////
enemytargets_setup:
for( local.i = 1; local.i <= (level.enemytargets + level.hostagetargets); local.i++ )
{
$( "enemytarget" + local.i ) hide
$( "enemytarget" + local.i ) notsolid
}
end

resettraining:
local.player = parm.other
local.player thread trainingdeath

$combattrigger01 nottriggerable

//turn on red light
$redlight light 1 0 0 200

//close entrance doors
thread door1_close
thread door2_close
$combatdoor_switch anim off
$combatdoor_switch playsound alarm_switch

//make sure all targets are dead before spawning new ones
waitthread killallenemytargets

//prep the facility
level.enemytargetsdead = 0
level.newtarget = spawn func_crate model $enemytarget1.brushmodel origin $enemytarget1.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget1"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget2.brushmodel origin $enemytarget2.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget2"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget3.brushmodel origin $enemytarget3.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget3"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget4.brushmodel origin $enemytarget4.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget4"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget5.brushmodel origin $enemytarget5.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget5"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget6.brushmodel origin $enemytarget6.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget6"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget7.brushmodel origin $enemytarget7.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget7"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget8.brushmodel origin $enemytarget8.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget8"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget9.brushmodel origin $enemytarget9.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget9"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget10.brushmodel origin $enemytarget10.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget10"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget11.brushmodel origin $enemytarget11.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget11"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget13.brushmodel origin $enemytarget13.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget13"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget14.brushmodel origin $enemytarget14.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget14"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget15.brushmodel origin $enemytarget15.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget15"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget16.brushmodel origin $enemytarget16.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget16"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget18.brushmodel origin $enemytarget18.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget18"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget19.brushmodel origin $enemytarget19.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget19"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget20.brushmodel origin $enemytarget20.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget20"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget21.brushmodel origin $enemytarget21.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget21"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget22.brushmodel origin $enemytarget22.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget22"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget23.brushmodel origin $enemytarget23.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget23"
level.newtarget thread cratedeath
level.newtarget = spawn func_crate model $enemytarget24.brushmodel origin $enemytarget24.origin
level.newtarget health 25
level.newtarget targetname "enemycratetarget24"
level.newtarget thread cratedeath

//Spawn the hostage targets now
level.newtarget2 = spawn func_crate model $enemytarget12.brushmodel origin $enemytarget12.origin
level.newtarget2 health 5
level.newtarget2 targetname "enemycratetarget12"
level.newtarget2 thread cratedeath_hostage
level.newtarget2 = spawn func_crate model $enemytarget17.brushmodel origin $enemytarget17.origin
level.newtarget2 health 5
level.newtarget2 targetname "enemycratetarget17"
level.newtarget2 thread cratedeath_hostage
level.newtarget2 = spawn func_crate model $enemytarget25.brushmodel origin $enemytarget25.origin
level.newtarget2 health 5
level.newtarget2 targetname "enemycratetarget25"
level.newtarget2 thread cratedeath_hostage

end

killallenemytargets:
iprintln "Killing remaining targets"
for( local.i = 1; local.i <= 15; local.i++ )
{
if ( isalive $("enemycratetarget" + local.i) )
{
$("enemycratetarget" + local.i) kill
}
}
iprintln "Done"
end

cratedeath:
self waittill death
level.enemytargetsdead = ( level.enemytargetsdead + 1 )
if ( level.enemytargetsdead == level.enemytargets )
{
$training_speaker playsound alarmsound2
$combattrigger02 triggerable
}
end

cratedeath_hostage:
self waittill death
$training_speaker playsound alarmsoundbuzz
end

trainingdeath:
while ( self IsTouching $intraining == 1 )
{
if ( IsAlive self )
{
wait 3
}
else
{
$redlight light 0 0 0 64
$combattrigger02 nottriggerable
$combatdoor_trigger triggerable
end

}
wait 3
}
end

open_combat_doors:
$combatdoor_trigger nottriggerable
$combattrigger01 triggerable
$combatdoor_switch anim on
$combatdoor_switch playsound alarm_switch
thread door1_open
thread door2_open
end

exitcombat:
$combattrigger02 nottriggerable
$outofcombat_trigger triggerable
thread door3_open
thread door4_open
end

outofcombat:
$outofcombat_trigger nottriggerable
wait 1
thread door3_close
thread door4_close
$redlight light 0 0 0 64
$combatdoor_trigger triggerable
end

door1_open:
$combatdoor1 time 1
$combatdoor1 movenorth 60
$combatdoor1 playsound doorsound1
$combatdoor1 waitmove
end

door1_close:
$combatdoor1 time 1
$combatdoor1 movesouth 60
$combatdoor1 playsound doorsound1
$combatdoor1 waitmove
end

door2_open:
$combatdoor2 time 1
$combatdoor2 movesouth 60
$combatdoor2 playsound doorsound1
$combatdoor2 waitmove
end

door2_close:
$combatdoor2 time 1
$combatdoor2 movenorth 60
$combatdoor2 playsound doorsound1
$combatdoor2 waitmove
end

door3_open:
$combatdoor3 time 1
$combatdoor3 movenorth 60
$combatdoor3 playsound doorsound1
$combatdoor3 waitmove
end

door3_close:
$combatdoor3 time 1
$combatdoor3 movesouth 60
$combatdoor3 playsound doorsound1
$combatdoor3 waitmove
end

door4_open:
$combatdoor4 time 1
$combatdoor4 movesouth 60
$combatdoor4 playsound doorsound1
$combatdoor4 waitmove
end

door4_close:
$combatdoor4 time 1
$combatdoor4 movenorth 60
$combatdoor4 playsound doorsound1
$combatdoor4 waitmove
end


///////////////////////////////////////////////
/////** For SHOOTING RANGE 2///////////////////
///////////////////////////////////////////////
blacktargets_setup:
for( local.i = 1; local.i <= 9; local.i++ )
{
$( "blacktarget" + local.i ) notsolid
$( "blacktarget" + local.i ) hide
}
end

blacktargets_run:
while (1)
{
//choose what target will appear
local.blackpopup = ((randomint (9)) + 1)

switch (local.blackpopup)
{
case 1:
level.blacktarget = spawn func_crate model $blacktarget1.brushmodel origin $blacktarget1.origin
level.blacktarget health 1
break
case 2:
level.blacktarget = spawn func_crate model $blacktarget2.brushmodel origin $blacktarget2.origin
level.blacktarget health 1
break
case 3:
level.blacktarget = spawn func_crate model $blacktarget3.brushmodel origin $blacktarget3.origin
level.blacktarget health 1
break
case 4:
level.blacktarget = spawn func_crate model $blacktarget4.brushmodel origin $blacktarget4.origin
level.blacktarget health 1
break
case 5:
level.blacktarget = spawn func_crate model $blacktarget5.brushmodel origin $blacktarget5.origin
level.blacktarget health 1
break
case 6:
level.blacktarget = spawn func_crate model $blacktarget6.brushmodel origin $blacktarget6.origin
level.blacktarget health 1
break
case 7:
level.blacktarget = spawn func_crate model $blacktarget7.brushmodel origin $blacktarget7.origin
level.blacktarget health 1
break
case 8:
level.blacktarget = spawn func_crate model $blacktarget8.brushmodel origin $blacktarget8.origin
level.blacktarget health 1
break
case 9:
level.blacktarget = spawn func_crate model $blacktarget9.brushmodel origin $blacktarget9.origin
level.blacktarget health 1
break
}
level.blacktarget waittill death
wait 1
}
end
User avatar
loa
Administrator
 
Posts: 1132
Joined: 03-06-2004 01:54 PM

Postby Turtle-ZED » 01-06-2007 02:31 PM

I just got a nosebleed reading through that post.
:p
Image


SoftImage|XSI 4.2 Advanced
3DS MAX 5 & 7 Academic
Milkshape 1.7.10, Blender 2.42
Ultimate Unwrap 2.28
Paintshop Pro X, XBOX 360
User avatar
Turtle-ZED
Daydreamer
 
Posts: 719
Joined: 06-17-2004 07:41 AM

chad

Postby dunny_uk » 01-06-2007 03:36 PM

if u open iw_00.iwd (dont modify it lol) with winzip you can see his cfg files for the game ... well mad..

i wonder if thats the script used at the start of the single player game....when you have to that litte bit of target practice...

right we know where to go when we want custom scripts for mods made loooooool....
dunny_uk
Member
 
Posts: 63
Joined: 08-20-2006 08:34 PM

Postby loa » 01-06-2007 04:43 PM

i think i still have the .map format. which can be viewed in regular gtk or mohaa radiant. the map uses mohaa textures...
User avatar
loa
Administrator
 
Posts: 1132
Joined: 03-06-2004 01:54 PM


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron