sprucewaine 1 Posted June 11, 2018 Is it possible to add an action to all objects through the description.ext? like? class CfgVehicles { class LIB_AmmoCrates_NoInteractive_Large { class UserActions { class CollectPoints { displayNameDefault = "Collect"; showWindow = 0; hideOnUse = 1; displayName="Collect"; position="action"; radius=0.10000; onlyForPlayer = 1; condition = true; statement = "this addAction ["Collect", {myCurator addCuratorPoints 0.15}]"; }; }; }; }; which the code doesn't work because i keep getting the (something) instead of ''' error. Anyway if its possible, i want to do this route instead of doing init code as this would mean that all objects placed by editor or Zeus would be affected. Share this post Link to post Share on other sites
HazJ 1289 Posted June 12, 2018 In addon, yes. In mission, kinda. You can define it in a config as a STRING but you'll need to call compile it to work properly. https://community.bistudio.com/wiki/call https://community.bistudio.com/wiki/compile https://community.bistudio.com/wiki/getText Not really worth it if you ask me. Pointless. Share this post Link to post Share on other sites
sprucewaine 1 Posted June 12, 2018 1 hour ago, HazJ said: In addon, yes. In mission, kinda. You can define it in a config as a STRING but you'll need to call compile it to work properly. https://community.bistudio.com/wiki/call https://community.bistudio.com/wiki/compile https://community.bistudio.com/wiki/getText Not really worth it if you ask me. Pointless. Hmm any examples of someone doing what I'm trying to do? after reading those wiki's I'm even more confused on what I'm suppose to be doing. Share this post Link to post Share on other sites
HazJ 1289 Posted June 12, 2018 Sure but first... What are you trying to do? Why not use the addAction in code, no need for it to be in the configs. Unless you are making an addon, say a vehicle with action on it. Share this post Link to post Share on other sites
sprucewaine 1 Posted June 12, 2018 Just now, HazJ said: Sure but first... What are you trying to do? Why not use the addAction in code, no need for it to be in the configs. Unless you are making an addon, say a vehicle with action on it. Applying it globally will ensure that its attached the object regardless if its placed by Zeus, script, or the Eden editor. In this case i just wanted to add functionality to this useless ammo box. If i did it via script, then i would have to add an event handler to the curator which is a pain in the ass to have it sift through all your addons checking if you placed something it needs to manipulate. Here its just implied that if there is an ammo box anywhere on the map, that the player can go up to it and get curator points. I probably will do this to add functionality to other props, so that the curator has an incentive to place certain items that otherwise would be useless. Share this post Link to post Share on other sites
HazJ 1289 Posted June 12, 2018 Is this ammobox custom? You can add it via config (addon way), better of asking someone else for that. Maybe here: https://forums.bohemia.net/forums/forum/162-arma-3-addons-configs-scripting/ There is another way. You can use normal SQF code in the PBO. Assuming the addon is required by every client you can just add local action. If it server addon then you'll need to most likely remoteExec it. Let me know. Server-side way: // modified example from my project class CfgPatches { class addonClass { name = "Addon Name"; author[] = {"Author"}; url = "URL"; // optional, "" for none requiredVersion = 1; requiredAddons[] = {"HazWSConfigs"}; units[] = {}; weapons[] = {}; }; }; class CfgFunctions { class addonClass // same as class above { class main { class postInit { postInit = 1; file = "addonClass\server\server_init.sqf"; }; }; }; }; // in server_init.sqf // remoteExec addAction or whatever... As I said though, if all addons use it. Just do it locally. No need for this server-side way, etc... Share this post Link to post Share on other sites
gokitty1199 225 Posted June 12, 2018 can you just make a addaction with the condition for it, that way even if zeus places it it should still show up and function the same? Share this post Link to post Share on other sites
HazJ 1289 Posted June 12, 2018 You can just add it normally as I originally said, with plain SQF, regardless if it is locally per client, global from server, or where-ever. I also provided alternative solutions. I think he is a little confused... @hank kelley - Please provide more info. Is this an ammobox placed or what? Share this post Link to post Share on other sites
sprucewaine 1 Posted June 12, 2018 5 hours ago, HazJ said: You can just add it normally as I originally said, with plain SQF, regardless if it is locally per client, global from server, or where-ever. I also provided alternative solutions. I think he is a little confused... @hank kelley - Please provide more info. Is this an ammobox placed or what? No it is not placed. I want it so that if it ever was placed by the editor/script/zeus, it will already function the way i wanted it to function. All LIB_AmmoCrates_NoInteractive_Large was going to be a box that i was going to add an add action too. Spoiler 9 hours ago, HazJ said: Is this ammobox custom? You can add it via config (addon way), better of asking someone else for that. Maybe here: https://forums.bohemia.net/forums/forum/162-arma-3-addons-configs-scripting/ There is another way. You can use normal SQF code in the PBO. Assuming the addon is required by every client you can just add local action. If it server addon then you'll need to most likely remoteExec it. Let me know. Server-side way: // modified example from my project class CfgPatches { class addonClass { name = "Addon Name"; author[] = {"Author"}; url = "URL"; // optional, "" for none requiredVersion = 1; requiredAddons[] = {"HazWSConfigs"}; units[] = {}; weapons[] = {}; }; }; class CfgFunctions { class addonClass // same as class above { class main { class postInit { postInit = 1; file = "addonClass\server\server_init.sqf"; }; }; }; }; // in server_init.sqf // remoteExec addAction or whatever... As I said though, if all addons use it. Just do it locally. No need for this server-side way, etc... I am a little confused on why i need to mess with patched and functions to make this work? Share this post Link to post Share on other sites
sprucewaine 1 Posted June 12, 2018 How do UAV bags even assemble? isn't that inherit functionality? Share this post Link to post Share on other sites
HazJ 1289 Posted June 12, 2018 You don't have to do it like that. That was more server-side approach that I shown above. Share this post Link to post Share on other sites
Sgt. Dennenboom 98 Posted June 12, 2018 You cannot edit the configFile in description.ext as far as I'm aware, so you cannot give custom "init" eventhandlers or useractions to a vehicle config. This only works through making an addon. If you want to have an addAction that works without adding it to every spawned vehicle you have few options: Add it to the player. Use a mission eventhandler such as getInMan/InventoryOpened/... to give an addAction. Use a loop that checks all objects in the mission and adds the action when required. Share this post Link to post Share on other sites
Dedmen 2716 Posted June 13, 2018 14 hours ago, Sgt. Dennenboom said: so you cannot give custom "init" eventhandlers You could with CBA. And then addAction inside the init script. Share this post Link to post Share on other sites
sprucewaine 1 Posted June 13, 2018 7 hours ago, Dedmen said: You could with CBA. And then addAction inside the init script. I am working with the CBA Addon. Would it be part of the mission or a seperate addon? Share this post Link to post Share on other sites
Belbo 462 Posted June 13, 2018 http://cbateam.github.io/CBA_A3/docs/files/xeh/fnc_addClassEventHandler-sqf.html#CBA_fnc_addClassEventHandler 1 Share this post Link to post Share on other sites
Dedmen 2716 Posted June 15, 2018 On 13.6.2018 at 8:11 PM, hank kelley said: I am working with the CBA Addon. Would it be part of the mission or a seperate addon? Like belbo posted above. You can add the eventhandler as part of your init.sqf (Btw Commy recommends to use the initPost handler) Or you can add them in your description.ext as a eventhandler config. https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new)#extended_initpost_eventhandlers ^ Description.ext option Share this post Link to post Share on other sites
Frostello 0 Posted September 21, 2021 Forgive me for the dumb question that's possibly been answered/unrelated to the post, but I've been trying to create a script in my mission that renames weapons, vehicles and equipment like how ACE does. Also want to change some stats for some items (looking at the CSAT fatigues specifically). Would this be done via the call and compile commands or by some other approach? I'm not using CBA or any other mods so that the mission file itself has no dependencies. Share this post Link to post Share on other sites