Home   Help Search Login Register  

Author Topic: Running over mines  (Read 847 times)

0 Members and 1 Guest are viewing this topic.

deaddog

  • Guest
Running over mines
« on: 29 May 2003, 04:23:33 »
Hello all,

Is there a way to determine if a vehicle has struck a mine?  I tried various event handlers but they would never report that the mine was the object that caused the damage.

I want the position of the minefield to be reported but a unit wouldn't know it was there until something blew up.  :o

Thanks

hurlothrumbo

  • Guest
Re:Running over mines
« Reply #1 on: 29 May 2003, 05:06:23 »
I think it'd be possible to detect this with a trigger to determine the area of the minefield and getdammage for each in thislsit but im not sure exactly how to do it.

usrt_peanut_butter

  • Guest
Re:Running over mines
« Reply #2 on: 29 May 2003, 06:16:42 »
another way to tell when it goes over a mine, is when it goes boom!  :P

deaddog

  • Guest
Re:Running over mines
« Reply #3 on: 29 May 2003, 07:18:54 »
Quote
another way to tell when it goes over a mine, is when it goes boom!

Yeah, but I can't put a marker over a boom, lol  ;D

Thanks for the replies, guys.  I think I figured a way to script it although it's not pretty.  It involves using the nearestobject command.  You can't use getdammage with a mine because it always returns 0.  But if the mine has exploded, its distance from any unit is 1e+010.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Running over mines
« Reply #4 on: 29 May 2003, 10:29:31 »
If there are no enemy present in the minefield area you could perhaps do it with some kind of eventhandler spotting that a unit has been hit/killed, and a trigger over the minefield detecting if the unit is in the minefield.     If both conditions are satisfied then bingo.

If there are only a few enemy in the area you could perhaps even detect if it wasn't them that did the damage.

But, still very messy.
Plenty of reviewed ArmA missions for you to play

deaddog

  • Guest
Re:Running over mines
« Reply #5 on: 01 Jun 2003, 15:39:42 »
Thanks for the reply, Macguba.

What I finally did was have two scripts.

The first monitors each tank (type) on the West side, via a loop.  Using :

_mine=nearestobject [_unit,"mine"]
_dis=_unit distance _mine

if the distance is less than 10m, I pass the _unit and _mine to another script.

The second script waits until one of two things happen:  the distance to the mine is either >12, which means it passed it and the script exits.  Or, ?format ["%1",_dis]=="1e+010", which means the mine blew up.  In this case, I place a marker over the minefield and alert the overall commander (the player, this is a CoC game).

All my mines are 30 meters apart so only one secondary script is running at any one time (per unit).  I also keep track of which minefields have been found so there is no need to "find" them again. Plus, if they have all been found, the first script stops running.

Thanks to all suggestions.  ;)

PS.  It's still messy but it works. ;D
« Last Edit: 01 Jun 2003, 15:40:37 by deaddog »