Page 1 of 1

Can someone check my script for the boogie man

Posted: Fri Oct 24, 2003 1:17 am
by small_sumo
I am about to release my map hms hood at sea, and because I only just came down out of the trees I dont trust that I have done no mistakes in my script. So here it is if you see the boogie man please show me.

Thanks guys.


// OBJ_HMS HOOD_AS
// ARCHITECTURE:
// SCRIPTING:

main:

setcvar "g_obj_alliedtext1" "Defend HOOD"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""

setcvar "g_obj_axistext1" "Zerst?ren Sie HOOD"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "obj_hms_hood_as"

exec global/DMprecache.scr

//jv's new sound workaround ..... here goes.

local.master = spawn ScriptMaster



local.master aliascache stinky_bum sound/sumo/stinky_bum.wav soundparms 1.0 0.2 1.0 0.0 256 512 auto loaded maps "obj"
local.master aliascache threat_me sound/sumo/threat_me.wav soundparms 1.0 0.2 1.0 0.0 512 712 auto loaded maps "obj"
local.master aliascache whatever sound/sumo/whatever.wav soundparms 1.0 0.2 1.0 0.0 256 512 auto loaded maps "obj"
local.master aliascache hood_fireplace sound/amb/Amb_FirePlace.wav soundparms 50.0 0.0 1.0 0.0 128 200 auto loaded maps "obj"
local.master aliascache hood_machine_loop2 sound/amb/Amb_MachineLoop_03.wav soundparms 0.6 0.0 1.0 0.0 700 1000 auto loaded maps "obj"
local.master aliascache hood_steamloop sound/mechanics/Mec_SteamLoop_01.wav soundparms 1.0 0.2 1.0 0.0 320 512 auto loaded maps "obj"
local.master aliascache elevator_gate sound/mechanics/Mec_ElevatorGate_03.wav soundparms 1.5 0.0 1.0 0.0 300 3000 auto loaded maps "obj"
local.master aliascache elevator_start sound/null.wav soundparms 1.5 0.0 1.0 0.0 800 3000 auto loaded maps "obj"
local.master aliascache elevator_run sound/mechanics/Mec_ElevatorRun_01.wav soundparms 1.5 0.0 1.0 0.0 800 3000 auto loaded maps "obj"
local.master aliascache elevator_stop sound/null.wav soundparms 1.5 0.0 1.0 0.0 800 3000 auto loaded maps "obj"
local.master aliascache stonecrash01 sound/weapons/explo/Explo_StoneMed1.wav soundparms 0.6 0.4 1.0 0.4 2000 8000 auto loaded maps "m dm moh obj training"
local.master aliascache stonecrash02 sound/weapons/explo/Explo_StoneMed2.wav soundparms 0.6 0.4 1.0 0.4 2000 8000 auto loaded maps "m dm moh obj training"
local.master aliascache stonecrash03 sound/weapons/explo/Explo_StoneMed1.wav soundparms 0.6 0.4 1.0 0.4 2000 8000 auto loaded maps "m dm moh obj training"
local.master aliascache stonesmall01 sound/mechanics/Obj_BreakStoneSml_01.wav soundparms 0.6 0.4 1.0 0.4 1000 8000 auto loaded maps "m dm moh obj training"
local.master aliascache stonesmall02 sound/mechanics/Obj_BreakStoneSml_02.wav soundparms 0.6 0.4 1.0 0.4 1000 8000 auto loaded maps "m dm moh obj training"
local.master aliascache stonesmall03 sound/mechanics/Obj_BreakStoneSml_03.wav soundparms 0.6 0.4 1.0 0.4 1000 8000 auto loaded maps "m dm moh obj training"
local.master aliascache stonesmall04 sound/mechanics/Obj_BreakStoneSml_04.wav soundparms 0.6 0.4 1.0 0.4 1000 8000 auto loaded maps "m dm moh obj training"
local.master aliascache stonesmall05 sound/mechanics/Obj_BreakStoneSml_01.wav soundparms 0.6 0.4 1.0 0.4 1000 8000 auto loaded maps "m dm moh obj training"


level.script = maps/obj/obj_hms_hood_as.scr
exec global/ambient.scr obj_hms_hood_as


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

exec global/door_locked.scr
exec global/exploder.scr
exec global/bomber.scr
// exec global/ambient.scr mohdm1
exec global/cardgame.scr
thread KT2_Init_CP
// $sumo_allied_medic exec global/disable_ai.scr
// level.script = maps/obj/obj_hms_hood_as // Tom commented out this duplacate/unfinished line
// local.chunk.fire = "models/emitters/fireandsmoke.tik" // Tom added this line sumo says thanks Tom :)
thread elevator_preparation //Set the threads...

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

//$smoke_end anim stop

$good_soldier exec global/disable_ai.scr
$good_soldier thread salute

//$sleepy2 notsolid
$sleepy2 exec global/disable_ai.scr
$sleepy2 anim sleep_lowerbunk

//$sleepy3 notsolid
$sleepy3 exec global/disable_ai.scr
$sleepy3 anim sleep_middlebunk

$farty exec global/disable_ai.scr
$farty anim sleep_middlebunk

$doods threatbias ignoreme
$doods nodamage
$doods exec global/disable_ai.scr

$allied_gamer nodamage
$allied_gamer threatbias ignoreme
$allied_gamer exec global/disable_ai.scr
$allied_gamer thread I_wanna_paly_too

$allied_gamer2 nodamage
$allied_gamer2 threatbias ignoreme
$allied_gamer2 exec global/disable_ai.scr
$allied_gamer2 thread Im_cool
$stack_ouch2 hide
$stack_ouch hide

thread hoodsounds
thread shovel
thread shovel_move


//level.camera_speed = .3
level.jvbot_showavatar = 0
level.debug_light = 0
level.jvbot_respawning = 1 // uhm, better just leave at 1 for the beta
level.alliesbots = 6 // max number of bots
level.axisbots = 6
level.dmrespawning = 1 // respawn players, necessary!
level.dmroundlimit = 10
level.clockside = "allies" // allies win when timelimit is hit
level.defusing_team = "allies"
level.planting_team = "axis" // can be set per individual bomb as well by using the $plantteam key
level.bomb_damage = 512
level.bomb_explosion_radius = 512
level.jvbot_tasks_priority[follow] = 3

//weapon preferences ***************************************************************
level.jvbot_weapon_priority["m1 garand"] = 0
level.jvbot_weapon_priority["springfield '03 sniper"] = 0
level.jvbot_weapon_priority["thompson"] = 50
level.jvbot_weapon_priority["bar"] = 0
level.jvbot_weapon_priority["shotgun"] = 50
level.jvbot_weapon_priority["high standard"] = 0
level.jvbot_weapon_priority["colt 45"] = 0
level.jvbot_weapon_priority["bazooka"] = 0
level.jvbot_weapon_priority["mauser kar 98k"] = 0
level.jvbot_weapon_priority["mauser kar 98d sniper"] = 0
level.jvbot_weapon_priority["mp40"] = 0
level.jvbot_weapon_priority["stg44"] = 50
level.jvbot_weapon_priority["walter p38"] = 0
level.jvbot_weapon_priority["panzerschrek"] = 0


$bomb thread global/jv_obj_dm.scr::bomb_thinker
level.routelist[bomb] = top::lower::boilerroom
//level.routelist[bomb] = top
waitthread global/jv_bots/jv_mp_ai.scr::enable 0 0 0 0 // enables bots
while !(level.roundstart)
wait 0.5
thread axis_win_check
wait 2


axis_win_check:

while($bomb.exploded != 1)
wait 0.5

//while($bomb2.exploded != 1)
//wait 0.5

//while($bomb3.exploded != 1)
//wait 0.5

//while($bomb4.exploded != 1)
//wait 0.5

level.alliedwin = 1
//level.dmroundlimit = (level.dmroundlimit + 13)
thread camera_mover
wait 8.5

teamwin axis


end


elevator_preparation:

$elevator moveto $waypoint_down // Moves elevator to waypoint_down.
$elevator_button bind $elevator // Attaches the elevator_button into the elevator, this making it move same time as the elevator.
$elevator time 4 // sets the elevator move time, 4 seconds in this case, could also use the command "speed".
local.elepos = 0 // Defines the position of the elevator. "0 - lift down" "1 - lift up" Default - lift down
goto elevator_standby // standing by and waiting player to activate the trigger

//----------------------------------------------------------->
// Elevator is idle, and waiting user to activate the trigger
//----------------------------------------------------------->

elevator_standby:

$elevator_button waittill trigger
if (local.elepos == 0) // If lift state is down, its better get up.
{
println "elevator down - moving up" //prints this text to console if the developer mode is set.
goto lift_move_up // jumps straight to the "lift_move_up" part in the script
}
else
if (local.elepos == 1) // Or maybe lift state is up, and you need to get down?
{
println "elevator up - moving down" //prints this text to console if the developer mode is set.
goto lift_move_down // jumps straight to the "lift_move_down" part in the script
}

//----------------------------------------------------------->

lift_move_up:

$elevator moveto $waypoint_up //moves the lift to info_waypoint with targetname waypoint_up
$elevator playsound elevator_run //plays the "sound/mechanics/Mec_ElevatorRun_01.wav" defined in the ubersound.scr line 1052
$elevator waitmove //wait till the elevator has completed the move before doing anything else
local.elepos = 1 // it seems the elevator is up now, so we set the local.elepos to 1
goto elevator_standby // Jumps back to the standby part of the script waiting user to activate the trigger

//----------------------------------------------------------->

lift_move_down:

$elevator moveto $waypoint_down //moves the lift to info_waypoint with targetname waypoint_down
$elevator playsound elevator_run //plays the "sound/mechanics/Mec_ElevatorRun_01.wav" defined in the ubersound.scr line 1052
$elevator waitmove //wait till the elevator has completed the move before doing anything else
local.elepos = 0 // it seems the elevator is down now, so we set the local.elepos to 1
goto elevator_standby // Jumps back to the standby part of the script waiting user to activate the trigger

//----------------------------------------------------------->

end //the end.

oops_up:

$oops_up_switch anim on
$elevator moveto $waypoint_up //moves the lift to info_waypoint with targetname waypoint_up
$elevator playsound elevator_run //plays the "sound/mechanics/Mec_ElevatorRun_01.wav" defined in the ubersound.scr line 1052
$elevator waitmove //wait till the elevator has completed the move before doing anything else
$oops_up_switch anim off
local.elepos = 1 // it seems the elevator is up now, so we set the local.elepos to 1
goto elevator_standby // Jumps back to the standby part of the script waiting user to activate the trigger

//----------------------------------------------------------->

end

oops_down:

$oops_down_switch anim on
$elevator moveto $waypoint_down //moves the lift to info_waypoint with targetname waypoint_down
$elevator playsound elevator_run //plays the "sound/mechanics/Mec_ElevatorRun_01.wav" defined in the ubersound.scr line 1052
$elevator waitmove //wait till the elevator has completed the move before doing anything else
$oops_down_switch anim off
local.elepos = 0 // it seems the elevator is down now, so we set the local.elepos to 1
goto elevator_standby // Jumps back to the standby part of the script waiting user to activate the trigger

//----------------------------------------------------------->

end

yer_ded:

parm.other hurt 101

end

yer_ded_stack:

parm.other hurt 101

$stack_ouch show
wait 1
$stack_ouch hide

end

yer_ded_stack2:

parm.other hurt 101

$stack_ouch2 show
wait 1
$stack_ouch2 hide

end

// --------------------------------------------------------------------
KT2_Init_CP:
$sumo_axis_medic.KT2_Team = "axis"
$sumo_allied_medic.KT2_Team = "allies"

$sumo_allied_medic nodamage
$sumo_allied_medic threatbias ignoreme
$sumo_allied_medic exec global/disable_ai.scr
$sumo_allied_medic exec global/crouch.scr

$sumo_axis_medic nodamage
$sumo_axis_medic threatbias ignoreme
$sumo_axis_medic exec global/disable_ai.scr
$sumo_axis_medic exec global/crouch.scr
end

KT2_trigger_Axis_CP:
$sumo_axis_medic thread KT2_CP_Salute
end

KT2_trigger_Allied_CP:
$sumo_allied_medic thread KT2_CP_Salute
end


// --------------------------------------------------------------------
KT2_CP_Salute:

if ((IsAlive self) & (self.Busy != 1))
{

self.Busy = 1

local.player = parm.other // get player


// iprintln ("Dood Team " + $(self).KT2_Team + " My Team " + local.player.dmteam)


// CP See's You

// self lookat local.player
self turnto local.player
// self waittill turndone


// CP Help or CP Hurt?

if (local.player.dmteam == $(self).KT2_Team)
{

// CP the Good Guy



// CP the Medic
if (local.player.health != 100)
{

// Modified Omaha medic code

self nodamage
self exec global/stand.scr
self upperanim pass_canteen_start
self waittill upperanimdone

self upperanim pass_canteen_idle

local.MedicWait = 1


while (local.MedicWait == 1)
{

self exec global/stand.scr

self upperanim pass_canteen_idle

if (vector_length (local.player.origin - self.origin) >= 200)
{
local.MedicWait = 0
self upperanim pass_canteen_end
// iprintlnbold "*** U walked away ***"

if ( local.player.dmteam == "allies" ) self playsound allied_NoSir
else self playsound axis_NoSir


}
else
{
if (vector_length (local.player.origin - self.origin) < 100)
{
self upperanim pass_canteen_end
local.MedicWait = 0
local.player heal 1
local.player playsound med_kit

// iprintlnbold "You have received health from a medic."
// println "healed"
}
}

wait 1

}

self nodamage

wait 1
self turnto NULL

}


else
{

self holster

if ( local.player.dmteam == "allies" )
{
self anim american_salute
wait 1
self playsound allied_YesSir // Yes Sir
self waittill animdone // wait 1
}
else
{
self anim salute
wait 1
self playsound axis_YesSir // Yes Sir
wait 2 // self waittill animdone
}

self unholster
wait 1
self turnto NULL

}

self exec global/crouch.scr


}

else

// CP Bad :( only works if Axis.... go figure.
{
self attackplayer local.player
}


self.Busy = 0
}

end

I_wanna_paly_too:


$allied_gamer anim chair_actor2_idleloop
$allied_gamer waittill animdone
$allied_gamer anim chair_actor1_idleloop
$allied_gamer waittill animdone

goto I_wanna_paly_too

//self anim chair_radio_listenidle

end

Im_cool:


$allied_gamer2 anim scientist_thought_start
$allied_gamer2 waittill animdone
$allied_gamer2 anim scientist_thought
wait 3
$allied_gamer2 anim scientist_thought_end
$allied_gamer2 waittill animdone
$allied_gamer2 anim scientist_scratch
$allied_gamer2 waittill animdone

//$allied_gamer2 anim stand_balcony_intro
//$allied_gamer2 waittill animdone
//$allied_gamer2 anim stand_balcony_loop01
//$allied_gamer2 waittill animdone
//$allied_gamer2 anim stand_balcony_loop02
//$allied_gamer2 waittill animdone
//$allied_gamer2 anim stand_balcony_outtro
//$allied_gamer2 waittill animdone

//$allied_gamer2 anim german_hit_1
//$allied_gamer2 waittill animdone
//$allied_gamer2 anim german_hit_2
//$allied_gamer2 waittill animdone
//$allied_gamer2 anim german_hit_3
//$allied_gamer2 waittill animdone
//$allied_gamer2 anim caught_smoking1
//$allied_gamer2 waittill animdone
//$allied_gamer2 anim caught_smoking2
//$allied_gamer2 waittill animdone
$allied_gamer2 anim atease
wait 8
//$allied_gamer2 anim lean_standwall_legs
wait 3



/*
$allied_gamer2 anim relax01
wait 3
$allied_gamer2 anim relax02
wait 3
*/

goto Im_cool

end

shovel_move:

while (1)
{
$shoveling_dude anim idle
wait 10
}

goto shovel_move

end

shovel:
$boiler_light light 1 .6 .4 10 // script_model light color/size
$shoveling_dude anim idle
$boiler_flash_fire hide
wait 1
$boiler_flash_fire show
$boiler_light light 1 .6 .4 150 // script_model light color/size
wait .5
goto shovel

end

hoodsounds:

wait 1

$hood_steam loopsound hood_steamloop

wait 1

$hood_brfire loopsound hood_fireplace

wait 1

$hood_br loopsound hood_machine_loop2

end

threat_me:

$threat_me playsound threat_me

end

whatever:

$whatever playsound whatever

end

babys_got_gas:

$farty_sound playsound stinky_bum

salute:


self holster
self.enableEnemy = 0

while(isAlive self)
{
self anim smoking01
self waittill animdone
self anim smoking02
wait (randomint(5) + 2)

self anim smoking04
self waittill animdone
self anim american_salute
self waittill animdone


}
end

camera_mover:



//$smoke_end anim start
$smokestack anim stop

local.player = parm.other
drawhud 0 // clear the screen
//$player nodamage
//$player hide
//freezeplayer
letterbox .5
cuecamera $watch_camera
wait 6.0
locprint 300 300 ("Map By Small_Sumo" + "\n" + "many thanks to" + "\n" + "Jv_map" + "\n" + "TLTrude" + "\n" + "also Sgt Kia for his awesome Skin's")
$watch_camera cut
cuecamera $watch_camera2
wait 2.5
drawhud 1
//setcvar cg_3rd_person 0
$watch_camera2 cut

//cueplayer

end

wakeup:

$sleepy2 anim jumpup_lowerbunk
wait 1
$sleepy2 exec global/enable_ai.scr
$sleepy2 runto sleepy3_dest

$sleepy3 anim jumpup_middlebunk
wait 1
$sleepy3 exec global/enable_ai.scr
$sleepy3 runto sleepy3_dest

//wait 10

//$sleepy2 exec global/enable_ai.scr
//$sleepy3 exec global/enable_ai.scr


end


/*

explode local.set:
for(local.i = 1; local.i <= $exploderchunk.size; local.i++)
{
local.chunk = $exploderchunk[local.i]
if(local.chunk.set == local.set)
{
if(local.chunk.fire != NIL)
{
local.chunk.fx = spawn local.chunk.fire
local.chunk.fx glue local.chunk
local.chunk.fx anim start
local.chunk.fx thread removeatdeath local.chunk
}
}
}
exec global/exploder.scr::explode local.set
end

removeatdeath local.dier:
while(local.dier)
waitframe

if(self)
self remove

end

*/

Posted: Fri Oct 24, 2003 7:55 am
by jv_map
Well couldn't really find any errors, except that this seems a little funny:

Code: Select all

level.alliedwin = 1

// (...)

teamwin axis
Also why is my precious exploder code commented out :cry: lol :)

Cool poll btw, still making up my mind :wink:

Posted: Fri Oct 24, 2003 8:32 am
by small_sumo
Well thats a glaring mistake, thanks for the pickup. I couldnt get it to work, though tom did he sent me a test map even, I ended up with such a huge fireball I though well that might do andget this map out, I would like to egt my head around it so I can use it in future porojects. I think a lot of guys would be interested.

Thanks mate.