editing V2 :(

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
kdja
Captain
Posts: 254
Joined: Wed Jun 19, 2002 1:08 am
Location: Ireland

editing V2 :(

Post by kdja »

Im trying to change the 2 OBJ in V2 to 1.
if one is blown game ends.
i was asked to check it out as a mate thought it would create a completley diffeent set of tactics if only 1 needed to blow.
i added this line to the spawn and prespawn script
level.targets_to_destroy = 1

And it still took the 2.
i can find no reference to it having to be 2 objs.
but both bombs due to their nature are well scripted.
anyone any ideas??
kdja
Wombat
Colour Sergeant
Posts: 93
Joined: Fri Jun 14, 2002 5:10 pm
Location: Adelaide, Australia
Contact:

Post by Wombat »

from your modified obj_team2.scr

remove

level.targets_to_destroy = 1
this does nothing if the script doesn't check for it

comment out the following lines

// $ctrlroom_explode thread global/obj_dm.scr::bomb_thinker
(this may not need to be done ?, but may remove the bomb etc)

// while (local.bomb2.exploded != 1)
// wait .1
this waits for the ctrlroom bomb, not needed

change these lines to this

allies_win_bomb local.bomb1: // local.bomb2:

remove reference to local.bomb2 ie $ctrlroom_explode

thread allies_win_bomb $v2_explode // $ctrlroom_explode

this will remove the dependence of destroying the v2 THEN the ctrl room

You only have to destroy the V2

You could of course , just delete those things commented out, but then you couldn't repair the script
Wombat's
Eats roots shoots then leaves...........
Wombat
Colour Sergeant
Posts: 93
Joined: Fri Jun 14, 2002 5:10 pm
Location: Adelaide, Australia
Contact:

Post by Wombat »

or just copy this

// V2 FACILITY
// ARCHITECTURE: POWZER
// SCRIPTING: POWZER

main:

setcvar "g_obj_alliedtext1" "- Destroy the Control"
setcvar "g_obj_alliedtext2" "Room"
setcvar "g_obj_alliedtext3" "- Destroy V2 Rocket"

setcvar "g_obj_axistext1" "- Defend the Control"
setcvar "g_obj_axistext2" " Room and the V2"
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "objdm2"

level waittill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

//***Flyby Planes
exec global/bomber.scr
//thread flyby

//***Ambient sounds
level.script = maps/obj/obj_team2.scr
exec global/ambient.scr obj_team2

exec global/door_locked.scr::lock
thread global/exploder.scr::main
//thread global/barrel.scr::explosive_barrel

level waittill spawn

level.defusing_team = "axis"
level.planting_team = "allies"
level.bomb_damage = 200
level.bomb_explosion_radius = 2048

// set the parameters for 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

thread flyby

$v2_explode thread global/obj_dm.scr::bomb_thinker
//$ctrlroom_explode thread global/obj_dm.scr::bomb_thinker

thread allies_win_bomb $v2_explode // $ctrlroom_explode
$v2_explode thread axis_win_timer

// thread objectives_setup
end


allies_win_bomb local.bomb1: // local.bomb2:

while (local.bomb1.exploded != 1)
wait .1
// while (local.bomb2.exploded != 1)
// wait .1

teamwin allies
end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:

level waittill axiswin

end

flyby:

//***random flyby of plane
wait 1.0
thread global/bomber.scr::bomb 4
thread global/bomber.scr::bomb 5
thread global/bomber.scr::bomb 6
thread global/bomber.scr::bomb 7
wait (randomint(180) + 60)

goto flyby

//Display objectives
//objectives_setup:
//
// waitthread global/objectives.scr::blank_objectives
// waitthread global/objectives.scr::add_objectives 1 2 "Destroy the V2 rocket and the Launch Control Room" //$v2_bomb.origin
// wait 2
// waitthread global/objectives.scr::current_objectives 1

//end
Wombat's
Eats roots shoots then leaves...........
kdja
Captain
Posts: 254
Joined: Wed Jun 19, 2002 1:08 am
Location: Ireland

Post by kdja »

Thx Wombat :)

Kdja
Wombat
Colour Sergeant
Posts: 93
Joined: Fri Jun 14, 2002 5:10 pm
Location: Adelaide, Australia
Contact:

Post by Wombat »

let me know if that works, as it is untested, just what i deduced from the script, as i wrote the post.....
Wombat's
Eats roots shoots then leaves...........
kdja
Captain
Posts: 254
Joined: Wed Jun 19, 2002 1:08 am
Location: Ireland

Post by kdja »

It did work ,it made V2 a round winning obj but the ctrl toom was disabled.
is there an IF statement in scripting land?

if there was it could be modified to set obj for both allies and axis whixh is my masterplan:)


Kdja
Wombat
Colour Sergeant
Posts: 93
Joined: Fri Jun 14, 2002 5:10 pm
Location: Adelaide, Australia
Contact:

Post by Wombat »

Yes there is an IF statement, please explain the question?
Wombat's
Eats roots shoots then leaves...........
kdja
Captain
Posts: 254
Joined: Wed Jun 19, 2002 1:08 am
Location: Ireland

Post by kdja »

hmm IE IF Allies blow either bombs round ends .

then that command could be used for a AXIS/ALLIES OBJ level where th eAxis and ALLIES have to blow somfin or do somfin other than Axis killing everyone.


Kdja
Kentaro-K.21
Lance Corporal
Posts: 20
Joined: Wed Jul 17, 2002 3:14 pm
Location: Japan

Post by Kentaro-K.21 »

original script (partial obj_team2.scr)
----------
allies_win_bomb local.bomb1 local.bomb2:

while (local.bomb1.exploded != 1)
wait .1
while (local.bomb2.exploded != 1)
wait .1

teamwin allies
end
----------

modified script (partial obj_team2.scr)
----------
allies_win_bomb local.bomb1 local.bomb2:

while (local.bomb1.exploded != 1 && local.bomb2.exploded != 1)
wait .1

teamwin allies
end
----------
Wombat
Colour Sergeant
Posts: 93
Joined: Fri Jun 14, 2002 5:10 pm
Location: Adelaide, Australia
Contact:

Post by Wombat »

I saw this question a long time ago, and i thought i would just make an Axis_obj_dm.scr, which was a carbon copy of the original, but all the scenarios, were reversed. ie axis plant the bomb, allies defuse it.

Just call global/obj_dm.scr::bombthinker for allies bomb/axis defuse

and
call global/axis_obj_dm.scr::bombthinker for axis bomb/ allies defuse
(i think scorpiomidget used numbers >100 for axis)
seemed to work ok, but...........

Unfortunately it went to hdrive heaven.........

would be easy enough to do again.....sort of a bomb the base map

Just worked out how to do killareas
create trigger_multiple set targetname deathzone( or something more descriptive)
move it to where you want the killarea to reside. size it.....
on the bomb add a [key] $killarea [value] deathzone (note the $ sign)
when the bomb blows, anyone in the deathzone will die........from an obj_dm.scr orientated map.
Wombat's
Eats roots shoots then leaves...........
Post Reply