Jump to content
Sign in to follow this  
Bunny75

AddAction doesn't show

Recommended Posts

I have a script that creates a small camp with nets, crates and antenna. What I need is to add an action to antenna that would delete the base.

Now, this won't work:

base_antenna = createVehicle ["Land_Antenna", [(getPos pos_target select 0) - 9, (getPos pos_target select 1) -1, getPos pos_target select 2], [], 0, "NONE"];
_unbase_act = base_antenna addAction ["Deconstruct FOB", "uncreate_base.sqf"];

It creates the antenna, but I can't get any action on it?

Before the camp is made I used a script (got from here) that makes a c130 drop a cargo container and to it I could add an action:

_bpos1 = _c130b_plane ModelToWorld [0,-12,-5.5];
base_crate = "Misc_cargo_cont_net1" createVehicle _bpos1;
_base_act = base_crate addAction ["Deploy FOB", "create_base.sqf"];

I tried the exact same code with antenna with no luck!?

Share this post


Link to post
Share on other sites

Antenna's are a pain in the arse to put actions on. All I got to say.

Share this post


Link to post
Share on other sites

Yeah. Seems so. I just changed the antenna to cargo container and works like a charm. So antenna has to go.

Share this post


Link to post
Share on other sites

Why is it hard to add actions to antennae? is it because they're large and the player is too far from the center of the object to get the action?

if that's the case... on the addAction, add the action to the player, with a condition being "player is so-and-so distance from antenna"

---------- Post added at 12:00 PM ---------- Previous post was at 11:37 AM ----------

I just tested it, this will work:

_unbase_act = player addAction ["Deconstruct FOB", "uncreate_base.sqf", "", 1, false, true, "", "_this distance base_antenna < 20"];

Edited by JDog

Share this post


Link to post
Share on other sites

I suppose... but that's beyond my talents and knowledge of how to do lol. Please do tell :)

Share this post


Link to post
Share on other sites

<sigh> my bad.. I could have sworn one of the parameters were a range to choose when the addaction appeared.

But to redeem myself how bout this?

base_antenna = createVehicle ["Land_Antenna", [(getPos pos_target select 0) - 9, (getPos pos_target select 1) -1, getPos pos_target select 2], [], 0, "NONE"];
_barrel = createVehicle ["Barrel4", [(getPos pos_target select 0) - 9, (getPos pos_target select 1) -1, getPos pos_target select 2], [], 0, "NONE"];
_barrel attachTo [base_antenna,[0,0,-2]];_barrel addAction ["Deconstruct FOB", "uncreate_base.sqf"];
deleteCollection _barrel;

Edited by Big_Daddy

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
Sign in to follow this  

×