Page 1 of 2

Objectives for both teams in multiplayer

Posted: Tue Jul 13, 2004 8:53 am
by durin
Can i make a map with explosion objectives for axis and allies????

I know that I must say in script file who is the planting team and defusing team. Its for a objective map. the allies have to explode the flakk and the axis have to explode two boxes....

I have been reading the forum and i cant find a similar case...

Thx mates!!!!

Tow

Posted: Tue Jul 13, 2004 10:06 am
by tltrude
Sure, it is very possible. You don't have to use the bomb thinkers in the global/obj_dm.scr script. You can even make your own version of that script, if you want. As long as your script has "teamwin allies" and "teamwin axis" then either team can win it.

You might want to study the "tug of war" scripts in Spearhead.

Posted: Tue Jul 13, 2004 11:17 am
by durin
Thanks Tom....very pleased for your help....(sorry for my bad english).

We want to make an objective map, but how can i make my own obj_dm.scr script....????...Is it very difficult?.

I saw another post in this forum, but one thing is not clear for me:

I must say planting team and defusing team in script file?. If not it works???

Thx a lot mate!!!

Posted: Tue Jul 13, 2004 2:11 pm
by Splaetos
you dont have to use planting and defusing team, they are just part of the obj_dm script.

a map i made had 3 bombs, but none of them were the objectve...

2 were ally set to get to the objecetive, one was axis set to take away one of thier options.

this was my first map, so I wasnt all that familiar with moh scripting.. however, it was pretty easy, even then, to make a couple duplicate obj_dm scr's and modify them, oen for axi, one for allies(alternatively I just could have reversed the 'defusing/setting' teams in one)

the obj_dm scr is jsut the method for handling a typical bomb. You can do alot to it, if you had different ideas on what should happen.

Posted: Tue Jul 13, 2004 7:21 pm
by jv_map
You could take a look at Bodybagger's Lakeside map :wink:

It's the only 'front-line' AA map I know off the top of my head that has objectives (bombs) for both teams :)

Posted: Tue Jul 13, 2004 9:09 pm
by Splaetos
whats 'frontline' entail?

basicaly the only changes(aside from two seperate scr's in global) are along the liens of this...

Code: Select all

if (local.player.dmteam != axis)

~used to read~

if (local.player.dmteam != level.planting_team)
obj_dm is set up so you can make either team the attacking team, but that compeltely eliminates both teams being able to set bombs.

if you make two copies of it, and change level>planting or level.defusing to whatever they are in each case, it works exactly the same.

As far as I can recall, there is no other different that much matters for two teams using bombs... all the objective information is handled in other areas. If, however, you need to count when objectives are set/destroyed, you just need to modify a few simple things like level.bombs_set, as you might need a different variable for each team. As far objectives tho, obj_dm has nothing to do with accomplishing the mission. It is just a bomb thinker, and almost all of the information in it is dedicated to that.

Posted: Wed Jul 14, 2004 8:06 am
by durin
Ok....thx to all for answer me...

I have some questions...I have edited the obj_dm.scr and i see some threads. First of all, you said to me that i must have two obj_dm.scr script files, one for each team....with the same name or different names???.

Another question is the next....in the axis script file where i find planting_team i must change to "axis"???


Sorry but im a noob in scripting and i have too many dudes

Thx a lot of for the help again... :D

Posted: Wed Jul 14, 2004 6:58 pm
by Splaetos
you could have one scr with each team using different threads in it to set and defuse... i believe..

ok in my map... i use two new global scr's oen called seweraccess.scr and one called retreataccess.scr. the first is used by the axis to blow up the sewer system entrance, and keep the allies from using that route. the second is used by the allies to blow open the inner retreat, where the target they must kill is located....

Code: Select all

$retreat_bomb1 thread global/retreataccess.scr::bomb_thinker
$retreat_bomb2 thread global/retreataccess.scr::bomb_thinker
$sewer_bomb thread global/seweraccess.scr::bomb_thinker
the bombs are passed to the appropraite scr as self, jsut like normal bombs, but the scr's are modified to be axis and ally specific. You could just use one scr probably, by settign up axis and ally specific threads inside it like ally_bomb_thinker and axis_bomb_thinker. I THINK the explosion threads are 'team neutral', just the defusing and settign threads need to be reworked, but I could be wrong, I havent looked at them in detail recently.

just remember that the real stumbling block you have when trying to have each team setting bombs, is that obj_dm.scr is set up for only one team to set, but it being defineable. This was my first map, and the way I set up the .scr's was mostly based on.... a map called... obj_tankassault, where the objective is to blow up the other teams tanks, before they blow up yours. each team has 3 tanks to blow up i think. I cant remember the author(not credited in the script files and no readme, probably says on the load screen hehe), but he has similar gobal threads set up for bombs, axis_obj and allies_obj or something like that.

Posted: Wed Jul 14, 2004 7:08 pm
by Splaetos
Another question is the next....in the axis script file where i find planting_team i must change to "axis"???

oh and this... if your asking whether it has to be with "quote" or without, I know it works without, but I've seen team names referenced with "quotes" as well. I'm not sure if either way is the proper way.

but in general yes, for threads where allies are setting, then level.planting_team becomes allies, and threads where axis are setting then level.planting_team beomes axis. ANd of course, level.defusing_team becomes the opposite of level.planting_team in either case.

try and understand the bomb thinker in either case, its confusing at first, but when you start to understand what its doing, you understand alot more, not only about how objective bombs are planted/defused/timed/exploded, but also how alot of scripting works, such as level. variables and math like incrementing.

ps - know what would make a great tutorial? a step, by step breakdown of what obj_dm is doing at each stage. It has lots of things in thier that would help beginners I think, not only how self works, but how bombs in maps are set up, and how players are recognized, and how timed use triggers are controled, etc...

Posted: Wed Jul 14, 2004 9:59 pm
by Golden-Hammer
Really with Medal Of Honor you really can do anything. Well... Maybe not everything. :oops:

Posted: Thu Jul 15, 2004 7:03 am
by durin
Thx a lot mates...i'll try to understand the obj_dm.scr....if i got a solution, i'll post it here....

Thx again and im very thankful

:D

Posted: Thu Jul 15, 2004 9:05 am
by durin
Well...it works....woohoooo!!!! :D :D

The only thing left is fixing the win thread for each team...this doesnt works yet :cry:

I have made what you said to me...i made 2 script files of obj_dm.scr, one called obj_dm_allies.scr and one obj_dm_axis.scr and i made a map for testing with 2 obj and it works...

Thx a lot of...all of you are a great mappers/scripters...thx :D :D

Posted: Mon Aug 16, 2004 11:32 am
by GARRAPIGNADO
Hello! (thanks, Splaetos to redirect me here)

I've got the same idea, but I don't understand this:

I have two bombs: axisbomb and alliesbomb, ok? Well.

In my map scr, I have this two lines:

Code: Select all

$axisbomb thread global/obj_dm_axis.scr::bomb_thinker 
$alliesbomb thread global/obj_dm_allies.scr::bomb_thinker 
I have removed the lines

Code: Select all

level.defusing_team = "axis" 
level.planting_team = "allies" 
And my question is: how can I specificate in each copy of obj_dm, which team is able to plat or defuse the bombs?? How can I write this line without using "level.defusing_team", cause I don't have this parameter, isn't it?

Code: Select all

if (level.defusing_team == "allies")


Or similar lines :D

Thanks all!!!!!!!!!!! :D

Posted: Mon Aug 16, 2004 5:02 pm
by Splaetos
here is the entire script I made a while back for allied side bomb control. It seemed to work fine, the map was played maybe a half dozen times with 6 or more people each time. it is of course a global scr so it goes i nthe global folder. the other one is nearly identical but configured for axis.

overall mostly just the first two threads are altered from obj_dm(i believe, i didnt look through the whole thing again and memory fails me a bit) Instead of comparing the defusing team to whatever, it just asks if the player is axis in the setting thread, and if so, kicks him back. vice versa in the defusing thread.


--edit-- oh before i forget, i did add at least one other thing. *self notsolid* after the bomb goes off and hides itself. I was using a couple of these on walls that i was blowing out to make access to the last area, and the original obj_dm only hides the model, it doesnt let you pass through it - was pretty annoying heh.

hope this helps, compare it to obj_dm and you can see where the variable data was taken out and replaced with team data.



//Logic for Allies controlling bombs

//***********************************************
// initialization thread...
//***********************************************

bomb_thinker:

level.bomb_defuse_time = 80 //tenths of a second
level.bomb_set_time = 60 //tenths of a second
level.bomb_tick_time = 40 //seconds (was 60 seconds, then 30 seconds)
level.bomb_explosion_radius = 1054 //quake units
level.bomb_use_distance = 128 //quake units
level.bomb_damage = 200
level.bombusefov = 30

level.subtitleX = 100
level.subtitleY = 50

println "----------------------Z-----------------------"
println "self = " self
println "self.target (flak 88 or other) = " self.target
println "self.target.destroyed_model = " self.target.destroyed_model
println "self.target.target (collision entity) = " self.target.target
println "self.trigger_name = " self.trigger_name
println "self.exploder_set = " self.exploder_set
println "self.explosion_fx = " self.explosion_fx
println "self.explosion_sound = " self.explosion_sound
println "self.killarea = " self.killarea
println "----------------------Z-----------------------"

self.target.collisionent = self.target.target
self.target notsolid
thread bomb_waittill_set
end


//***********************************************
// first thread... controls allies using the trigger
//***********************************************


bomb_waittill_set:

self model items/pulse_explosive.tik

while ( $(self.trigger_name) )
{
println "waittill trigger " self.trigger_name
self.trigger_name waittill trigger

local.player = parm.other
//"local.player.dmteam", can be 'spectator', 'freeforall', 'allies' or 'axis'
if (local.player.dmteam != allies)
{
goto bomb_waittill_set
println "failed dmteam check" local.player.dmteam
}



local.counter = 0
while ( (Isalive local.player) && (local.player cansee self level.bombusefov level.bomb_use_distance) && (local.player.useheld == 1) )
{
if (local.counter == 0)
local.player stopwatch (level.bomb_set_time * .1)

local.counter++
// if ((local.counter % 5) == 0)
// locprint level.subtitleX level.subtitleY("set "+ local.counter)

wait .1
if (local.counter >= level.bomb_set_time)
{
iprintlnbold "The Allies have set a bomb!"
if (level.planting_team == "allies")
self playsound dfr_objective_o
else
self playsound den_objective_o
thread bomb_waittill_defuse
thread bomb_waittill_explode
self.live = 1
$axis_spawn1 disablespawn
$axis_spawn2 enablespawn
$allied_spawn1 disablespawn
$allied_spawn2 enablespawn
level.bombs_planted ++
end
}
}
if (local.counter > 0)
local.player stopwatch 0
println "usetrigger but failed check"
if ! (self cansee local.player level.bombusefov level.bomb_use_distance)
println "failed cansee check"
if ! (local.player.useheld == 1)
println "failed useheld check" local.player.useheld
}
end


//***********************************************
// second thread... controls axis using the trigger
//***********************************************
bomb_waittill_defuse:
while ( $(self.trigger_name) )
{
self.trigger_name waittill trigger

local.player = parm.other

//"local.player.dmteam", can be 'spectator', 'freeforall', 'allies' or 'axis'
if (local.player.dmteam != axis)
{
println "failed dmteam check" local.player.dmteam
goto bomb_waittill_defuse
}


local.counter = 0
while ( (Isalive local.player) && (local.player cansee self level.bombusefov level.bomb_use_distance) && (local.player.useheld == 1) )
{
if (local.counter == 0)
local.player stopwatch (level.bomb_defuse_time * .1)

local.counter++
// if ((local.counter % 5) == 0)
// locprint level.subtitleX level.subtitleY ("defuse "+local.counter)

wait .1
if (local.counter >= level.bomb_defuse_time)
{
iprintlnbold "The Allies bomb has been defused!"
if (level.defusing_team == "allies")
self playsound dfr_diffused_d
else
self playsound den_diffused_d
thread bomb_waittill_set //start first thread again
self.live = 0
level.bombs_planted --
end
}
}
if (local.counter > 0)
local.player stopwatch 0
}
end


//***********************************************
// third thread... times the bomb and makes it explode at the right time
//***********************************************
bomb_waittill_explode:
self model items/explosive.tik
self playsound plantbomb


self loopsound bombtick

local.start_time = level.time
while (level.time < (local.start_time + level.bomb_tick_time) )
{
wait .1
if (self.live != 1)
{
self stoploopsound
end
}
if (level.time == (local.start_time + level.bomb_tick_time - 15) )
{
self stoploopsound
self loopsound final_countdown
}
}
self stoploopsound
thread bomb_explode
end


//***********************************************
// fourth thread... controls the explosion
//***********************************************
bomb_explode:
self.trigger_name remove

thread jitter_large 0

if (self.exploder_set != NIL)
exec global/exploder.scr::explode self.exploder_set

if (self.explosion_fx != NIL)
{
self thread spawn_fx self.explosion_fx
}

if (self.explosion_sound != NIL)
self playsound self.explosion_sound

if (self.target != NIL)
{
if (self.target.destroyed_model != NIL)
{
local.damaged = self.target thread spawn_damaged self.target.destroyed_model
}
self.target remove
waitframe
}
radiusdamage self.origin level.bomb_damage level.bomb_explosion_radius
if (self.killarea != NIL)
{
self.killarea volumedamage 1000
}
self hide
self notsolid

self.live = 0

self.exploded = 1
level.targets_destroyed = level.targets_destroyed + 1

// we delay the decrementing of level.bombs_planted so that the script has
// time to determin the winner before the timelimit gets checked and hit
wait 0.5
level.bombs_planted --
end


//----------------------------------
spawn_fx local.fx:
local.temp = spawn script_model model local.fx
local.temp.origin = self.origin
local.temp anim start
wait 5
local.temp remove
end

spawn_damaged local.model:
local.damaged = spawn script_model model local.model
local.damaged.origin = self.origin
local.damaged.angles = self.angles
end local.damaged

//******************************
// jitter large effect
// jitter_large [delay]
//******************************
jitter_large local.time:
if (local.time)
wait local.time

waitexec global/earthquake.scr .35 10 0 0
waitexec global/earthquake.scr .23 6 0 0
waitexec global/earthquake.scr 1 1 0 0
waitexec global/earthquake.scr 1.25 .3 0 1
end

Posted: Mon Aug 16, 2004 7:09 pm
by GARRAPIGNADO
It's superb! :D

Can I marry you??? jejejejejejeje.

SO, I only have to copy-paste in my files? It's so easy that I thinks it isn't real, jejejejeje.

Good. I have to delete the setting of planting team and defusing team in the map scr, isn't it?

Thanks, I'll try it :D :D