OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Knight Trane on 22 Dec 2008, 19:34:28

Title: Map objects How much manipulation can you do?
Post by: Knight Trane on 22 Dec 2008, 19:34:28
I've started this topic to make it easier for newbies to get a quick answer to questions concerning objects already on the map.

My newbie question for the day is in this realm is:

How do I remove a couple of bushes that are sticking through the floor of my hangar?
I know what the IDs are but not how to setDamage to them.  The objects are bushes.
I put a game logic near them.  Named the logic "bob".  I put this in a sqf file and named it "Landscape".  This is the script:
Code: [Select]
_array1 = nearestObjects [bob,[], 350];
~1.5
{_x setdammage (1.0)} forEach _array1;
exit
I get an "Invalid expression" Error.
Any clues? :confused:
Title: Re: Visitor objects How much manipulation can you do?
Post by: hoz on 22 Dec 2008, 19:48:18
Your topics a bit misleading, by the time your ingame, visitor has nothing to do with arma, its now  an island :D
As of arma there are 3 ways to use nearestobject.
You probably should use this nearestObject  (http://www.ofpec.com/COMREF/index.php?action=details&id=659)command.

Code: [Select]
_obj = position player nearestObject 1234
You can replace player with a GL or some other object near the object your trying to identify. If your player is a far distance away it might not find the object. A GL within 50 meters should do it.
Title: Re: Map objects How much manipulation can you do?
Post by: Knight Trane on 22 Dec 2008, 20:08:32
Sorry Hoz,
I was hoping the title would be a better search result for newbs.  I changed it to "Map"

Quote
I know what the IDs are but not how to setDamage to them.  The objects are bushes.
I looked at all the "nearest" commands.  "nearestObject" tells me what I already know.  The IDs of the objects I want dead.  I know I can't remove or delete them.  So knocking them down or covering them up, is the only other solution.  So, how do I "setDamage" to a map object whose id is already known?
Title: Re: Map objects How much manipulation can you do?
Post by: hoz on 22 Dec 2008, 20:53:19
well in arma you still need to use the nearestobject command to identify the objectiD. In ofp we had objectID and life was simple. In your example your _array1 you have an [array] within an [[array]] and therefor the for each command is kacking on that.

Code: [Select]
position GL1 nearestObject 1070 setdammage 1;


test and works

Edit: now with example-goodness
Edit2: make sure you turn on the objectids so you can see the object i'm focusing on.