teamwin allies

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
kkcahdcakcyt
Sergeant
Posts: 71
Joined: Wed Aug 03, 2005 11:16 pm

teamwin allies

Post by kkcahdcakcyt »

i can't get this par to of my script to work. I have the
teamwin allies
put in but it won't end the round with allies win. Everything else is working fine.

Does the command ahve to be part of an while or if statement or can it just be used as part of a thread.


stealing:
iprintlnbold "Note to Allies:"
iprintlnbold "Diversion set and Cable secured."
iprintlnbold "Dabble's reign has ended."
wait 3
iprintlnbold "Attention citizens of CoH Castle!"
iprintlnbold "All hail Lord Durandal"
iprintlnbold "holder of the cable!"
wait 3
waitthread teleport
waitthread durandal
teamwin allies
end

anyreason that shouldn't work?
the rest of the script works like a charm
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

post the whole script
kkcahdcakcyt
Sergeant
Posts: 71
Joined: Wed Aug 03, 2005 11:16 pm

Post by kkcahdcakcyt »

its probably fairly sloppy and good luck following it

Code: Select all

main:
$tvarc anim stop
$flagcoh hide
$durandal hide
$lamp hide
$lamp2 hide
$lamp3 hide
$lamp4 hide
$lamp5 hide
level.trigger = 1
level.counter = 40

setcvar "g_obj_alliedtext2" "-Infiltrate the Castle" 
setcvar "g_obj_alliedtext3" "-Steal the Cable "
setcvar "g_obj_alliedtext1" "Allies: " 
setcvar "g_obj_axistext2" "-Defend the Castle"
setcvar "g_obj_axistext3" "-Defend the Cable TV"
setcvar "g_obj_axistext1" "Axis: "
setcvar "g_scoreboardpic" "Assault.tga"

switch (waitthread global/libmef/util.scr::get_gametype)
	{
		case "ctf":
		case "ftctf":
		case "dem":
		case "ftdem":
			waitthread global/libmef/spawn.scr::spawnblock_begin
			waitthread setup_bases
			break

		case "ft":
		case "rbm":
			waitthread global/libmef/spawn.scr::spawnblock_begin
			break
	}

level waittill spawn
if (level.mef_baseversion == "sh" || level.mef_baseversion == "bt")
	{
		$world commanddelay 0 farclipoverride -1
	}

if (level.roundbased)
{
thread roundbasedthread
}


level waittill prespawn


exec global/DMprecache.scr
level.script = maps/dm/Assault.scr

thread music

thread global/exploder.scr::main // Initialize the exploder subsystem


level waittill spawn

level.defusing_team = "axis" // Axis like the bombs unplanted
level.planting_team = "allies" // Allies will try to plant the bombs
level.bomb_damage = 200 // Default damage of the bomb
level.bomb_explosion_radius = 2048 // Default radius of bomb blast

$Fdoor thread global/obj_dm.scr::bomb_thinker 
 iprintlnbold "2"

end
 
// ----------------------

roundbasedthread:

level waittill prespawn


exec global/DMprecache.scr
level.script = maps/dm/Assault.scr

thread music

thread global/exploder.scr::main // Initialize the exploder subsystem


level waittill spawn

level.defusing_team = "axis" // Axis like the bombs unplanted
level.planting_team = "allies" // Allies will try to plant the bombs
level.bomb_damage = 200 // Default damage of the bomb
level.bomb_explosion_radius = 2048 // Default radius of bomb blast
level.message = 1

// Set the parameters for round based match
level.dmrespawning = 1 // 1 or 0 (0=no respawn)
level.dmroundlimit = 6 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw


level waittill roundstart 
thread lights
thread dinnerroom
$Fdoor thread global/obj_dm.scr::bomb_thinker 

end 
// ------------------------------

dinnerroom:    
   // defines 
   group.TEAM[allies] = 0 
   group.TEAM[axis] = 1 
   group.TIME_FOR_POINT = 20.0 
   group.time_in_room[group.TEAM[allies]] = 0.0 
   group.time_in_room[group.TEAM[axis]] = 0.0 

       
  $cable.lasttriggertime = 0.0  
    
   while(1) 
   {    
      if(level.time -   $cable.lasttriggertime   <= 1.0) //0.20 
      { 
         // add to this teams counter 
         local.team = group.TEAM[$cable.lasttriggerteam] 
         local.otherteam = !local.team

	if(local.team == 0)
	{
	thread message
	level.leave = 1
	group.time_in_room[local.team]+= .1
        }
	else
	{
         group.time_in_room[0] = 0.0
	}

	if(group.TIME_FOR_POINT - group.time_in_room[0] == 5)
	{
	iprintlnbold "10 seconds..."
	wait 5
	iprintlnbold "5"
	wait 1
	iprintlnbold "4"
	wait 1
	iprintlnbold "3"
	wait 1
	iprintlnbold "2"
	wait 1
	iprintlnbold "1"
	}
         if(group.time_in_room[0] >= group.TIME_FOR_POINT) 
         {
		$blue hide
		$red show
            group.time_in_room[0] = 0.0
		wait 3
		thread tvdest
		thread stealing
         } 
      } 
      else 
      { 
         // reset counters for both teams 
         group.time_in_room[group.TEAM[allies]] = 0.0 
         group.time_in_room[group.TEAM[axis]] = 0.0
	 $blue hide
	 $red hide
	 $green show
	thread leave
	level.message = 1
      } 
      waitframe 
   }    
end 

dinnerroom_trigger:    
  // self is the trigger 
  self.lasttriggerteam = parm.other.dmteam 
  self.lasttriggertime = level.time    
	$green hide
	$blue show
end 

lights:

spawn script_model "targetname" "green" 
$green model "fx/corona_green_bright.tik"
$green.origin = ( 1868 6488 584 )
$green light 0 1 0 250
$green notsolid

spawn script_model "targetname" "blue" 
$blue model "static/corona_reg.tik"
$blue.origin = ($green.origin)
$blue light 0 0 1 250
$blue notsolid
$blue hide

spawn script_model "targetname" "red" 
$red model "fx/corona_red_bright.tik"
$red.origin = ($green.origin)
$red light 1 0 0 250
$red notsolid
$red hide

end

message:
if (level.message == 1)
{
level.message = 0
iprintlnbold "Allies have reached the TV"
$flagfbs hide
$flagcoh show
}
end

stealing:
iprintlnbold "Note to Allies:"
iprintlnbold "Diversion set and Cable secured."
iprintlnbold "Dabble's reign has ended."
wait 3
iprintlnbold "Attention citizens of CoH Castle!"
iprintlnbold "All hail Lord Durandal"
iprintlnbold "holder of the cable!"
wait 3
waitthread teleport
waitthread durandal
teamwin allies
end

leave:
if(level.leave == 1)
{
iprintlnbold "Allies have left the TV"
$flagfbs show
$flagcoh hide
level.leave = 0
}
end

party:

spawn script_model "targetname" "light1" 
$light1 model "static/corona_reg.tik"
$light1.origin = ( $lamp.origin )
$light1 light 0 1 0 500
$light1 notsolid

spawn script_model "targetname" "light2" 
$light2 model "static/corona_reg.tik"
$light2.origin = ( $lamp2.origin )
$light2 light 0 0 1 500
$light2 notsolid

spawn script_model "targetname" "light3" 
$light3 model "static/corona_reg.tik"
$light3.origin = ( $lamp3.origin )
$light3 light 1 0 0 500
$light3 notsolid

spawn script_model "targetname" "light4" 
$light4 model "static/corona_reg.tik"
$light4.origin = ( $lamp4.origin )
$light4 light 1 0 1 500
$light4 notsolid

spawn script_model "targetname" "light5" 
$light5 model "static/corona_reg.tik"
$light5.origin = ( $lamp5.origin )
$light5 light 1 1 0 500
$light5 notsolid

if ( level.trigger == 1 )
{
while (level.counter != 0)
{
level.trigger = 0
level.counter--
wait .1
$light1 show
wait .1
$light1 hide
$light2 show
wait .1
$light2 hide
$light4 show
wait .1
$light4 hide
$light3 show
wait .1
$light3 hide
$light5 show
wait .1
$light5 hide
$light1 show
$light3 show
wait .1
$light1 hide
$light3 hide
$light2 show
$light4 show
wait .1
$light4 hide
$light2 hide
$light5 show
$light1 show
wait .1
$light4 show
$light2 show
$light1 hide
wait .1
$light3 show
$light1 show
$light4 hide
$light2 hide
$light5 hide
}
}

$light1 remove
$light2 remove
$light3 remove
$light4 remove
$light5 remove

wait 1
level.counter = 40
level.trigger = 1

end


tvdest:
$tvarc anim start
wait 2
$tvarc anim stop
$tvexplo anim start
wait .5
$tv remove
$tvexplo anim idle
$dabble anim death_explosion_large
wait 3
$dabble remove
end

teleport:
for(local.z = $player.size; local.z > 0; local.z--) 
{ 
     if($player[local.z].dmteam == "allies" && IsAlive $player[local.z] ) 
     { 
           $player[local.z] tele ($alliedspot.origin)
		wait 1.5
		message "move" 
      } 
}
wait 4
end

durandal:
$dabble2 anim death_prone
wait 1
$durandal show
$durandal anim germanselectionidle
wait 5
end

music:
switch (randomint (3) + 1)
{
	case "1": exec global/ambient.scr Assault
	break
	case "2": exec global/ambient.scr Assault2
	break
	case "3": exec global/ambient.scr Assault
	break
	case "4": exec global/ambient.scr Assault2
	break
}
end
mefy
Corporal
Posts: 33
Joined: Tue Oct 21, 2003 2:57 am

Post by mefy »

teamwin only works if you're running in Objective mode (g_gametype 4)

So if you're running in RBM mode (g_gametype 3) then you can do this:

Code: Select all

setcvar "g_gametype" "4"
teamwin allies
setcvar "g_gametype" "3"
New Gametypes for Medal of Honor
Capture-The-Flag | Freeze-Tag | Demolition
www.planetmedalofhonor.com/mefy
kkcahdcakcyt
Sergeant
Posts: 71
Joined: Wed Aug 03, 2005 11:16 pm

Post by kkcahdcakcyt »

ohhhh
wow, seems so simple yet so hard
thanks a bunch mefy
Post Reply