Obj script question

Post your scripting questions / solutions here

Moderator: Moderators

bodybagger
Sergeant
Posts: 52
Joined: Mon Jan 06, 2003 5:27 pm

Obj script question

Post 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
User avatar
PsychoE
Captain
Posts: 243
Joined: Mon Oct 21, 2002 7:40 pm

Post by PsychoE »

Go to .map and look under tutorials. There are a few there under the title "Multiplayer Tutorials".
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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...
Admin .MAP Forums
Image
Head above heels.
bodybagger
Sergeant
Posts: 52
Joined: Mon Jan 06, 2003 5:27 pm

Post by bodybagger »

wouldn't it be possible to base it on the spearhead tow scripts??
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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:
Admin .MAP Forums
Image
Head above heels.
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post 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
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

You can also do it with the jv_obj_dm.scr script that ships with the bots 8)
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

It's looking good jv :D
Admin .MAP Forums
Image
Head above heels.
bodybagger
Sergeant
Posts: 52
Joined: Mon Jan 06, 2003 5:27 pm

Post 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
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Just set key / value:

$plantteam / allies or axis

On the bomb entity.
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Jv, you rock the Community. Today I was reading your bot manual and...whoah! You're a pro!!!!!!!
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Thanks 8)
Image
User avatar
ZeroSkaten
Second Lieutenant
Posts: 159
Joined: Sun Jan 12, 2003 11:03 pm
Location: Canada
Contact:

Post by ZeroSkaten »

you earned it JV :) Very very good work :)
Together we will leave no posts un awnsered!
BTW that me in the picture :wink:
Image
Visit my site: http://www.planetmedalofhonor.com/hk/

As I say: A 3d model a day keeps the career consultant away.
bodybagger
Sergeant
Posts: 52
Joined: Mon Jan 06, 2003 5:27 pm

Post 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???
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
Post Reply