Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: Destroying Map Objects  (Read 1830 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Destroying Map Objects
« on: 11 Jul 2007, 22:21:53 »
Hi all,

I've noticed that the command seems to have changed from OFP. 'object XXXXXX setdamage 1' doesn't work any more.

Does anyone know what the new code is?

Thanks
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Destroying Map Objects
« Reply #1 on: 11 Jul 2007, 22:28:14 »
In ArmA you need first to get the object:
Code: [Select]
_object = _position nearestObject objectId

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re: Destroying Map Objects
« Reply #2 on: 11 Jul 2007, 23:00:18 »
Ah, thanks.

Having a bit of trouble getting it to work though, havn't used nearestObject before. How would that fit into a script file with the setdamage line?
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Destroying Map Objects
« Reply #3 on: 11 Jul 2007, 23:15:50 »
You need the position closest to the map building or object you want to destroy, so you should place a gamelogic or a marker quite close to it, lets suppose your logic is name "log_target" and the map object is 112234:

Code: [Select]
// SQF code
_object = (getPos log_target) nearestObject 112234;
if (!isNull _object) then
{
   _object setDamage 1;
};

Code: [Select]
// SQS code
_object = (getPos log_target) nearestObject 112234
? !isNull _object: _object setDamage 1

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re: Destroying Map Objects
« Reply #4 on: 11 Jul 2007, 23:25:22 »
Thanks a lot, got it working.
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB