Page 2 of 2

Posted: Fri Aug 26, 2005 9:40 am
by the r@t
I've changed it into:

$flak88_bomb_1 thread global/obj_dm.scr::bomb_thinker

$flak88_bomb_2 thread global/obj_dm.scr::bomb_thinker

But do you think I need to remove the killzone I've drawn in the radiant and place this with a script?? Cause that's how the stockmaps have it??

Posted: Fri Aug 26, 2005 10:31 am
by Rookie One.pl
Rat, are you sure you are using the version I sent you? I tried it dozens of times, always worked.

Code: Select all

 $flak88_bomb_1 exec global/obj_dm.scr
$flak88_bomb_2 exec global/obj_dm.scr
These lines are perfectly correct and work in AA. Bomb_thinker is the first label in global/obj_dm.scr so it doesn't matter if you use the exec or thread command.

Code: Select all

----------------------Z-----------------------
self = flak88_bomb_1
self.target (flak 88 or other) = flak88_1
self.target.destroyed_model = models/statweapons/flak88_d.tik
self.target.target (collision entity) =
self.trigger_name = flak88_trigger_1
self.exploder_set = NIL
self.explosion_fx = fx/fx_flak88_explosion.tik
self.explosion_sound = explode_aagun
self.killarea = flak88_killarea_1
----------------------Z-----------------------
   self.target.collisionent = self.target.target (global/obj_dm.scr, 41)
   self.target^

^~^~^ Script Error: There are 0 entities with targetname ''. You are using a command that requires exactly one.

waittill trigger flak88_trigger_1
----------------------Z-----------------------
self = flak88_bomb_2
self.target (flak 88 or other) = flak88_2
self.target.destroyed_model = models/statweapons/flak88_d.tik
self.target.target (collision entity) =
self.trigger_name = flak88_trigger_2
self.exploder_set = NIL
self.explosion_fx = fx/fx_flak88_explosion.tik
self.explosion_sound = explode_aagun
self.killarea = flak88_killarea_2
----------------------Z-----------------------
   self.target.collisionent = self.target.target (global/obj_dm.scr, 41)
   self.target^

^~^~^ Script Error: There are 0 entities with targetname ''. You are using a command that requires exactly one.

waittill trigger flak88_trigger_2
These errors appear in the stock maps as well. This means there is no collision entity set for the entity to blow up. It should be disregarded as the cannons are clipped with clip brushes.

@Lizard: you're wrong. self.field can be a class as well, so even self.field.field.field.field.field.field is possible. ;)

The aliascache error makes me think that there might be broken lines in the script. Did you break any lines in the script (pressed enter)?

<EDIT>There were some broken lines, however they shouldn't affect the bomb part... Anyway, I changed the check from level.targets_destroyed (the way it's done in The Bridge) to checking both bombs individually, try this one:

Code: Select all

// harbor
// ARCHITECTURE: Lukas vaes aka the r@t, fixes & additions by Rookie One
// SCRIPTING: Rookie One

main:
   setcvar "g_obj_alliedtext1" "Destroy one of"
   setcvar "g_obj_alliedtext2" "the Flak 88"
   setcvar "g_obj_alliedtext3" "cannons"
   setcvar "g_obj_axistext1" "Protect the cannons"
   setcvar "g_obj_axistext2" "at all costs"
   setcvar "g_obj_axistext3" ""

   setcvar "g_scoreboardpic" "harborsmall"

   exec global/exploder.scr
   exec global/door_locked.scr

   // cache missing locked door, Flak firing and wave lapping sounds
   local.master = spawn ScriptMaster
   local.master aliascache garagedoor_locked sound/mechanics/Gate_Metal_Locked.wav soundparms 1.3 0.0 0.8 0.2 160 1600 item loaded maps "m dm obj "
   local.master aliascache gate_large_locked sound/mechanics/Wood_fence_locked.wav soundparms 1.2 0.2 0.8 0.2 160 1600 item loaded maps "m dm obj "
   local.master aliascache flak_snd_fire1 sound/weapons/fire/TankCannonFire1.wav soundparms 1.5 0.0 1.0 0.0 2000 4000 weapon loaded maps "m dm obj "
   local.master aliascache flak_snd_fire2 sound/weapons/fire/Flak88Fire1.wav soundparms 1.5 0.0 1.0 0.0 2000 4000 weapon loaded maps "m dm obj "
   local.master aliascache flak_snd_fire3 sound/weapons/fire/Flak88Fire3.wav soundparms 1.5 0.0 1.0 0.0 2000 4000 weapon loaded maps "m dm obj "
   local.master aliascache flak_snd_fire4 sound/weapons/fire/Flak88Fire4.wav soundparms 1.5 0.0 1.0 0.0 2000 4000 weapon loaded maps "m dm obj "

   local.gametype = int(getcvar(g_gametype))
   if (local.gametype == 4)
   {
      $tdmspawn disablespawn
      $objspawn enablespawn
      if (randomint(100) > 50)
         $opendoor remove
      else
      {
         $closeddoor remove
         for (local.i = 1; local.i <= $door_locked.size; local.i++)
         {
            if ($door_locked[local.i].mobiledoor)
            {
               $door_locked[local.i] delete
               break
            }
         }
      }
   }
   else
   {
      if (local.gametype > 1)
      {
         $objspawn disablespawn
         $tdmspawn enablespawn
      }
      $closeddoor remove
      for (local.i = 1; local.i <= $door_locked.size; local.i++)
      {
         if ($door_locked[local.i].mobiledoor)
         {
            $door_locked[local.i] delete
            break
         }
      }
      $flak88_bomb_1 delete
      $flak88_bomb_2 delete
   }

   $flak88_camera_1 lookat $flak88_camera_1.target
   $flak88_camera_2 lookat $flak88_camera_2.target

   level waitTill prespawn

   exec global/ambient.scr harbor

   exec global/DMprecache.scr

   level.script = maps/obj/harbor.scr

   level waittill spawn

   level waittill roundstart
   thread plane_flyby
   if (local.gametype == 4)
   {
      level.dmroundlimit = 4
      thread axis_win_cam
      level.planting_team = allies
      level.defusing_team = axis
      level.dmrespawning = 0
      level.clockside = axis
      level.targets_to_destroy = 1
      $flak88_bomb_1 exec global/obj_dm.scr
      $flak88_bomb_2 exec global/obj_dm.scr

      while (!$flak88_bomb_1.exploded && !$flak88_bomb_2.exploded)
         waitframe
      waitthread freeze_players
      if ($flak88_bomb_1.exploded)
         cuecamera $flak88_camera_1
      else
         cuecamera $flak88_camera_2
      teamwin allies
   }
end
 
plane_flyby:
   wait (2 + randomfloat(5))
   while (1)
   {
      local.plane = spawn script_model model "models/vehicles/p47fly.tik" origin $planepath1.origin angles ( 0 $planepath1.angle -45 )
      local.plane alwaysdraw
      local.plane flypath $planepath1 1500 2500 256
      local.plane playsound airplane
      local.plane waitmove
      local.plane delete
      wait (60 + randomfloat(60))
   }
end

axis_win_cam:
   local.endtime = level.time + float(level.dmroundlimit) * 60.0
   while (level.time <= local.endtime)
      waitframe
   if ($flak88_bomb_1.exploded || $flak88_bomb_2.exploded)
      end
   waitthread freeze_players
   if (randomint(100) > 50)
   {
      cuecamera $flak88_camera_1
      wait 3
      $flak88_1 anim fire_scripted
   }
   else
   {
      cuecamera $flak88_camera_2
      wait 3
      $flak88_2 anim fire_scripted
   }
end

freeze_players:
   $player forcelegsstate STAND
   $player forcetorsostate STAND
   freezeplayer
   $player hide
end
Make sure no lines get broken!</EDIT>

Posted: Fri Aug 26, 2005 10:51 am
by the r@t
YEAH

finally man!!

I opened up the script in ms word (cause there you can see all of the broken lines) and made sure everithing was ok.

And now it finally works!!!

Posted: Sat Aug 27, 2005 8:30 am
by the r@t
Ok, the script seems to be working damn well. Accept for one part:

When you play v2 and the bomb is planted right before the 5min have expended, the round will last untill the bomb is diffused or has exploded. In this script the round will just end after the 4 min, even when a bomb is already set. Is there a script to fix this, maybe something that checks if there arn't any bombs planted??

Posted: Sat Aug 27, 2005 12:38 pm
by Rookie One.pl
You are confusing 2 things. If the round finishes when the bomb is set but time runs out, the defusing team wins anyway. Whereas if the bomb is set and all the planting team is killed, the defusing team does not win until they defuse the bomb. So it works perfectly well.

Posted: Sat Aug 27, 2005 5:30 pm
by the r@t
Ok, I tested this in the map v2 and I'm afraid you are rong rookie_one.

When there are only 15 sec left but the allies plant a bomb you'll get a message saying 'a bomb is still planted' and the game will continu! Even when all the allied soldiers are dead. All the bombs must have been defused for the axis to win.

There must be some kind of script to check if all the bombs are diffused or not??

Posted: Sat Aug 27, 2005 7:11 pm
by Rookie One.pl
I am 100% sure I am not wrong on this one. Somebody else check it as well?

Posted: Sun Aug 28, 2005 12:18 am
by lizardkid
If allies are planters

Allies set bomb, all allies are killed, if axis defuse the bomb before it explodes Axis win. the Allies failed in their obj to destroy it.

if axis kill all Allies the Axis win, the Alles failed again.

OIf allies kill all Axis or if they successfull destroy all their targets the Allies win.

that's just basic MOHAA right there, from what you're describing this isnt anything unusual.

Posted: Mon Aug 29, 2005 9:49 am
by Rookie One.pl
Exactly. And if the bomb is set and all allies are killed that's when the 'A bomb is still set' message appears to remind the axis that the mission is not over yet. Therefore the script works perfectly correct.