Page 1 of 2

Obj script question

Posted: Mon Mar 31, 2003 7:40 pm
by bodybagger
I have an objective for each side to complete, 1 bomb for allied and 1 bomb for axis.
How would i set up the script so that whoever completes there objective first wins and the game finishes???
Thanks in advance

Posted: Mon Mar 31, 2003 7:45 pm
by PsychoE
Go to .map and look under tutorials. There are a few there under the title "Multiplayer Tutorials".

Posted: Mon Mar 31, 2003 8:04 pm
by Bjarne BZR
This sounds more easy than it is...

Because level.defusing_team and level.planting_team makes only one team be able to plant the bomb... ( I think, really havent tried it ).

And you'll have to keep track of what bomb has been blown manually ( the level.targets_destroyed will be increased for both bombs and is therefore useless to determine who won ) with a thread testing the value of $targetname_of_the_bomb.exploded to see what bomb blows first...

I guess you need an old scripting fox on this... smells like copying the exploder.scr and rewriting it to be able to have two planting/defusing teams...

Posted: Mon Mar 31, 2003 8:11 pm
by bodybagger
wouldn't it be possible to base it on the spearhead tow scripts??

Posted: Mon Mar 31, 2003 8:15 pm
by Bjarne BZR
No idea, never seen them...
And by the way: when I said exploder.scr above, I ment the obj_dm.scr :oops:

Posted: Tue Apr 01, 2003 4:30 am
by G3mInI
Scorpio Midget worked out a dual obj script in his 'The Farm' map. Go find this map and look at his script. It worked just fine and it is exactly what you are seeking.

G3mInI

Posted: Tue Apr 01, 2003 6:25 am
by jv_map
You can also do it with the jv_obj_dm.scr script that ships with the bots 8)

Posted: Tue Apr 01, 2003 10:00 am
by Bjarne BZR
It's looking good jv :D

Posted: Tue Apr 01, 2003 11:29 am
by bodybagger
Jv_map,
It is for the bots that i want it to work, but i am clueless with scripting, how would i go about seting it up

Posted: Tue Apr 01, 2003 12:45 pm
by jv_map
Just set key / value:

$plantteam / allies or axis

On the bomb entity.

Posted: Tue Apr 01, 2003 3:21 pm
by mohaa_rox
Jv, you rock the Community. Today I was reading your bot manual and...whoah! You're a pro!!!!!!!

Posted: Tue Apr 01, 2003 3:46 pm
by jv_map
Thanks 8)

Posted: Tue Apr 01, 2003 4:13 pm
by ZeroSkaten
you earned it JV :) Very very good work :)

Posted: Tue Apr 01, 2003 6:38 pm
by bodybagger
Yeah, I have done that, and the bots go off and plant the bombs, but when either one bomb has gone off the game doesn't finish, nor does it say allies win/ axis win...
Do i need something in the script to say when a certian bomb explodes that the aproriate teams wins???

Posted: Tue Apr 01, 2003 8:17 pm
by jv_map
Yes. Use a thread like

Code: Select all

while($allied_bomb.exploded != 1)
    waitframe

teamwin allies
for both the allied and axis bomb.