blocking SOME spawnpoints
Posted: Mon Mar 17, 2008 11:08 pm
ok guys im here with another problem lol....im modding mohdm6 (stalingrad) and im trying to get the boiler to be a bash area only so i need to take out the spawnpoints in that area...i have already got the coords and put them in the script but they dont work...i have tried waitthread and thread but neither will help...heres the script if anyone can tell me whats wrong with it
P.S. All the other things work i.e the spawned items and the triggers and teleports all work fine just the spawnblock isnt working
Code: Select all
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Stalingrad"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "mohdm6"
switch (waitthread global/libmef/util.scr::get_gametype)
{
case "ctf":
case "ftctf":
thread setup_randomized_ctf_bases
break
case "ft":
case "rbm":
waitthread global/libmef/spawn.scr::spawnblock_begin
break
case "dem":
case "ftdem":
waitthread setup_dem_bases
break
}
waitthread teletrig
waitthread teletrig1
//-----------------------------------------------------------------------------
level waittill prespawn
//-----------------------------------------------------------------------------
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 423 324 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 398 324 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 373 324 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 348 324 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 323 324 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 423 324 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 298 325 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 273 325 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 248 325 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 223 326 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 198 326 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 173 326 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 148 327 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 148 327 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 123 327 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 98 328 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 73 328 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 48 328 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 23 329 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 -2 329 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 -27 329 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 -52 330 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 -77 330 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 -102 330 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 -127 331 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 -152 331 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( -185 -177 331 ) angle ( 270 )
local.fix1 = spawn script_model model models/static/bshelf-tall-thin.tik origin ( -600 -699 272 ) angle ( 360 )
local.fix1 = spawn script_model model models/static/bshelf-tall-thin.tik origin ( -600 -731 272 ) angle ( 360 )
local.fix1 = spawn script_model model models/static/bshelf-tall-thin.tik origin ( -600 -763 272 ) angle ( 360 )
local.fix1 = spawn script_model model models/static/cratelid2.tik origin ( 875 50 45 ) setsize ( -5 -85 -85 ) ( 5 85 85 )
local.clip = spawn script_object
local.clip.origin = ( 875 65 30 )
local.clip.angles = ( 0 0 0)
local.clip setsize ( -85 -125 -5 ) ( 85 125 5 )
local.clip solid
local.clip nodamage
local.static = spawn script_model
local.static model "static/cratelid2.tik"
local.static.origin = ( 875 65 25 )
local.static.angles = ( 0 0 0 )
local.static.scale = 12.0
local.trig = spawn trigger_multiple
local.trig.origin = ( 872 190 -75 )
local.trig setsize ( -82 -5 -60 ) ( 82 5 60 )
local.trig setthread Trigger1
local.trig2 = spawn trigger_multiple
local.trig2.origin = ( 66 -535 -75 )
local.trig2 setsize ( -35 -25 -45 )( 35 25 45 )
local.trig2 setthread Trigger2
local.trig3 = spawn trigger_multiple
local.trig3.origin = ( 124 103 -67)
local.trig3 setsize ( -85 -45 -100 )( 85 45 100 )
local.trig3 setthread Trigger3
local.trig4 = spawn trigger_multiple
local.trig4.origin = ( 315 111 300)
local.trig4 setsize ( -35 -25 -45 )( 35 25 45 )
local.trig4 setthread Trigger4
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/door_locked.scr::lock
level.script = maps/dm/mohdm6.scr
exec global/ambient.scr mohdm6
exec global/spin.scr
exec global/burn.scr
//-----------------------------------------------------------------------------
level waittill spawn
//-----------------------------------------------------------------------------
if (level.mef_baseversion == "sh" || level.mef_baseversion == "bt")
{
$world commanddelay 0 farclipoverride -1
}
end
thread blockingSpawnpoints
end
blockingSpawnpoints:
thread blockSpawnPoint ( 240 -72 -136 ) //these 3 in boiler room
thread blockSpawnPoint ( 240 -136 -136 )
thread blockSpawnPoint ( 240 -104 -136 )
thread blockSpawnPoint ( 848 -48 -136 ) //axis these 3 near bash room inside trigger
thread blockSpawnPoint ( 912 -48 -136 ) //allied
thread blockSpawnPoint ( 880 -48 -136 ) //ffa spawn
end
blockSpawnPoint local.o:
local.trig = spawn trigger_multiple
local.trig.origin = local.o
local.trig setsize ( -2 -2 -2 ) ( 2 2 1 )
local.trig wait 0.2
local.trig delay 0.0
local.trig.dummy = spawn fx/dummy.tik
local.trig.dummy.origin = local.o
local.trig.dummy setsize ( -2 -2 -1 ) ( 2 2 1 )
local.trig.dummy solid
local.trig setthread doSpawnPointBlock
end
doSpawnPointBlock:
local.player = parm.other
self.dummy notsolid
while (local.player istouching self)
waitframe
wait 1
self.dummy solid
end
Trigger1:
local.player=parm.other
local.player takeall
local.player item weapons/silencedpistol.tik
local.player ammo pistol 0
local.player useweaponclass pistol
end
Trigger2:
local.player=parm.other
local.player takeall
local.player item weapons/silencedpistol.tik
local.player ammo pistol 0
local.player useweaponclass pistol
end
Trigger3:
local.player=parm.other
local.player takeall
local.player item weapons/silencedpistol.tik
local.player ammo pistol 0
local.player useweaponclass pistol
end
Trigger4:
local.player=parm.other
local.player takeall
local.player item weapons/silencedpistol.tik
local.player ammo pistol 0
local.player useweaponclass pistol
end
teletrig:
local.smoke1 = spawn script_model model "static/corona_reg.tik"
local.smoke1 origin ( -1051 502 130 )
local.smoke1 light 1 1 1 5 // r g b radius
local.smoke1 scale .05
local.smoke1 notsolid
local.trig = spawn trigger_multiple
local.trig.origin = ( -1051 502 100 )
local.trig setsize ( -10 -5 -10 ) ( 10 5 10)
local.trig targetname port
$port setthread teleport
end
teleport:
self waittill trigger
local.player = parm.other
local.player tele ( -959 -42 131 )
teletrig1:
local.smoke1 = spawn script_model model "static/corona_reg.tik"
local.smoke1 origin ( -994 90 130 )
local.smoke1 light 1 1 1 25 // r g b radius
local.smoke1 scale 1
local.smoke1 notsolid
local.trig = spawn trigger_multiple
local.trig.origin = ( -994 90 105 )
local.trig setsize ( -10 -10 -10 ) ( 10 10 10)
local.trig targetname port1
$port1 setthread teleport1
end
teleport1:
self waittill trigger
local.player = parm.other
local.player tele ( -771 -222 -50 )
end
//-----------------------------------------------------------------------------
setup_dem_bases:
level.mef_settings["ticktime"] = 60
if (level.mef_gametype == "dem")
{
level.mef_settings["respawn"] = 1
}
waitthread global/libmef/util.scr::read_gametype_settings
if (level.mef_gametype == "ftdem" || !level.mef_settings["respawn"])
{
waitthread global/libmef/spawn.scr::spawnblock_begin
if (level.mef_alliedspawnregion == "se")
{
local.seteam = "allies"
local.nwteam = "axis"
} else
{
local.seteam = "axis"
local.nwteam = "allies"
}
} else
{
local.seteam = "both"
local.nwteam = "both"
}
// -- Base Locations --
// Team Coordinates Angle Description
// ====== ==================== ===== ===========================================
waitthread global/libmef/bases.scr::addbase local.seteam " -898 904 496.13 -90 South Bldg Top Level"
waitthread global/libmef/bases.scr::addbase local.seteam "-1164 -872 272.13 45 South Bldg Staircase"
waitthread global/libmef/bases.scr::addbase local.seteam " -959 904 256.13 -90 South Bldg Bottom Level"
waitthread global/libmef/bases.scr::addbase local.nwteam " 379 447 408.13 90 West Bldg Mid Stairs"
waitthread global/libmef/bases.scr::addbase local.seteam " -108 -624 32.13 90 East Bldg Bottom Level"
waitthread global/libmef/bases.scr::addbase local.seteam " -103 -624 272.13 90 East Bldg Top Level"
waitthread global/libmef/bases.scr::addbase local.nwteam " -39 840 32.13 -90 West Bldg First Floor South Side"
waitthread global/libmef/bases.scr::addbase local.nwteam " 752 467 32.13 -180 West Bldg First Floor North Side Balcony"
waitthread global/libmef/bases.scr::addbase local.nwteam " -82 865 272.13 -90 West Bldg Second Floor South Side"
waitthread global/libmef/bases.scr::addbase local.nwteam " 752 468 272.13 -180 West Bldg Second Floor North Side Balcony"
waitthread global/libmef/bases.scr::addbase local.nwteam " -224 585 512.13 0 West Bldg Third Floor South Side"
waitthread global/libmef/bases.scr::addbase local.nwteam " 928 557 512.13 180 West Bldg Third Floor North Side"
waitthread global/libmef/bases.scr::addbase local.nwteam " 339 563 -151.88 90 West Bldg Staircase Bottom"
waitthread global/libmef/bases.scr::addbase both " 673 160 -151.88 -90 Boiler Room"
waitthread global/libmef/bases.scr::addbase both " 223 -129 32.13 0 Locker Room"
waitthread global/libmef/bases.scr::addbase both " 1259 -363 304.13 145 North-East Roof Corner"
waitthread global/libmef/bases.scr::addbase both " 176 -240 -115.00 145 Courtyard North Side"
waitthread global/libmef/bases.scr::addbase both " -784 148 -145.22 0 Courtyard South Side"
end
setup_randomized_ctf_bases:
waitthread global/libmef/util.scr::read_gametype_settings
if (level.mef_gametype == "ftctf" || !level.mef_settings["respawn"])
{
waitthread setup_nonrespawn_ctf_bases
end
}
// lists the possible base locations for the map
level.ctf_spots[0] = waitthread new_ctf_spot "1132 -368 304.13 90" "NR" // North Roof
level.ctf_spots[1] = waitthread new_ctf_spot "-1164 301 496.13 0" "S3" // South Bldg 3rd Floor
level.ctf_spots[2] = waitthread new_ctf_spot "-1164 467 256.13 0" "S2" // South Bldg 2nd Floor
level.ctf_spots[3] = waitthread new_ctf_spot "-553 -872 272.13 90" "ED" // East Bldg Dresser
level.ctf_spots[4] = waitthread new_ctf_spot "-132 -624 272.13 90" "E2" // East Bldg 2nd Floor
level.ctf_spots[5] = waitthread new_ctf_spot "-107 -624 32.12 90" "E1" // East Bldg 1st Floor
level.ctf_spots[6] = waitthread new_ctf_spot "176 656 512.13 180" "W3S" // West Bldg 3rd Floor South Side
level.ctf_spots[7] = waitthread new_ctf_spot "829 1088 512.13 -90" "W3N" // West Bldg 3rd Floor North Side
level.ctf_spots[8] = waitthread new_ctf_spot "-512 699 272.13 0" "W2S" // West Bldg 2nd Floor South Side
level.ctf_spots[9] = waitthread new_ctf_spot "829 1088 272.14 -90" "W2N" // West Bldg 2nd Floor North Side
level.ctf_spots[10] = waitthread new_ctf_spot "-512 697 32.13 0" "W1S" // West Bldg 1st Floor South Side
level.ctf_spots[11] = waitthread new_ctf_spot "829 1088 32.13 -90" "W1N" // West Bldg 1st Floor North Side
level.ctf_spots[12] = waitthread new_ctf_spot "646 -186 32.13 90" "B" // Boiler Room
for (local.i = 0; local.i < level.ctf_spots.size; local.i++)
{
level.ctf_spotlu[level.ctf_spots[local.i].abbr] = level.ctf_spots[local.i]
}
// determines which base locations can be selected along with the given base
level.ctf_spotcomps["NR"] = "S3"::"S2"::"ED"::"E2"::"W3S"::"W2S"::"W1S"
level.ctf_spotcomps["S3"] = "E2"::"W3N"::"W2S"::"W2N"::"B"
level.ctf_spotcomps["S2"] = "E2"::"E1"::"W2S"::"W2N"::"W1S"::"W1N"::"B"
level.ctf_spotcomps["ED"] = "W3S"::"W3N"::"W2S"::"W2N"::"W1S"::"W1N"::"B"
level.ctf_spotcomps["E2"] = "W3S"::"W3N"::"W2S"::"W2N"::"W1S"::"W1N"
level.ctf_spotcomps["E1"] = "W1S"::"W1N"::"B"
level.ctf_spotcomps["W3S"] = "W1N"::"B"
level.ctf_spotcomps["W3N"] = "W1S"::"W1N"::"B"
level.ctf_spotcomps["W2S"][1] = "B"
level.ctf_spotcomps["W2N"][1] = "B"
level.ctf_spotcomps["W1S"][1] = "B"
level.ctf_spotcomps["W1N"][1] = "B"
// determines which spawns are disabled for the given base
// prevents the opposing team from spawning near a team's base
level.ctf_spotspawn["NR"] = "NR,W3N"
level.ctf_spotspawn["S3"] = "S3,SST"
level.ctf_spotspawn["S2"] = "S3,S2,SSB"
level.ctf_spotspawn["ED"] = "SST,SSB,ES2"
level.ctf_spotspawn["E2"] = "E2,ES2"
level.ctf_spotspawn["E1"] = "E1,E1B,ES1"
level.ctf_spotspawn["W3S"] = "S3,W3SB,W3S,W3N"
level.ctf_spotspawn["W3N"] = "W3SB,W3S,W3N"
level.ctf_spotspawn["W2S"] = "W2SB,W2S,W2N"
level.ctf_spotspawn["W2N"] = "W2SB,W2S,W2N"
level.ctf_spotspawn["W1S"] = "W1SB,W1S,W1N"
level.ctf_spotspawn["W1N"] = "W1SB,W1S,W1N"
level.ctf_spotspawn["B"] = "B,CS"
local.spotconfigs = waitthread enumerate_spot_configs level.ctf_spots level.ctf_spotcomps
local.spotconfig = local.spotconfigs[randomint(local.spotconfigs.size)]
if (randomint(2) == 0)
{
local.alliedspot = local.spotconfig[0]
local.axisspot = local.spotconfig[1]
} else
{
local.alliedspot = local.spotconfig[1]
local.axisspot = local.spotconfig[0]
}
level.ctf_settings["alliedbase"] = local.alliedspot.pos
level.ctf_settings["axisbase"] = local.axisspot.pos
level waittill prespawn
waitthread global/libmef/spawn.scr::close_spawns (waitthread global/libmef/spawn.scr::define_spawnregion "axis" level.ctf_spotspawn[local.alliedspot.abbr])
waitthread global/libmef/spawn.scr::close_spawns (waitthread global/libmef/spawn.scr::define_spawnregion "allies" level.ctf_spotspawn[local.axisspot.abbr])
end
new_ctf_spot local.pos local.abbr:
local.ent = spawn Listener
local.ent.pos = local.pos
local.ent.abbr = local.abbr
end local.ent
enumerate_spot_configs local.spots local.spotconfigs:
local.result[0] = NIL
local.k = 0
for (local.i = 0; local.i < local.spots.size; local.i++)
{
local.spotname = local.spots[local.i].abbr
local.spotconfig = local.spotconfigs[local.spotname]
for (local.j = 1; local.j < (local.spotconfig.size + 1); local.j++)
{
local.result[local.k][0] = local.spots[local.i]
local.result[local.k][1] = level.ctf_spotlu[local.spotconfig[local.j]]
local.k++
}
}
end local.result
setup_nonrespawn_ctf_bases:
waitthread global/libmef/spawn.scr::spawnblock_begin
if (level.mef_alliedspawnregion == "se")
{
local.seteam = "allies"
local.nwteam = "axis"
} else
{
local.seteam = "axis"
local.nwteam = "allies"
}
waitthread global/libmef/bases.scr::addbase local.seteam "-553 -872 272.13 90" // East Bldg Dresser
waitthread global/libmef/bases.scr::addbase local.seteam "-132 -624 272.13 90" // East Bldg 2nd Floor
waitthread global/libmef/bases.scr::addbase local.seteam "-107 -624 32.12 90" // East Bldg 1st Floor
waitthread global/libmef/bases.scr::addbase local.nwteam "829 1088 512.13 -90" // West Bldg 3rd Floor North Side
waitthread global/libmef/bases.scr::addbase local.nwteam "-512 699 272.13 0" // West Bldg 2nd Floor South Side
waitthread global/libmef/bases.scr::addbase local.nwteam "829 1088 272.14 -90" // West Bldg 2nd Floor North Side
waitthread global/libmef/bases.scr::addbase local.nwteam "-512 697 32.13 0" // West Bldg 1st Floor South Side
waitthread global/libmef/bases.scr::addbase local.nwteam "829 1088 32.13 -90" // West Bldg 1st Floor North Side
end