Im Trying To Convert This Singlepayer map to an obj map
but cant seem to get the explosives to work correct
it will explode
but wont say objective complete and restart objective again
Code: Select all
//
//training
//Training
//
//
//
//
//
main:
removeclass actor
setcvar "g_obj_alliedtext1" "ALLIES MUST FIND & "
setcvar "g_obj_alliedtext2" "DESTROY THE TANK"
setcvar "g_obj_alliedtext4" "AT All COSTS"
setcvar "g_obj_axistext1" "AXIS MUST DEFEND"
setcvar "g_obj_axistext2" "THE TANK"
setcvar "g_obj_axistext4" "AT All COSTS"
setcvar "g_scoreboardpic" "trainingcourse_sign.tga"
setcvar "g_gametype" "4"
setcvar "session" "4"
setcvar "fraglimit" "0"
setcvar "timelimit" "10"
setcvar "level.clockside" "axis"
// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread objectivethread
level.script = maps/training.scr
$world farplane_color (0 0 0) (0 0 0) (0 0 0) 0 9 0 0
$world farplane 15000
local.axis = spawn info_player_axis
local.axis.angle = 87
local.axis.origin = ( 6347 -2945 -387 )
local.axis = spawn info_player_axis
local.axis.angle = -179
local.axis.origin = ( 6358 -2745 -387 )
local.axis = spawn info_player_axis
local.axis.angle = 161
local.axis.origin = ( 6166 -2935 -387 )
local.axis = spawn info_player_axis
local.axis.angle = -167
local.axis.origin = ( 6148 -2569 -387 )
local.axis = spawn info_player_axis
local.axis.angle = -90
local.axis.origin = ( 5563 -2564 -387 )
local.axis = spawn info_player_axis
local.axis.angle = 89
local.axis.origin = ( 5558 -2947 -387 )
local.axis = spawn info_player_axis
local.axis.angle = -156
local.axis.origin = ( 5848 -2564 -387 )
local.axis = spawn info_player_axis
local.axis.angle = 161
local.axis.origin = ( 5888 -2845 -387 )
local.axis = spawn info_player_axis
local.axis.angle = -166
local.axis.origin = ( 5446 -2571 -387 )
local.axis = spawn info_player_axis
local.axis.angle = 161
local.axis.origin = ( 5434 -2924 -387 )
local.axis = spawn info_player_axis
local.axis.angle = 149
local.axis.origin = ( 5181 -2926 -387 )
local.axis = spawn info_player_axis
local.axis.angle = 89
local.axis.origin = ( 4865 -2934 -387 )
local.axis = spawn info_player_axis
local.axis.angle = -157
local.axis.origin = ( 5137 -2575 -387 )
local.axis = spawn info_player_axis
local.axis.angle = -90
local.axis.origin = ( 4862 -2567 -387 )
local.axis = spawn info_player_axis
local.axis.angle = -140
local.axis.origin = ( 5688 -2572 -387 )
local.axis = spawn info_player_axis
local.axis.angle = -141
local.axis.origin = ( 4973 -2583 -387 )
local.allies = spawn info_player_allied
local.allies.angle = -24
local.allies.origin = ( -5921 1038 69 )
local.allies = spawn info_player_allied
local.allies.angle = -64
local.allies.origin = ( -4295 1031 69 )
local.allies = spawn info_player_allied
local.allies.angle = 90
local.allies.origin = ( -4308 -1106 69 )
local.allies = spawn info_player_allied
local.allies.angle = 25
local.allies.origin = ( -5949 -1093 69 )
local.allies = spawn info_player_allied
local.allies.angle = -13
local.allies.origin = ( -5186 579 -309 )
local.allies = spawn info_player_allied
local.allies.angle = 9
local.allies.origin = ( -6070 -518 -309 )
local.allies = spawn info_player_allied
local.allies.angle = 29
local.allies.origin = ( -5697 -1101 -309 )
local.allies = spawn info_player_allied
local.allies.angle = 28
local.allies.origin = ( -5176 -732 -309 )
local.allies = spawn info_player_allied
local.allies.angle = 35
local.allies.origin = ( -4934 -1133 -309 )
local.allies = spawn info_player_allied
local.allies.angle = 65
local.allies.origin = ( -4531 -1104 -309 )
local.allies = spawn info_player_allied
local.allies.angle = -46
local.allies.origin = ( -4597 987 -309 )
local.allies = spawn info_player_allied
local.allies.angle = -50
local.allies.origin = ( -5623 561 -309 )
local.allies = spawn info_player_allied
local.allies.angle = 53
local.allies.origin = ( -5580 -708 -309 )
local.allies = spawn info_player_allied
local.allies.angle = 95
local.allies.origin = ( -4812 -761 -309 )
local.allies = spawn info_player_allied
local.allies.angle = -89
local.allies.origin = ( -4856 673 -309 )
$door_mid remove
$exterior remove
$interior remove
$clip_2 delete
roundbasedthread:
// Can specify different scoreboard messages for round based games here.
level waittill prespawn
exec global/loadout.scr "maps/training.scr"
exec maps/fix0.scr
exec maps/fix0a.scr
exec maps/fix0b.scr
exec global/DMprecache.scr
exec global/obj_dm.scr
exec global/exploder.scr
exec global/jv_sound.scr
exec global/bomber.scr
exec global/door_locked.scr
exec global/ambient.scr training
exec global/bomb_explode.scr
thread flak88
thread global/barrel.scr::explosive_barrel
thread p47flyby
thread global/exploder.scr::main
thread tank_sound
local.soundorigin = spawn script_model model "fx/dummy.tik"
local.soundorigin.origin = local.origin
local.soundorigin loopsound local.sound
local.soundorigin notsolid
$player stufftext "tmstop"
$player stufftext "tmstartloop sound/music/mus_06a_mystery.mp3"
$pistol_ammo thread ammo_spawners pistol
$rifle_ammo thread ammo_spawners rifle
$smg_ammo thread ammo_spawners smg
$ammo_grenade thread ammo_spawners grenade
$mg42 maxYawOffset 45
$mg42 pitchCaps ( -15 15 0)
thread start
thread ladder
thread explosives
thread doors
thread pistol
thread smg
thread rifle
thread grenade
thread mg42
end
level waittill spawn
// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw
level waittill roundstart
tank_sound:
level.tank_idle_entity = spawn script_model model "fx/dummy.tik"
level.tank_idle_entity.origin = ($tank.origin + ( 0 0 200))
level.tank_idle_entity notsolid
println "z: level.tank_idle_entity: " level.tank_idle_entity.origin
level.tank_idle_entity loopsound tank_idle_training
$tank loopsound tank_idle_training
end
start:
end
//=======================
ladder:
end
//=======================
explosives:
$explosives_trigger waittill trigger
while (level.flags[explosive] != 1)
wait 1
waitthread global/objectives.scr::add_objectives 4 3
level.bomb_appeared = 1
$explosive_off show
waitthread global/objectives.scr::add_objectives 5 2 "Plant the explosives on the tank." $explosive_on.origin
waitthread global/objectives.scr::current_objectives 5
waitthread dialog_plant_explosives
while (level.bomb_set != 1)
wait 1
waitthread global/objectives.scr::add_objectives 5 3
waitthread dialog_moveaway_explosives
while (level.flags[tank] != 1)
wait 1
//=======================
waitthread global/objectives.scr::add_objectives 6 2 "Complete the rest of training." $final_door.origin
waitthread global/objectives.scr::current_objectives 6
$doors_dialog_trigger waittill trigger
thread dialog_doors
$door_2_triggeruse thread door_wait $door_3
$door_3_triggeruse thread door_wait $door_2
end
//=======================
pistol:
end
//=======================
smg:
end
//=======================
rifle:
end
//=======================
grenade:
end
//=======================
mg42:
end
/////----------------------------
feedback_delay:
end
grenade_target:
end
ammo_spawners local.type:
local.ammo_origin = self.origin
local.ammo_angles = self.angles
while (1)
{
if (local.type == "pistol")
local.item = spawn models/items/item_pistol_ammobox.tik
if (local.type == "smg")
local.item = spawn models/items/item_smg_ammobox.tik
if (local.type == "rifle")
local.item = spawn models/items/item_rifle_ammobox.tik
if (local.type == "grenade")
local.item = spawn models/weapons/m2frag_grenade_sp.tik
local.item.origin = local.ammo_origin
local.item.angles = local.ammo_angles
while (local.item)
wait 1
println "z: " self " is gone. respawning"
if (self.targetname == "ammo_grenade")
level.got_grenade = 1
wait 5
while ($player cansee self 100)
{
println "z: player cansee: " self
println "z: waitting on spawn"
wait 1
}
}
end
seencheck:
end
obj6:
//CALLED BY BSP WHEN EXPLOSIVES ARE PICKED UP
waitthread global/items.scr::add_item "explosives"
$explosive hide
level.flags[explosive] = 1
end
obj6b:
//CALLED BY BSP WHEN BOMB IS PLANTED
if (level.bomb_appeared == 1)
{
if (level.bomb_set == 1)
end
level.bomb_set = 1
$explosive_off hide
$explosive_on show
$explosive_on playsound plantbomb
$explosive_on loopsound bombtick
waitthread global/items.scr::remove_item "explosives"
$player stopwatch 15
wait 15
$explosive_on stoploopsound bombtick
$explosive_on hide
level.tank_idle_entity stoploopsound
// $tank stoploopsound
$tank playsound explode_tank
exec global/model.scr $explosive_on.origin "models/emitters/explosion_mine.tik"
wait 0.3
exec global/model.scr $tank.origin "models/emitters/mortar_higgins.tik"
$tank.gun = $tank QueryTurretSlotEntity 0
$tank.gun2 = $tank QueryTurretSlotEntity 1
if ($tank.gun)
{
$tank DetachTurretSlot 0
$tank.gun remove
}
if ($tank.gun2)
{
$tank DetachTurretSlot 1
$tank.gun2 remove
}
local.ent = spawn script_model
local.ent model "vehicles/tigertank_d.tik"
local.ent.origin = $tank.origin
local.ent.angles = $tank.angles
$tank remove
level.flags[tank] = 1
//radiusdamage self.origin level.bomb_damage level.bomb_explosion_radius
radiusdamage $explosive_on.origin 1000 600
}
end
door_wait local.other_door:
end
theplane:
if (level.theplane != 1)
{
level.theplane = 1
wait 1
thread global/bomber.scr::bomb 1 1
thread global/bomber.scr::bomb 2 1
thread global/bomber.scr::bomb 3 1
thread global/bomber.scr::bomb 7 1
}
end
rotatedown local.amount:
self rotateydown local.amount
self waitmove
end
rotateup local.amount:
self rotateyup local.amount
self waitmove
end
p47flyby:
//***flyby of p47 as player enters level
// wait 0.75
thread global/bomber.scr::bomb 4
thread global/bomber.scr::bomb 5
end
easter_egg:
thread global/bomber.scr::bomb 6
end
/////----------------------------
dialog_start:
end
dialog_mouse:
end
dialog_movement:
end
dialog_objectives:
end
dialog_objective_complete:
end
dialog_jump:
end
dialog_duck:
end
dialog_ladder:
end
dialog_down_ladder:
end
dialog_explosives:
end
dialog_inventory:
end
dialog_plant_explosives:
end
dialog_moveaway_explosives:
end
dialog_doors:
end
dialog_locked_doors:
end
dialog_health:
end
dialog_pistol:
end
dialog_thompson:
end
dialog_springfield:
end
dialog_grenade:
end
dialog_mg42:
end
dialog_end_warning:
end
dialog_end:
end
spawn_damaged local.model:
local.damaged = spawn script_model model local.model
local.damaged.origin = self.origin
local.damaged.angles = self.angles
end local.damaged
//******************************
// jitter large effect
// jitter_large [delay]
//******************************
jitter_large local.time:
if (local.time)
wait local.time
waitexec global/earthquake.scr .35 10 0 0
waitexec global/earthquake.scr .23 6 0 0
waitexec global/earthquake.scr 1 1 0 0
waitexec global/earthquake.scr 1.25 .3 0 1
end
