Page 2 of 2

Posted: Fri Aug 05, 2005 7:41 am
by Bjarne BZR
Glad to help :D

Posted: Fri Aug 05, 2005 4:00 pm
by Goldeneye090
Sorry to say but now there's one more problem I just found...All the allies have to do is blow the flak up and they win. I thought this problem was already fixed too...Here's the latest script:

Code: Select all

 
main: 

   setcvar "g_obj_alliedtext1" "Destroy the Flak" 
   setcvar "g_obj_alliedtext2" "Steal the Documents" 
   setcvar "g_obj_alliedtext3" "Kill the Axis" 
   setcvar "g_obj_axistext1" "Defend the Flak" 
   setcvar "g_obj_axistext2" "Protect the Documents" 
   setcvar "g_obj_axistext3" "Kill the Allies" 
   setcvar "g_scoreboardpic" "loading" 


   level waittill prespawn 

   exec global/DMprecache.scr 
   exec global/door_locked.scr::lock 
   exec global/ambient.scr obj_bunkers 
   level.script = maps/obj/obj_bunkers.scr 


   level waittill spawn 

   $document1_trigger setthread objective1 
   $document2_trigger setthread objective2 
   $document3_trigger setthread objective3 

   level.targets_to_destroy = 4 
   level.targets_destroyed = 0 

   level.bomb_damage = 200 
   level.bomb_explosion_radius = 640 
   level.defusing_team = "axis" 
   level.planting_team = "allies" 

   level waittill roundstart 

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

   $flak88_explosive1 thread global/obj_dm.scr::bomb_thinker 
   thread axis_win_timer 
   thread check_if_my_bomb_exploded
   thread allies_win_test 
end 

check_if_my_bomb_exploded: 
   while (!$flak88_explosive1.exploded) 
   { 
      waitframe 
   } 
   iprintlnbold "The Flak has been destroyed!" 
end 

objective1: 
   if (parm.other.dmteam == allies) // chose the team 
   { 
      $document1_trigger nottriggerable 
      $document1 hide 
      $document1 playsound pickup_papers1 
      level.targets_destroyed++ // That will add 1 point 
      iprintlnbold "A document has been stolen!" 
   }
end 


objective2: 
   if (parm.other.dmteam == allies) // chose the team 
   { 
      $document2_trigger nottriggerable 
      $document2 hide 
      $document2 playsound pickup_papers1 
      level.targets_destroyed++ // That will add 1 point 
      iprintlnbold "A document has been stolen!" 
   } 
end 


objective3: 
   if (parm.other.dmteam == allies) // chose the team 
   { 
      $document3_trigger nottriggerable 
      $document3 hide 
      $document3 playsound pickup_papers1 
      level.targets_destroyed++ // That will add 1 point 
      iprintlnbold "A document has been stolen!" 
   } 
end 


// Allied victory test 
allies_win_test: 
   while(level.targets_destroyed < level.targets_to_destroy) 
   { 
      waitframe 
   } 
   // No objectives left allies win 
   teamwin allies 
end 


// Axis victory test, not a lot :) 
axis_win_timer: 
   level waittill axiswin 
end

Posted: Fri Aug 05, 2005 5:49 pm
by Bjarne BZR
Oh, sorry :)

Place this line:

Code: Select all

thread global/exploder.scr::main
...before this one:

Code: Select all

levelwaittill spawn
Im actually surprised your bomb works at all without that line... maby the:

Code: Select all

$flak88_explosive1 thread global/obj_dm.scr::bomb_thinker 
call initiates the exploder system if it has not been done already, and because it happens after you set the

Code: Select all

level.targets_to_destroy = 4
... the variable get overwritten and becomes 1 ( the number of bombs in the map ).