Escape obj multiplayer?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Trinculo
Corporal
Posts: 25
Joined: Fri May 23, 2003 8:32 pm
Location: Brisbane, Australia
Contact:

Escape obj multiplayer?

Post by Trinculo »

ok guys i dont know if this has been done or not and yes i have done a search before posting :P I want to do a recreation of a map from America's Army, the one i want to do is the Bridge one, where one team has to make their way accross the bridge and get to the end of the road, i want to recreate this obj in mohaa. I'm guessing i need a trigger_multiple at the exit zone and in scripting tell it not to do anything for the other team.

So could you guys help me out a little, i can make simple scripts like light switches and such but trying to work this one out made my head hurt :)

Thanks in advance :)
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Shooting from the hip here:

Make a trigger_multiple brush around the escape area. Give it targetname / escape

Code: Select all

goal_reached:
  while(1) {
    $escape waittill trigger
    if(parm.other.dmteam == allies) { // parm.other is the triggerer
      iprintlnbold_noloc "The allies have escaped!"
      teamwin allies
      break // out of while loop
    }
    waitframe // "CPU protection"
  }
end
Admin .MAP Forums
Image
Head above heels.
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

This should work also:

main:

level waittill prespawn

thread axis_win_timer

level waittill spawn

level waittill roundstart // comment out to test

level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 10 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw

$win_trigger waitthread allied_trigger
thread allies_win_allied_trigger

end

allied_trigger:

while(1)
{
self waittill trigger
local.triggerer = parm.other
if(local.triggerer.dmteam == "allies")
break
wait 0.1
}

end

allies_win_allied_trigger:

iprintlnbold_noloc "The Allies have escaped!"
teamwin allies

end

axis_win_timer:

level waittill axiswin
iprintlnbold_noloc "That's a winner!"

end
Desert Eagle
Captain
Posts: 237
Joined: Mon Jan 13, 2003 1:05 am
Location: Mapping Bunker
Contact:

Post by Desert Eagle »

It should work. I am attempting the same thing in my snowy escape map. I have the allies starting unarmed (they will have to find weapons)

To make it a little more difficult I am attmepting to place the allied meeting place (where 5 allies must get to, to win) to be random. Similar to the Hunt where the flak is in different locations near the church.

This way the axis could not camp the meeting point and gun down the allies.


So far I have had some success.
Desert-Eagle
....The Eagle Has Landed...
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

sorry TheShiznaeSpe, that script will automatically give the allies the victory at the top you have
thread allies_win_allied_trigger

and all that trigger does is
print a line and give allies victory :(
hope this helps, prob not cos it's all foreign 2 me :-/
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

ALAS!

$win_trigger waitthread allied_trigger
thread allies_win_allied_trigger

won't this mean that when the win_trigger is pressed, the script waits until the allied_trigger thread is finished to move on?

so if:

Code: Select all

allied_trigger: 

while(1) 
{ 
self waittill trigger 
local.triggerer = parm.other 
if(local.triggerer.dmteam == "allies") 
break 
wait 0.1 
} 

end


doesn't happen, the script won't proceed
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

lol, sorry :lol:

don't know what i was thinking then, i missed that entire line

sorry :P
hope this helps, prob not cos it's all foreign 2 me :-/
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

lol np :D
Post Reply