Jump to content
Sign in to follow this  
billyh

Any similar function like AssignedUnits, but for uniforms?

Recommended Posts

I'm trying to get a script working, but can't get it trough the way I want.

if ("ItemCompass" in assignedItems Player) then {arm = player addAction ["Arm Bomb","SUICIDE_VESTS\armbomb.sqf"] } else [removeAction det, removeAction deac, removeAction arm];

I've made a custom vest, which is an uniform. And I cant get the script to work because it doesn't count as an assigned item.

if ("VSS" in assignedItems Player) then {arm = player addAction ["Arm Bomb","SUICIDE_VESTS\armbomb.sqf"] } else [removeAction det, removeAction deac, removeAction arm];

In other words, is there a function similar to assignedItems, like assignedUniforms? Or is there any way to do it the hard way for the script to trigger if a uniform is found?

Becuase this script works if i have it look for the compass, but not for the uniform. (VSS is my classname for Vest Suicide Small)

If there is no similar function, can someone help with how to do the same as assignedItems do?

all i can think of would be something like

bomberVests = ["SVS", "SVL"];
if ("SVS" in bomberVests Player) then {arm = player addAction ["Arm Bomb","SUICIDE_VESTS\armbomb.sqf"] } else [removeAction det, removeAction deac, removeAction arm];

Edited by billyh

Share this post


Link to post
Share on other sites

bomberVests = ["SVS", "SVL"];

if (((uniform player) == "SVS") OR ((uniform player) == "SVL")) then {arm = player addAction ["Arm Bomb","SUICIDE_VESTS\armbomb.sqf"] } else [removeAction det, removeAction deac, removeAction arm];

Share this post


Link to post
Share on other sites
bomberVests = ["SVS", "SVL"];

if (((uniform player) == "SVS") OR ((uniform player) == "SVL")) then {arm = player addAction ["Arm Bomb","SUICIDE_VESTS\armbomb.sqf"] } else [removeAction det, removeAction deac, removeAction arm];

Still not there, can't get it to work

adding arm = player addAction ["Arm Bomb","SUICIDE_VESTS\armbomb.sqf" manually in the console adds the addaction menu, but wearing the vest (with classname SVS) and trying this won't trigger it.

class cfgWeapons {
class Vest_Camo_Base; //this defines the rendered object - textures
class VestItem; //this defines the item specifications

class SVS : Vest_Camo_Base {  // Class name to spawn
	scope = 2;
	displayName = "Suicide Vest Small"; // Ingame name for object, arsenal name etc etc to identify it
	picture = "\A3\characters_f\Data\UI\icon_V_tacvest_blk_CA.paa"; // doublecheck in characters_f pbo
	model = "\A3\Characters_F\COMMON\equip_tacticalvest"; // doublecheck in characters_f pbo
	//hiddenSelections[] = {"camo"}; //what is this
	//hiddenSelectionsTextures[] = {"pathtoyouraddonretexturefile.paa"};  // what is this?

	class ItemInfo : VestItem {
		uniformModel = "\A3\Characters_F\COMMON\equip_tacticalvest";  // ensure it is right
		containerClass = "Supply100"; // capacity
		mass = 50; // weight / size, correlates to value above
		armor = 5*0.5;
		passThrough = 0.7; //need to figure out what it means in relation to damage
		//hiddenSelections[] = {"camo"};
	};
};
};

it does trigger if i set it to ItemCompass and use assignedItems.

This would all be much simpler if assignedItems also checked uniform/vests, or i there were an assignedVest/assignedUniform function

Edited by billyh

Share this post


Link to post
Share on other sites

Not a command problem but script problem. And you were speaking about uniform but your config is vest

bomberVests = ["SVS", "SVL"];
[] spawn {
while {true} do {
	if ((vest player) IN bomberVest) then {
		arm = player addAction ["Arm Bomb","SUICIDE_VESTS\armbomb.sqf"] ;
	} else {
		player removeAction det;
		player removeAction deac; 
		player removeAction arm;
	};
};
};

Or simply

bomberVests = ["SVS", "SVL"];
arm = player addAction["Arm Bomb","SUICIDE_VESTS\armbomb.sqf","",0,false,false,"",'alive player && ((vest player) IN bomberVests)']];

Edited by Mash6

Share this post


Link to post
Share on other sites
Not a command problem but script problem. And you were speaking about uniform but your config is vest

bomberVests = ["SVS", "SVL"];
[] spawn {
while {true} do {
	if ((vest player) IN bomberVest) then {
		arm = player addAction ["Arm Bomb","SUICIDE_VESTS\armbomb.sqf"] ;
	} else {
		player removeAction det;
		player removeAction deac; 
		player removeAction arm;
	};
};
};

Or simply

bomberVests = ["SVS", "SVL"];
arm = player addAction["Arm Bomb","SUICIDE_VESTS\armbomb.sqf","",0,false,false,"",'alive player && ((vest player) IN bomberVests)']];

Sweet, that seems to work.

Now to figure out why the client.cpp wont load the script.

Thanks a lot.

bomberVests = ["SVS", "SVL"];
arm = player addAction["Arm Bomb","SUICIDE_VESTS\armbomb.sqf","",0,false,false,"",'alive player && ((vest player) IN bomberVests)'];

This works perfectly.

class CfgPatches 
{
class SUICIDE_VESTS {
	units[] = {};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {}; 
};

class Disable_XEH_Logging {
	units[] = {};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {};
};
};

class Extended_PostInit_EventHandlers 
{
init = "call compile preprocessFileLineNumbers 'SUICIDE_VESTS\suicidebomb.sqf'";
};

class cfgWeapons {
class Vest_Camo_Base; //this defines the rendered object - textures
class VestItem; //this defines the item specifications

class SVS : Vest_Camo_Base {  // Class name to spawn
	scope = 2;
	displayName = "Suicide Vest Small"; // Ingame name for object, arsenal name etc etc to identify it
	picture = "\A3\characters_f\Data\UI\icon_V_tacvest_blk_CA.paa"; // doublecheck in characters_f pbo
	model = "\A3\Characters_F\COMMON\equip_tacticalvest"; // doublecheck in characters_f pbo
	//hiddenSelections[] = {"camo"}; //what is this
	//hiddenSelectionsTextures[] = {"pathtoyouraddonretexturefile.paa"};  // what is this?

	class ItemInfo : VestItem {
		uniformModel = "\A3\Characters_F\COMMON\equip_tacticalvest";  // ensure it is right
		containerClass = "Supply100"; // capacity
		mass = 50; // weight / size, correlates to value above
		armor = 5*0.5;
		passThrough = 0.7; //need to figure out what it means in relation to damage
		//hiddenSelections[] = {"camo"};
	};
};
};

So I managed to fix the issue.

I now have a vest which gives you the ad-action to blow yourself up, but only if you are wearing the vest.

everyone technically have it, but only if they are wearing the vest.

Thanks for the help!

Edited by billyh

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  

×