Jump to content
Sign in to follow this  
wyattwic

addAction help needed

Recommended Posts

No matter what I do, I am unable to get the formatting on this correct. Would someone tell me what I am doing wrong?

this addaction ["Get in Pilot Seat",{_this select 1 action ["getInDriver", _this select 0]},9,true,false,"","_this iskindof "B_Helipilot_F""];

This line is being ran from the init of a helicopter. In most cases it simply does not return true, even though I am using a helipilot to approach.

Thank you very much!

Share this post


Link to post
Share on other sites

the _this select 1 and _this select 0 need to have brackets and also _target to say the player since I believe its _this select 1 oh and the "" around the pilot

this addaction ["Get in Pilot Seat",{(_this select 1) action ["getInDriver", (_this select 0)]},9,true,false,"","_target iskindof ""B_Helipilot_F"""];

Share this post


Link to post
Share on other sites

No success.

Error in expression <this addaction ["Get in Pilot Seat",{(_this s>

Error position: <addaction ["Get in Pilot Seat",{(_this s>

Error Type String, expected Bool

This is a bit confusing.

---------- Post added at 07:16 ---------- Previous post was at 07:05 ----------

Figured it out!

this addaction ["Get in Pilot Seat","(_this select 1) action [""getInDriver"", (_this select 0)]","",6,false,true,"","(typeOf player == ""B_Helipilot_F"")"];  

Share this post


Link to post
Share on other sites

Ah you figured it out, good.

Keep in mind you can also use single-quotes. ' ' instead of these ugly ones "" "". Makes it a bit tidier.

addAction can be a really powerful tool, I can recommend these 2 links if you want to learn more about it:

http://killzonekid.com/arma-scripting-tutorials-addaction-quirks/

http://killzonekid.com/arma-scripting-tutorials-addaction-quirks-v2/

Share this post


Link to post
Share on other sites

This isn't exactly relevant to the original post's addaction problem but i figured this thread fits my criteria.

This is my problem/ request and any suggestions are welcome but my plan is for this to happen

1.create a helipad in the editor

2. create a nearby ai with multiple addactions to spawn different ammo crates and an addaction to clear the helipad(which then despawns any ammo crate on the helipad)

3.I would also like it if a textbox shows up when someone tries to spawn a ammo box and there is already an ammobox on the helipad saying the "Cannot spawn, helipad blocked"

that is what my aim is and if someone could also include in there how to set an custom content depending on what ammo box is spawned

i.e the "Spawn 5.56 ammo box" addaction would spawn an ammo box with 30 5.56 mags inside.

I'm pretty new to editing in arma 3 so any ideas how or if this achievable would be greatly appreciated

Share this post


Link to post
Share on other sites

Well the first script I ever made was actually something like that but with vehicles, it would work the same way. Let me update.

---------- Post added at 13:12 ---------- Previous post was at 12:36 ----------

//["classname","Position","Magazines"] spawn LALA_fnc_CreateVehicleAmmoBox;
//Example
//["Box_NATO_Ammo_F","HELIPAD1",1] spawn LALA_fnc_CreateVehicleAmmoBox;
//Example
//["Box_NATO_Ammo_F","HELIPAD1"] spawn LALA_fnc_CreateVehicleAmmoBox;
//That would create a the ammobox but will not delete what's inside

//For Magazines 0 = 5.56 Stanag Mags (Independent)
//For Magazines 1 = 6.5 Caseless Mags (Blufor)
//For Maragzines 2 = 6.5 Caseless Mags (Opfor)
//For Magazines any number will clear it automatically including the ones above

LALA_fnc_CreateVehicleAmmoBox = {

_obj = _this select 0;
_pos = _this select 1;
_ammotype = _this select 2;

_stuff = nearestObjects [_pos,["ReammoBox","WeaponHolder","GroundWeaponHolder","WeaponHolderSimulated"], 10];

if (count _stuff > 0) then {
	{
		deleteVehicle _x;
	}forEach _stuff;
};

_veh_name = getText (configFile >> "cfgVehicles" >> _obj >> "displayName"); 
hint format ["%1 is being created standby",_veh_name];

sleep 1;

myVEH = createVehicle [_obj, getPos _pos, [], 0,"FORM"];
myVEH setDir (getDir _pos);

if (isNull myVEH) then { player sideChat "Error, Contact Mission Maker with ClassName Name"; };

if (!isNil _ammotype) then {
	clearMagazineCargoGlobal myVEH;
	clearWeaponCargoGlobal myVEH;
	clearItemCargoGlobal myVEH;
	clearBackpackCargoGlobal myVEH;
	if (_ammotype == 0) then {
		myVEH addMagazineCargoGlobal ["30Rnd_556x45_Stanag",30];
	};
	if (_ammotype == 1) then {
		myVEH addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag",30];
		myVEH addMagazineCargoGlobal ["100Rnd_65x39_caseless_mag",30];
	};
	if (_ammotype == 2) then {
		myVEH addMagazineCargoGlobal ["30Rnd_65x39_caseless_green",30];
	};
};
};

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  

×