Jump to content
Spatsiba

hideObjectGlobal on all buildings of same type

Recommended Posts

Hey! 

 

I'm trying to remove military objects on Altis using: 

_towers = nearestTerrainObjects[[worldSize/2,worldSize/2],[
"Land_Cargo_Tower_V2_F", 
"Land_Cargo_Tower_V1_F", 
"Land_Cargo_Tower_V3_F", 
"Land_HBarrier_3_F", 
"Land_HBarrier_5_F", 
"Land_HBarrier_Big_F", 
"Land_HBarrier_1_F", 
"Land_HBarrierWall_corridor_F", 
"Land_HBarrierWall_corner_F", 
"Land_HBarrierWall6_F", 
"Land_HBarrierTower_F", 
"Land_HBarrierWall4_F"],worldSize,false];

{hideObjectGlobal _x} forEach [_towers]

without luck. (I know the list isn't complete with all objects but desert towers are still there).

 

My question is: Is there even a way to do this in a mission file? 

Share this post


Link to post
Share on other sites

change 

 

{hideObjectGlobal _x} forEach [_towers]

 

to

 

{hideObjectGlobal _x} forEach _towers

 

Share this post


Link to post
Share on other sites

Hey gc8! Thanks for the reply.

 

That might've been some lazy writing by me but if I change it I still get nothing. 

Share this post


Link to post
Share on other sites

@Spatsiba I tried running your code on Altis and got no results either. i think there's something wrong with the class names.

 

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

Read the "Possible type names" for this command.

Try with nearestObjects instead.

I'll try it whenever I get the chance. Thanks for the help :)

Share this post


Link to post
Share on other sites
_towers = nearestObjects [[worldSize/2,worldSize/2],[ 
"objClassName"],worldSize,false]; 
{hideObjectGlobal _x} forEach _towers;

This works for some terrain objects. Others return objNull. I think most of the objects on your list are of the latter sort.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×