OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: greg147 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
-
In ArmA you need first to get the object:
_object = _position nearestObject objectId
-
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?
-
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:
// SQF code
_object = (getPos log_target) nearestObject 112234;
if (!isNull _object) then
{
_object setDamage 1;
};
// SQS code
_object = (getPos log_target) nearestObject 112234
? !isNull _object: _object setDamage 1
-
Thanks a lot, got it working.