billyh 10 Posted March 30, 2015 (edited) So I'm trying to make a mod for custom and dedicated suicide vests, which let you blow yourself up out of the box by just wearing them.... I've basically just used vanilla assets (for now) to make a unique vest ingame with it's seperate classname and display name to get a better understanding on how to go ahead. I have however encountered some issues, and was wondering if someone could possibly help me figure out how to get this working. The addaction script themselves DO work, and my issue that remains is how to have the script keep checking if you qualify to be given the addaction (and if you don't the addactions get removed) Example: Player joins server, goes into arsenal/ammobox, picks up a suicide vest. since the script keeps checking if people are wearing vest, it gives him the addaction when it has found the vest on him. but if he removes it, the script removes all the addactions he may or may not have. (arm, det, deac) Is it possible to do that? config.cpp class CfgPatches { class SUICIDE_VESTS { //this is just requirements units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"a3_characters_F_COMMON, Extended_EventHandlers"}; }; }; class cfgWeapons { class Vest_Camo_Base; //this defines the rendered object - textures class VestItem; //this defines the item specifications class V_SuicideVest_Small : 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_black"; // 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_black"; // ensure it is right containerClass = "Supply100"; // this defines how much storage the vest has - in theory you have a bomb, so zero - need balancing mass = 50; //general size of item, if it can fit inside other items - set high unless it enables to carry more ammo - after testing armor = 5*0.5; //can modify passThrough = 0.7; //need to figure out what it means in relation to damage //hiddenSelections[] = {"camo"}; }; }; }; class Extended_PreInit_EventHandlers { clientInit = "call compile preprocessfilelinenumbers '\SUICIDE_VESTS\init.sqf'" }; Edited March 30, 2015 by billyh progress Share this post Link to post Share on other sites
SAMstudios-3Dartist 45 Posted March 30, 2015 script is not my thing but will you make so AI will be able to activate the vest. Like when they enter a trigger or something like that. Share this post Link to post Share on other sites
soldierman 16 Posted March 30, 2015 Have a read into Eventhandlers. They might be able to give you a solution Share this post Link to post Share on other sites
billyh 10 Posted March 30, 2015 (edited) script is not my thing but will you make so AI will be able to activate the vest. Like when they enter a trigger or something like that. If I ever learn how to do things like that, then I'll look into it. edit: also, i've updated the main post. ---------- Post added at 15:15 ---------- Previous post was at 13:50 ---------- I'm not very good at scripting, but what I think I know what I need. I just don't know how to get what I need down. if you are wearing vest check if you have been given addaction -> if you have been given addaction then do nothing -> if you have not been given addactions then do give addactions -> if no vest then do remove addactions. -> repeat every X seconds/ minutes if(uniform player == "V_SuicideVest_Small") then Addaction Arm, if(player addaction arm == isNil) then Addaction Arm, if(uniform player == "V_SuicideVest_Small") isNil then removeaction arm, det, deac; Something something like that? Edited March 30, 2015 by billyh Share this post Link to post Share on other sites