Page 4 of 4
Posted: Fri May 16, 2003 6:23 am
by mohaa_rox
maybe i'll help ya script it if nuggets doesn't want to.

Posted: Fri May 16, 2003 1:41 pm
by Jack Ruby
My loading screen is gonna look like a wall of grafitti with everyone thats helped name on there
Rox I may well take you up on that offer, Nuggets has done a fantastic job so far, I have been bugging him for weeks now, sorry Nuggets, I know you have your own things to do, your help has been MUCHO apreciated, when I am flush with cash I will send you those Stellas, I promise.
I may try using the Slyk style objectives or probably will use the script we have working now, I may just make it harder for people to achieve all three objectives which should make for better gameplay, I will need to adjust the layout of the map a little to put the switches in more easily defended positions, right now they are pretty out in the open.
Thanks for everyones help on this, its been a major mission I know !
Posted: Fri May 16, 2003 9:34 pm
by nuggets
sorry 4 the reply i gave, but i'm just being honest...
things are really starting 2 get on top of me at the moment and with my college coursework being due in 2 wks, it's not helping a lot at all,
by getting some1 else 2 do the scripting it'll speed up the release of ur map, if u wait 4 me it'll be waiting as long as it has already and then some...
but i don't mind, i'm just here 2 help people along the way and give them a gentle shove in the right direction
and now ur asking urself... why the hell did i ask him in the 1st place

Posted: Fri May 16, 2003 11:20 pm
by Jack Ruby
No reason to aplogise for anything at all man, I have really apreciated the help, dont stress it man, take it easy, nice one

Posted: Sun May 18, 2003 1:29 am
by Jack Ruby
Rox, do you own a copy of Spearhead ?
Posted: Sun May 18, 2003 3:09 am
by mohaa_rox
yup

Posted: Sun May 18, 2003 11:33 am
by Jack Ruby
Well Rox, during a TOW game, when you hold down the TAB key you can see the check boxes which have a cross in them displaying which objectives you need to achieve or which you have already done, the script is not displaying the crosses that should be displayed.
Also in TOW when you achieve an objective, its plays a sound like " We've completed an objective ", this script is also not doing that, I think I have a slight idea why its not playing the sounds, anything to do with this missing from the script ? $obj1 TakeOver 1 ??
below is the latest script, anyone have any ideas,
main:
level.script = "maps/obj/MP_peenemunde_TOW.scr"
exec global/tow_dm.scr
exec global/ambient.scr mohdm7
//gametype 5 = Tug of War
level.gametype = 5
if ( level.gametype == 5 )
{
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Cut factory electrics"
setcvar "g_obj_alliedtext2" "Turn fuel pumps on"
setcvar "g_obj_alliedtext3" "Disable tracking radar"
setcvar "g_obj_axistext1" "Get factory electrics on"
setcvar "g_obj_axistext2" "Turn the fuel pumps on"
setcvar "g_obj_axistext3" "Enable tracking radar"
}
else
{
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Peenemunde"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" "Death! or Glory?"
setcvar "g_obj_axistext1" "Peenemunde"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" "Death! or Glory?"
//Not a TOW game remove the bombs
$allie_bomb remove
$axis_bomb remove
}
//////////////////////////
level waittill prespawn
//////////////////////////
//////////////////////////
level waittill spawn
//////////////////////////
iprintlnbold_noloc "Welcome to [Spec Ops] Peenemunde!"
level.nuggetsObjectives = 0 //no objectives completed
level.switch1owner = 0 //0 meaning neutral
level.switch2owner = 0
level.switch3owner = 0
level.bRoundStarted = 0
level.axisFire = 1
// set the parameters for this round based match
level.dmrespawning = 1 // 1 or 0
level.dmroundlimit = 15 // round time limit in minutes
level.clockside = draw // set to axis, allies, kills, or draw
level.numObjectives = 3 // Number of objectives needed to
//////////////////////////
level waittill roundstart
//////////////////////////
//If this is a tug of war game then we init all the TOW stuff
if( level.gametype == 5 )
{
//Initialize the bombs and lights
thread init_spawner_bombs
thread init_switch_lights
level.bRoundStarted = 1
}
end
////////////////////////////
// init the spawner bombs //
////////////////////////////
init_spawner_bombs:
//Allied spawner bomb
$axis_bomb thread global/tow_dm.scr::bomb_thinker "axis" maps/obj/MP_peenemunde_TOW.scr::alliesspawnpoint
$allie_bomb thread global/tow_dm.scr::bomb_thinker "allies" maps/obj/MP_peenemunde_TOW.scr::axisspawnpoint
end
//////////////////////
// hides the lights //
//////////////////////
init_switch_lights:
$obj2_light_allie hide
$obj2_light_axis hide
$obj3_light_allie hide
$obj3_light_axis hide
$obj4_light_allie hide
$obj4_light_axis hide
end
//////////////////
// the switches //
//////////////////
switch1:
if ( level.bRoundStarted == 1 )
{
if ( parm.other.dmteam == axis )
{
if (( level.switch1owner == 1 ) || ( level.switch1owner == 0 )) //1 meaning allies //0 meaning neutral
{
$obj2_light_allie hide
$obj2_light_axis show
iprintlnbold_noloc "The Axis turned on the factory electricity!"
setcvar "g_obj_alliedtext1" "Cut factory electrics"
setcvar "g_obj_axistext1" "Keep factory electrics on [x]"
level.switch1owner = -1
}
}
else
if ( parm.other.dmteam == allies )
{
if (( level.switch1owner == -1 ) || ( level.switch1owner == 0 )) //-1 meaning axis
{
$obj2_light_axis hide
$obj2_light_allie show
iprintlnbold_noloc "The Allies turned off the factory electricity!"
setcvar "g_obj_alliedtext1" "Keep factory electrics off [x]"
setcvar "g_obj_axistext1" "Get factory electrics on"
level.switch1owner = 1
}
}
//Update team current objectives
waitthread nCheck_End_Match
}
end
switch2:
if ( level.bRoundStarted == 1 )
{
if ( parm.other.dmteam == axis )
{
if (( level.switch2owner == 1 ) || ( level.switch2owner == 0 ))
{
$obj3_light_allie hide
$obj3_light_axis show
iprintlnbold_noloc "The Axis turned on the fuel pumps!"
setcvar "g_obj_alliedtext2" "Turn fuel pumps off"
setcvar "g_obj_axistext2" "Keep fuel pumps on [x]"
level.switch2owner = -1
}
}
else
if ( parm.other.dmteam == allies )
{
if (( level.switch2owner == -1 ) || ( level.switch2owner == 0 ))
{
$obj2_light_axis hide
$obj2_light_allie show
iprintlnbold_noloc "The Allies turned off the fuel pumps!"
setcvar "g_obj_alliedtext2" "Keep fuel pumps off [x]"
setcvar "g_obj_axistext2" "Turn fuel pumps on"
level.switch2owner = 1
}
}
//Update team current objectives
waitthread nCheck_End_Match
}
end
switch3:
if ( level.bRoundStarted == 1 )
{
if ( parm.other.dmteam == axis )
{
if (( level.switch3owner == 1 ) || ( level.switch3owner == 0 ))
{
$obj3_light_allie hide
$obj3_light_axis show
iprintlnbold_noloc "The Axis turned on the tracking radar!"
setcvar "g_obj_alliedtext3" "Enable tracking radar"
setcvar "g_obj_axistext3" "Keep tracking radar off [x]"
level.switch3owner = -1
}
}
else
if ( parm.other.dmteam == allies )
{
if (( level.switch3owner == -1 ) || ( level.switch3owner == 0 )) //-1 meaning axis
{
$obj4_light_axis hide
$obj4_light_allie show
iprintlnbold_noloc "The Allies turned off the tracking radar!"
setcvar "g_obj_alliedtext3" "Keep tracking radar on [x]"
setcvar "g_obj_axistext3" "Disable tracking radar"
level.switch3owner = 1
}
}
//Update team current objectives
waitthread nCheck_End_Match
}
end
/////////////////////
// objective check //
/////////////////////
nCheck_End_Match:
level.nuggetsObjectives = ( level.switch1owner + level.switch2owner + level.switch3owner )
//iprintlnbold_noloc "what's the magic number " level.nuggetsObjectives //if this never reaches 3 or -3 then i have a few more problems
if ( level.nuggetsObjectives == 3 ) //meaning allies have reached all their objectives
{
//ignore the clock
//level ignoreclock 1
//if there is a bomb ticking stop it.
waitthread global/tow_dm.scr::StopBomb
//Allies win play the movie
teamwin allies
}
if ( level.nuggetsObjectives == -3 ) //meaning axis have reached all their objectives
{
//level ignoreclock 1
waitthread global/tow_dm.scr::StopBomb
teamwin axis
}
end
//-----------------------------------------------
// Blow up Allies Spawner
//-----------------------------------------------
axis_bomb_relay_explode:
iprintln "The Axis Spawn Point has been Destroyed!"
iprintln "The Axis Team Can No Longer Respawn!"
//$Obj_alliesspawnpoint TakeOver 1
end
//-----------------------------------------------
// Blow up Axis Spawner
//-----------------------------------------------
allie_bomb_relay_explode:
iprintln "The Allies Spawn Point has been Destroyed!"
iprintln "The Allies Team Can No Longer Respawn!"
//$Obj_axisspawnpoint TakeOver 0
end
Posted: Sun May 18, 2003 11:38 am
by mohaa_rox
You needn't put a [x], cause it will be checked after
$obj1 TakeOver 1 and stuff something like that.
Posted: Sun May 18, 2003 11:48 am
by Jack Ruby
If I add $obj1 TakeOver 1 and $obj2 TakeOver 1 would that make the check boxes and the sounds work ?
Posted: Sun May 18, 2003 12:35 pm
by mohaa_rox
$obj1 TakeOver 0, whereby:
if( parm.other.dmteam == axis )
{
if( $Obj_switch1.ControlledBy != 0 )
{
$Obj_switch1 TakeOver 0
level.numAxisObjectives++
level.numAlliedObjectives--
$obj2_light_allie hide
$obj2_light_axis show
iprintln_noloc "The Axis Control Switch 1!"
waitthread Check_End_Match
}
This is one of my example of completing an obj by axis.
Here's my script:
//----------------------------------------------------------
//control switch 1 green/red
//----------------------------------------------------------
switch1:
if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $Obj_switch1.ControlledBy != 0 )
{
$Obj_switch1 TakeOver 0
level.numAxisObjectives++
level.numAlliedObjectives--
$obj2_light_allie hide
$obj2_light_axis show
iprintln_noloc "The Axis Control Switch 1!"
waitthread Check_End_Match
}
if(parm.other.classname == Actor)
{
$Obj_switch1 TakeOver 0
level.numAxisObjectives++
level.numAlliedObjectives--
$obj2_light_allie hide
$obj2_light_axis show
iprintln_noloc "The Axis Control Switch 1!"
waitthread Check_End_Match
}
}
else if( parm.other.dmteam == allies )
{
if( $Obj_switch1.ControlledBy != 1 )
{
$Obj_switch1 TakeOver 1
level.numAlliedObjectives++
level.numAxisObjectives--
$obj2_light_axis hide
$obj2_light_allie show
iprintln_noloc "The Allies Control Switch 1!"
waitthread Check_End_Match
}
if(parm.other.classname == Actor)
{
$Obj_switch1 TakeOver 1
level.numAlliedObjectives++
level.numAxisObjectives--
$obj2_light_axis hide
$obj2_light_allie show
iprintln_noloc "The Allies Control Switch 1!"
waitthread Check_End_Match
}
}
//Update team current objectives
thread set_objectives
}
end
//----------------------------------------------------------
//control switch 2 green/red
//----------------------------------------------------------
switch2:
if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $Obj_switch2.ControlledBy != 0 )
{
$Obj_switch2 TakeOver 0
level.numAxisObjectives++
level.numAlliedObjectives--
$obj3_light_allie hide
$obj3_light_axis show
iprintln_noloc "The Axis Control Switch 2!"
waitthread Check_End_Match
}
if(parm.other.classname == Actor)
{
$Obj_switch2 TakeOver 0
level.numAxisObjectives++
level.numAlliedObjectives--
$obj3_light_allie hide
$obj3_light_axis show
iprintln_noloc "The Axis Control Switch 2!"
waitthread Check_End_Match
}
}
else if( parm.other.dmteam == allies )
{
if( $Obj_switch2.ControlledBy != 1 )
{
$Obj_switch2 TakeOver 1
level.numAlliedObjectives++
level.numAxisObjectives--
$obj3_light_axis hide
$obj3_light_allie show
iprintln_noloc "The Allies Control Switch 2!"
waitthread Check_End_Match
}
if(parm.other.classname == Actor)
{
$Obj_switch2 TakeOver 1
level.numAlliedObjectives++
level.numAxisObjectives--
$obj3_light_axis hide
$obj3_light_allie show
iprintln_noloc "The Allies Control Switch 2!"
waitthread Check_End_Match
}
}
//Update team current objectives
thread set_objectives
}
end
//----------------------------------------------------------
//control switch 3 green/red
//----------------------------------------------------------
switch3:
if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $Obj_switch3.ControlledBy != 0 )
{
$Obj_switch3 TakeOver 0
level.numAxisObjectives++
level.numAlliedObjectives--
$obj4_light_allie hide
$obj4_light_axis show
iprintln_noloc "The Axis Control Switch 3!"
waitthread Check_End_Match
}
if(parm.other.classname == Actor)
{
$Obj_switch3 TakeOver 0
level.numAxisObjectives++
level.numAlliedObjectives--
$obj4_light_allie hide
$obj4_light_axis show
iprintln_noloc "The Axis Control Switch 3!"
waitthread Check_End_Match
}
}
else if( parm.other.dmteam == allies )
{
if( $Obj_switch3.ControlledBy != 1 )
{
$Obj_switch3 TakeOver 1
level.numAlliedObjectives++
level.numAxisObjectives--
$obj4_light_axis hide
$obj4_light_allie show
iprintln_noloc "The Allies Control Switch 3!"
waitthread Check_End_Match
}
if(parm.other.classname == Actor)
{
$Obj_switch3 TakeOver 1
level.numAlliedObjectives++
level.numAxisObjectives--
$obj4_light_axis hide
$obj4_light_allie show
iprintln_noloc "The Allies Control Switch 3!"
waitthread Check_End_Match
}
}
//Update team current objectives
thread set_objectives
}
end
//----------------------------------------------------------
//Set the teams current objectives
//----------------------------------------------------------
set_objectives:
//First lets do the allies
if( $Obj_switch3.ControlledBy == 0 )
{
$Obj_switch3 SetCurrent 1
}
else if( $Obj_switch2.ControlledBy == 0 )
{
$Obj_switch2 SetCurrent 1
}
else if( $Obj_switch1.ControlledBy == 0 )
{
$Obj_switch1 SetCurrent 1
}
else if( $Obj_axisspawnpoint.ControlledBy == 0 )
{
$Obj_axisspawnpoint SetCurrent 1
}
//Now the Axis
if( $Obj_switch1.ControlledBy == 1 )
{
$Obj_switch1 SetCurrent 0
}
else if( $Obj_switch2.ControlledBy == 1 )
{
$Obj_switch2 SetCurrent 0
}
else if( $Obj_switch3.ControlledBy == 1 )
{
$Obj_switch3 SetCurrent 0
}
else if( $Obj_alliespawnpoint.ControlledBy == 1 )
{
$Obj_alliespawnpoint SetCurrent 0
}
end
//--------------------------------------------------------------
//init the spawner bombs
//--------------------------------------------------------------
init_spawner_bombs:
//Allied spawner bomb
$axis_bomb thread global/jv_obj_dm.scr::bomb_thinker "axis" maps/obj/MP_bottest_TOW.scr::alliesspawnpoint
$allie_bomb thread global/jv_obj_dm.scr::bomb_thinker "allies" maps/obj/MP_bottest_TOW.scr::axisspawnpoint
thread init_bots
end
init_bots:
level.alliesbots = 7
level.axisbots = 7
waitthread global/jv_bots/jv_mp_ai.scr::enable
waitthread global/jv_bots/jv_mp_ai.scr::addtask tow_obj 1
end
//-----------------------------------------------
// Blow up Allied Spawner
//-----------------------------------------------
axis_bomb_relay_explode:
self waittill trigger
thread alliesspawnpoint
end
//-----------------------------------------------
// Blow up Axis Spawner
//-----------------------------------------------
allie_bomb_relay_explode:
self waittill trigger
thread axisspawnpoint
end
//----------------------------------------------------------
//Initialize the switch lights (start all lights off)
//----------------------------------------------------------
init_switch_lights:
$obj2_light_allie hide
$obj2_light_axis hide
$obj3_light_allie hide
$obj3_light_axis hide
$obj4_light_allie hide
$obj4_light_axis hide
end
//-----------------------------------------------
// init the objectives
//-----------------------------------------------
init_objectives:
//Allied spawn point
if( $Obj_alliespawnpoint.ControlledBy == 0 )
{
level.numAxisObjectives++
}
else if( $Obj_alliespawnpoint.ControlledBy == 1 )
{
level.numAlliedObjectives++
}
//Axis spawn point
if( $Obj_axisspawnpoint.ControlledBy == 0 )
{
level.numAxisObjectives++
}
else if( $Obj_axisspawnpoint.ControlledBy == 1 )
{
level.numAlliedObjectivse++
}
//switch 1
if( $Obj_switch1.ControlledBy == 0 )
{
level.numAxisObjectives++
}
else if( $Obj_switch1.ControlledBy == 1 )
{
level.numAlliedObjectives++
}
//switch 2
if( $Obj_switch2.ControlledBy == 0 )
{
level.numAxisObjectives++
}
else if( $Obj_switch2.ControlledBy == 1 )
{
level.numAlliedObjectives++
}
//switch 3
if( $Obj_switch3.ControlledBy == 0 )
{
level.numAxisObjectives++
}
else if( $Obj_switch3.ControlledBy == 1 )
{
level.numAlliedObjectives--
}
end
//-----------------------------------------------
// init the objectives
//-----------------------------------------------
Check_End_Match:
//Allies first
if( level.numAlliedObjectives == level.numObjectives )
{
//ignore the clock
level ignoreclock 1
//if there is a bomb ticking stop it.
waitthread global/tow_dm.scr::StopBomb
//Allies win play the movie
teamwin allies
}
else if( level.numAxisObjectives == level.numObjectives )
{
//ignore the clock
level ignoreclock 1
//if there is a bomb ticking stop it.
waitthread global/tow_dm.scr::StopBomb
//Axis win do their movie and end the map
teamwin axis
}
end
Posted: Sun May 18, 2003 1:00 pm
by Slyk
Jack- looks like you're making it MUCH harder than it needs to be. My TOW script for 'Streets', the link I pointed you to earlier, is MUCH shorter and does the same stuff with hide/show. You absolutely can follow it to get the switches 'checking' off in the right order. Basically you need to invert the order and IDs of the objectives. Like this:
Allies obj1 is Axis obj5 when viewing the objective list (tab)
Allies obj2 is Axis obj4
Allies obj3 is Axis obj 3
Allies obj4 is Axis obj2
Allies obj 5 is Axis obj1
If I vary from that formula, I tend to have serious issues. Best results with objectives 1 and 5 dealing with protect/capture the spawners. Again, my Sos1 script solves all that and has many of the same elements and is much shorter.
Posted: Sun May 18, 2003 1:35 pm
by mohaa_rox
Yup, it's not that easy. I took about 1 hr to figure out that darn script.
Posted: Sun May 18, 2003 2:03 pm
by Jack Ruby
I had a run around in your SOS map last night, looks very impressive, you did good
All this scripting nightmare is sending me mad, my brain is fried now.
Hmmm, I am now trying to get some new objectives in there, I got all the objectives from the berlin map and the berlin.scr that comes with SDK, I pasted them into a test map, it all works fine except that when you complete all the objectives it locks up the game, I think this is because its trying to run the animations that you'd get when you win on the original map.
Below is a link to this test map, its got the .map, .bsp and the .scr
Any chance one of you could take a look, edit the .scr ( or the tow objectives in the .map. ) and post it back for me, what I would ideally like to do is get these objectives working in the test map and just import them to my full scale Peenemunde map.
The zip is only 30k
http://www.westmount.co.uk/images/test.zip
As hard as I try it defeats me everytime

Posted: Sun May 18, 2003 2:25 pm
by Jack Ruby
Ok, I got it working so that the game does not lock up, works perfectly for the axis team, having problems getting allies to be able to blow the axis spawn, all switches are working correctly, just that one spawn bomb is bugging me,
Heres the bit of script that was causing it to crash when you win, I commented out the original bit and added teamwin allies to it
/Allies win play the movie
//thread win_game_allie
teamwin allies
Posted: Sun May 18, 2003 2:38 pm
by Jack Ruby
HMMM

the axis spawn bomb wasnt working cos my trigger use was not placed over it, I was trying to set it in thin air, it all seems to work as far as I can tell, gonna have to get someone else to play it with me to make sure, pleeeeese I hope this thing is working now, I really want to concentrate on the actual mapping, just didnt seem worth adding too much more until I get the objectives working correctly, keep your fingers crossed people
