Here my script, the moveable objective segment is the last part of the script. I admit i
cannot script very well and i barely understand it although the rest of the script is done, with help from other scripts.
// billandben
// ARCHITECTURE: billandben
// SCRIPTING: billandben
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "We have to protect"
setcvar "g_obj_alliedtext2" "the train and the"
setcvar "g_obj_alliedtext3" "documents"
setcvar "g_obj_axistext1" "Destroy the train"
setcvar "g_obj_axistext2" "and retrieve those"
setcvar "g_obj_axistext3" "ducuments"
setcvar "g_scoreboardpic" "none"
level waittill prespawn
exec global/DMprecache.scr
level.script = maps/obj/train_station.scr
exec global/ambient.scr m5l1b
thread global/exploder.scr::main
level.farplane = 5000.000000
$world farplane level.farplane
$world farplane_color (.1 .1 .2)
document2_random_setup local.explosive local.weapon local.point_at local.base local.number_of_locations:
local.location = ((randomint (local.number_of_locations)) + 1)
local.trigger_offset = self.origin - local.base.origin
local.weapon_offset = local.weapon.origin - local.base.origin
local.explosive_offset = local.explosive.origin - local.base.origin
local.point_at_offset = local.point_at.origin - local.base.origin
local.location = $("document2_location" + local.location)
local.base.origin = local.location.origin
self.origin = local.trigger_offset + local.base.origin
local.weapon.origin = local.weapon_offset + local.base.origin
local.explosive.origin = local.explosive_offset + local.base.origin
local.point_at.origin = local.point_at_offset + local.base.origin
local.weapon setaimtarget local.point_at
level waittill spawn
level.defusing_team = "allies"
level.planting_team = "axis"
level.targets_to_destroy = 3
level.bomb_damage = 200
level.bomb_explosion_radius = 2048
level.dmrespawning = 0
level.dmroundlimit = 8
level.clockside = allies
//level waittill roundstart
$train_bomb thread global/obj_dm.scr::bomb_thinker
$desk_document_trigger thread document_check
$desk_document2_trigger thread document_check
thread axis_win_bomb
thread allies_win_timer
end
axis_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy)
waitframe
teamwin axis
end
allies_win_timer:
level waittill allieswin
end
document_check:
while(1) { // forever
self waittill trigger
if(parm.other.dmteam == axis) {
self.target hide
level.targets_destroyed ++ // ++ adds 1
break
}
waitframe
}
end
desk_document2_random_setup local.explosive local.weapon local.point_at local.base local.number_of_locations:
local.location = ((randomint (local.number_of_locations)) + 1)
local.trigger_offset = self.origin - local.base.origin
local.weapon_offset = local.weapon.origin - local.base.origin
local.point_at_offset = local.point_at.origin - local.base.origin
local.location = $("desk_document2_location" + local.location)
local.base.origin = local.location.origin
self.origin = local.trigger_offset + local.base.origin
local.weapon.origin = local.weapon_offset + local.base.origin
local.point_at.origin = local.point_at_offset + local.base.origin
local.weapon setaimtarget local.point_at
end
Ive put in the script_orgin in the map (as in The Hunt) with the targetnames of "desk_document2_location1/2/3 or 4" in various positions in the map. The documents name is "desk_document2" and the trigger is, yes you guessed it, "desk_document2_trigger.
Hope you can help, thx
