Moving object location
Moderator: Moderators
-
Daniel Radcliffe
- Second Lieutenant
- Posts: 168
- Joined: Fri May 30, 2003 9:49 am
Moving object location
Is it possible to have a capture documents objective where the objective randomly spawns in 1 of a few locations.
My map has a bomb and 2 capture documents objectives in it, i would like to cut this down to 1 bomb and 1 capture documents objective, but have it so that the capture the bomb objective moves around forceing the offensive team to search for the objective.
Also if it is possible can anyone show me how to script it or give me some links on where i can learn it.
Thx
My map has a bomb and 2 capture documents objectives in it, i would like to cut this down to 1 bomb and 1 capture documents objective, but have it so that the capture the bomb objective moves around forceing the offensive team to search for the objective.
Also if it is possible can anyone show me how to script it or give me some links on where i can learn it.
Thx
-
SNakeFluGeL
- Sergeant
- Posts: 56
- Joined: Wed Jul 02, 2003 4:52 pm
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Ello Daniel!
About random objective locations: look at the map script for "The Hunt", located in pak5.pk3 ( in maps/obj/ ). It kontains a random placement of the Flak88 gun and bomb. Thats a way to do it.
Another way is to randomly hide one of the documents at map start and make its trigger untriggerable.
About random objective locations: look at the map script for "The Hunt", located in pak5.pk3 ( in maps/obj/ ). It kontains a random placement of the Flak88 gun and bomb. Thats a way to do it.
Another way is to randomly hide one of the documents at map start and make its trigger untriggerable.
-
Daniel Radcliffe
- Second Lieutenant
- Posts: 168
- Joined: Fri May 30, 2003 9:49 am
-
Daniel Radcliffe
- Second Lieutenant
- Posts: 168
- Joined: Fri May 30, 2003 9:49 am
OK, ive looked at the script for The Hunt now and m still having probs, i think i can see how it should be done, the only prob is i cant even get it to work for The Hunt.
I done an exact copy of the gun/trigger/locations poiunts etc and moved it into another map to test the script out, after several failed attempts i tried it with the origional script changing the necessary map name etc within the script and still this failed.
Now im stuck and not sure how to proceed, any advice that can be offered as to what may be causing the problem or how to proceed would be appreciated.
Thx
I done an exact copy of the gun/trigger/locations poiunts etc and moved it into another map to test the script out, after several failed attempts i tried it with the origional script changing the necessary map name etc within the script and still this failed.
Now im stuck and not sure how to proceed, any advice that can be offered as to what may be causing the problem or how to proceed would be appreciated.
Thx
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
-
Daniel Radcliffe
- Second Lieutenant
- Posts: 168
- Joined: Fri May 30, 2003 9:49 am
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
// 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
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Code: Select all
// 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)
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 spawn
//level waittill roundstart
thread document_random_setup
$train_bomb thread global/obj_dm.scr::bomb_thinker
$document_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 nottriggerable
self.target hide
level.targets_destroyed ++ // ++ adds 1
break
}
waitframe
}
end
document_random_setup:
local.location = ((randomint 2) + 1)
local.location_entity = $("document_location_" local.location)
$document.origin = local.location_entity.origin
$document_trigger = local.location_entity.origin
endYou have 2 script origins at the locations where you want the docs to alter between with:
targetname / document_location_1
targetname / document_location_2
You have ONE document with:
targetname / document
You have ONE document trigger with:
targetname / document_trigger
The document and its trigger will be moved to the location of the selected originn by the document_random_setup thread.
( I have not tested this script, its straight from my brain... so its not fool proof... check the consol for any errors )
-
Daniel Radcliffe
- Second Lieutenant
- Posts: 168
- Joined: Fri May 30, 2003 9:49 am
Ive set it up as you specified but unfortunatly the script has stopped working at all, i now get no farplane or anything.
Is it because i have 1 bomb objective and 2 document objectives in it?
or is it some other problem?
Ive made a pk3 with the files in so you can take a look at them if you want too. http://www.billandben79.pwp.blueyonder. ... tation.pk3
Is it because i have 1 bomb objective and 2 document objectives in it?
or is it some other problem?
Ive made a pk3 with the files in so you can take a look at them if you want too. http://www.billandben79.pwp.blueyonder. ... tation.pk3
-
Daniel Radcliffe
- Second Lieutenant
- Posts: 168
- Joined: Fri May 30, 2003 9:49 am
OK, ive created a console log and this error appears, can someone tell me what it is and how to correct it plz.
Thx[/quote]bad lvalue: 24 (expecting field or array)
$document_trigger = local.location_entity.origin (maps/obj/train_station.scr, 75)
^
^~^~^ Script file compile error: Couldn't compile 'maps/obj/train_station.scr'
ScriptMaster::GetScript: Script 'maps/obj/train_station.scr' was not properly loaded
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
[/quote]Daniel Radcliffe wrote:OK, ive created a console log and this error appears, can someone tell me what it is and how to correct it plz.
Thxbad lvalue: 24 (expecting field or array)
$document_trigger = local.location_entity.origin (maps/obj/train_station.scr, 75)
^
^~^~^ Script file compile error: Couldn't compile 'maps/obj/train_station.scr'
ScriptMaster::GetScript: Script 'maps/obj/train_station.scr' was not properly loaded
Should be
$document_trigger.origin = local.location_entity.origin
-
Daniel Radcliffe
- Second Lieutenant
- Posts: 168
- Joined: Fri May 30, 2003 9:49 am
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
