Jump to content
Connall McCarthy

Picking Up Bushes and Moving Them

Recommended Posts

Hi, basically I'm trying to write a script to pickup and move nearby bushes - right now I've got it to the stage where it removes any bushes from a 10m radius around the player and I have the script for picking up and placing them pretty much ready, however I need a way of grabbing the p3d of the bush to spawn it in with the "pickup" script.
 

Quote

player playActionNow 'medic'; [4, [], {if (isServer) then 
{
  private _shrubery = nearestTerrainObjects
   [player, ["Tree", "Bush"], 10];
   {
    if (_x find "t_" == 0) then 
    {
        _shrubery setVariable [_x, nil];
    };
}
forEach _shrubery;
   { _x hideObjectGlobal true } forEach _shrubery;}
},{player playActionNow 'medicstop';},'Gathering Bushes...'] call ace_common_fnc_progressBar

(currently this spits out the error: Type Object, Expected Array,String)

I also need a way of removing any tree p3ds from the script since some map makers put bushes in the same terrain class (not sure if that's the right terminology) as trees and so simply removing "tree" from the ["tree", "bush"] section of my script wouldn't work.

Since all trees are named t_*treename* and all bushes are named b_*bushname* I have tried to stop them from being included in my script however I am completely lost. I would appreciate any help regarding the script - Cheers !

Share this post


Link to post
Share on other sites

One problem that would be the first to solve is grabbing the first p3d file from the nearestTerrainObjects as it currently outputs for example 

Quote

[279850: b_leucaena_f.p3d,279828: b_leucaena_f.p3d,279849: b_leucaena_f.p3d,279822: b_leucaena_f.p3d,279654: b_leucaena_f.p3d]

 

- I do need the object number initially to hide it from the world however afterwards I only need the bushes p3d file to spawn later when moving it.

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

×