Well I need help! My knowledge of scripting is limited to cut & paste & I am looking to do something beyond that level! I have tried several things over the past 2 weeks to be sure I wasn?t giving up to easily.
Here is what I need: A Map Script Spawned switch that has a neutral start position at level spawn, then is axis & allied selectable to activate different threads for each team.
I know how to add the switch entity in that?s no big deal but splitting the trigger with neutral, allied & axis is beyond me! Any help would be gratefully appreciated & I will give credit in score message!
unclebob@wi.rr.com
spawn tirgger through map script
Moderator: Moderators
if i understand you right, you want a switch spawned, with a trigger on it, which can be "owned" by either side? it's an interesting idea,
in any case, you want this little bit to decide if the player touching it is Axis or Allied.
i cant think straight right now because it's 2:30 AM my time and woo... i need sleep... i'l ltry and psot sometime later today. 
in any case, you want this little bit to decide if the player touching it is Axis or Allied.
Code: Select all
if($player[local.i].dmteam == "Allies")
{
iprintlnbold.noloc "You are Allied!"
}
if($player[local.i].dmteam == "Axis")
{
iprintlnbold.noloc "You are Axis!"
}
Moderator
۞
Abyssus pro sapientia
Olympus pro Ignarus
۞
AND STUFF™ © 2006
۞
Abyssus pro sapientia
Olympus pro Ignarus
۞
AND STUFF™ © 2006
Re: spawn tirgger through map script
If u knew how to spawn it... In containerz, there's a switch triggering a turret to shoot either axis or allies. Download the files at the mohaa recycling bin (map section) and take a look urselfunclebob wrote:I know how to add the switch entity in that?s no big deal but splitting the trigger with neutral, allied & axis is beyond me! Any help would be gratefully appreciated & I will give credit in score message!
Well I actualy figgured it out 20min after I posted this.
But have a small problem with it yet. I put extra spawn points aswell as a func_beam in the thread, Beam works shows who holds the spawn. But the spawn points dont work. now I saw that Omaha has the shingle spawns disabled, which hints that then need to be spawned at level spawn then given a wait 2 & removed or disable or what not untill the thread for the proper team is activated & the spawns are reactivated!
Is this right or am I going to far into this & there is a simpler answer?
unclebob
I pulled the info to solve first part from flak88 on ardense & ajusted it to script
But have a small problem with it yet. I put extra spawn points aswell as a func_beam in the thread, Beam works shows who holds the spawn. But the spawn points dont work. now I saw that Omaha has the shingle spawns disabled, which hints that then need to be spawned at level spawn then given a wait 2 & removed or disable or what not untill the thread for the proper team is activated & the spawns are reactivated!
Is this right or am I going to far into this & there is a simpler answer?
unclebob
I pulled the info to solve first part from flak88 on ardense & ajusted it to script
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
So it should be somthing like this then?
I only put in switch A stuff to save forum space why cluder with same thing just difrent names off to work!
I only put in switch A stuff to save forum space why cluder with same thing just difrent names off to work!
[/code]main:
setcvar "g_obj_alliedtext1" "Test"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" "This is only at TEST"
setcvar "g_obj_axistext3" "BEEEEEEEEEEEEEP!!!!!"
setcvar "g_scoreboardpic" "Bep.bsp"
thread mainspawns //<<< Static spawns NO script Run from map start
thread secspawna //<<< script defined spawn for one capture point (point A)
thread secspawnb //<<< script defined spawn for one capture point (point B)
thread ini_switches //<<< used to activate Spawn switching for point A & B
level waittill prespawn
$alla disablespawn //<<< Disabled after spanwing till enabled by switch
$axisa disablespawn //<<< Disabled after spanwing till enabled by switch
$allb disablespawn //<<< Disabled after spanwing till enabled by switch
$axisb disablespawn //<<< Disabled after spanwing till enabled by switch
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/ambient.scr
level.script = "maps/dm/bep.scr"
thread global/exploder.scr::main
level waittill spawn
level.bRoundStarted = 1 //<<< can I remove this from script or is it needed for switches
end
mainspawns:
//Allied
local.allies = spawn info_player_allied
local.allies.angle = 100
local.allies.origin = ( 1500 1500 150 )
local.axis = spawn info_player_axis
local.axis.angle = 100
local.axis.origin = ( 2500 2500 250 )
end
secspawna:
// location A spawns waiting for switch to be selected by a team
local.allies = spawn info_player_allied targetname alla
local.allies.angle = 1
local.allies.origin = ( 1 1 1 )
local.axis = spawn info_player_axis targetname axisa
local.axis.angle = 1
local.axis.origin = ( 11 11 11 )
end
ini_switches:
local.ent = spawn script_model
local.ent model "animate/trainswitch_pulsating.tik"
local.ent.origin = ( 14 14 14 )
local.ent.angle = 0
local.atrig = spawn trigger_use targetname loca_trig
local.atrig.origin = ( 14 14 14 )
local.atrig setsize ( -10 -10 0 ) ( 10 10 50 )
local.atrig setthread control_spawna
end
//Control the spawn A
control_spawna:
if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $obj_hold_spawna.ControlledBy != 0 )
{
//Take the objective
$obj_hold_spawna TakeOver 0
iprintln "The Axis control the spawnA!"
//Axis Spawn
waitthread openaxisa
}
}
else if( parm.other.dmteam == allies )
{
if( $obj_hold_spawna.ControlledBy != 1 )
{
//Take the objective
$obj_hold_spawna TakeOver 1
iprintln "The Allies control the spawnA!"
//Allied Spawn
waitthread openallieda
}
}
thread set_objectives
}
end
set_objectives:
//First lets do the allies
if( $obj_hold_spawna.ControlledBy == 0 || $obj_hold_spawna.ControlledBy == 2 )
{
$obj_hold_spawna SetCurrent 1
}
//Now the Axis
if( $obj_hold_spawnb.ControlledBy == 1 || $obj_hold_spawnb.ControlledBy == 2 )
{
$obj_hold_spawnb SetCurrent 0
}
end
openaxisa:
thread axisspawna
local.spotter = spawn func_beam
local.spotter.origin = ( 8 8 8 )
local.spotter.angles = ( 0 0 0 )
local.spotter endpoint ( 8 8 218 )
local.spotter minoffset 0.0
local.spotter maxoffset 0.0
local.spotter alpha 1.0
local.spotter color ( 1.0 1.0 1.0 )
local.spotter scale 20.0
local.spotter tileshader ("textures/hud/allies_headicon.tga")
local.spotter numsegments 1
local.spotter activate
iprintlnbold "Axis control the spawnA!"
end
spawna:
thread allspawna
local.spotter = spawn func_beam
local.spotter.origin = ( 8 8 8 )
local.spotter.angles = ( 0 0 0 )
local.spotter endpoint ( 8 8 218 )
local.spotter minoffset 0.0
local.spotter maxoffset 0.0
local.spotter alpha 1.0
local.spotter color ( 1.0 1.0 1.0 )
local.spotter scale 20.0
local.spotter tileshader ("textures/hud/allies_headicon.tga")
local.spotter numsegments 1
local.spotter activate
iprintlnbold "Allies control the spawnA!"
end
axisspawna:
$axisa enablespawn
end
allspawna:
$alla enablespawn
end

