Jump to content
Sign in to follow this  
dpatt711

addAction Help!

Recommended Posts

I tried reading but everything went over my head, I want to make a script so when you walk up to a radio tower you get a scroll wheel option and have it run a script with these arguments (this is what I put in a trigger to make it work) nul=[(getPos artytarget),75,6,1,["Sh_82mm_AMOS"]] execVM "arty.sqf"

Share this post


Link to post
Share on other sites

this addaction ["Arty", "arty.sqf"];

if you are using the same getpos position each time and the same info 75.6.1 - add them to your arty script

Share this post


Link to post
Share on other sites

Why I can't add some commands to the addAction? Should I always use scripts? What about only change some variable? That's stupid! Don't you think?

Share this post


Link to post
Share on other sites
I tried reading but everything went over my head, I want to make a script so when you walk up to a radio tower you get a scroll wheel option and have it run a script with these arguments (this is what I put in a trigger to make it work) nul=[(getPos artytarget),75,6,1,["Sh_82mm_AMOS"]] execVM "arty.sqf"

if im right in saying you want a script that creates an action when you walk up to the radio tower

There are a fiew ways of doing this

based on the fact that i have now clue of what the arguements mean i can suggest you do this

First Way


//define the arguments here
_args = //put your args here
          e.g. player distance radio_tower <=76;
_priority = 1; //this is where the action is located in the action menu 1=on the top
_showWindowBoolean = true; //or false
_hideOnUseBoolean = true; //or false depending on wether you want to use the action again
_shortcutKey = "" //only use if you have assigned a shortcut key in the bin.cofig
_condition = ""
_callArty = player addAction ["Call Arty", "arty.sqf" ,(_args, _priority, _showWindowBoolean, _hideOnUseBoolean, _shortcutKey, _condition)];

then for the arty.sqf you could right

hint parseText "<t size='1.2' color='#ff0000'>Arty in-bound</t>";
_artyShell = "Sh_82mm_AMOS" createVehicle position artytarget 
//if artytarget is a marker do this
_artyShell = "Sh_82mm_AMOS" createVehicle position (getmarkerpos "artytarget");


//to create multiple shells you can do this
_shellNumber = 6
while (_shellNumber >= 0) do
{
  _shellNumber = _shellNumber - 1;
  _artyShell = "Sh_82mm_AMOS" createVehicle position (getmarkerpos "artytarget");
  //this hints when shells are depleted
if (_shellNumber == 0) then
{
  hint "Shells are depleted";
}

};

hope that helps

Share this post


Link to post
Share on other sites

Well here is the script

_pos = _this select 0;

_radius = _this select 1;

_number = _this select 2;

_interval = _this select 3;

_types = _this select 4;

waitUntil{

_random = random (count _types);

_random = _random - (_random mod 1);

_round = createVehicle [(_types select _random),[(_pos select 0),(_pos select 1),(100+random 50)],[],_radius,"NONE"];

_round setvelocity [-15+random 30,-15+random 30,-30-random 20];

_number = _number - 1;

sleep _interval;

_number <= 0

};

So I would make another scipt that requires no arguments, that essentially calls this script and includes the arguments?

Also the tower is Transmitter Tower (big) 1 when I mouse over in editor

Share this post


Link to post
Share on other sites

Did you check http://community.bistudio.com/wiki/addAction

You can easily pass arguments etc.

I just dont know how to add the action to the building. Think you can place a GameLogic on the building and save it into a variable with http://community.bistudio.com/wiki/nearestBuilding

In the end it could look something like this (only pseudo code)

tower addAction ["Request Artillery", "Arty.sqf", [(getPos artyTarget),75,6,1,["Sh_82mmm_AMOS"]]];

Your arty.sqf should then start something like this (this is my template for scripts i call with addAction)

// standard arguments
_target = _this select 0;
_caller = _this select 1;
_id = _this select 2;
// arguments
_args = _this select 3;

//....continue with your arty code here

So... _args is the array where all the arguments are. In your current script you have "_pos = _this select 0;" ...this will be "_pos = _args select 0;" now.

Edited by dga

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  

×