Jump to content

7erra

Member
  • Content Count

    753
  • Joined

  • Last visited

  • Medals

Everything posted by 7erra

  1. Ah yeah after a look at the code this is what's causing the arsenal to be unlimited: //init.sqf _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 22) then {['Open', true] call BIS_fnc_arsenal;}"]; The parameter true causes the arsenal to be unlimited and there is no way of preventing this. If you need an arsenal for the player throughout the mission consider adding it locally with an addAction: //initPlayerLocal.sqf params ["_player","_didJIP"]; _player addAction ["Personal Arsenal",{[] spawn BIS_fnc_arsenal;}]; Tbh the code of the addon is really simple and can also be achieved in a script.
  2. Nice find @gc8! I was going another way with if (!isClass(_weaponCfg>>"LinkedItems")) then {"base weapon"}; But your method even gets the name of the base weapon.
  3. @gc8 Thanks for the side selective code, I'll add it to the options of the addArsenal function! About the problem with the base weapons: Filtering the input array for the base weapons turns out to be more comlicated than I thought. The main problem is that even a different skin on the weapon will mark it as a variant of the uncolored variant. I might have a new idea about addressing this issue but that remains to be seen. @squeeze Uff that's a lot of code I will have to adjust it so it fits the system and this might take a while Err what exactly is this PA? The current version should also lock any items that can be added to a container if they are not defined, so the items in the left lists will still show up. Maybe adding a limited arsenal might help? ["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal;
  4. (pre-release) v1.5 - Automatic Cost Calculation (17.10.2018) ! SEPERATE BRANCH ! I finally got a function which can handle all arsenal items. The only problem is that I have yet to find the right balance between price, money and multipliers. If someone wants to help me out then s/he can modify the fn_automaticCostTable.sqf so that it gets you realistic prices. It would be nice to have some kind of library where you can choose from. I am still onto fixing other outstanding issues. Also thanks to @gc8, I've reused some of your code. @foxhound please don't release this yet since it is WIP :)
  5. Yeah those are not the base classes. Eg: "B_FieldPack_blk_DiverExp" has to be added as "B_FieldPack_blk". Those special attibutes tell the game which items should be in the backpack. I had the same problem: https://github.com/7erra/Arsenal-Shop/issues/2
  6. If you are okay with having two seperate boxes then yes. You can use the BIS_fnc_addVirutalItemCargo (and similar) to add specific items to the designated box
  7. Ah I can see where the problem lies. The array contains weapons which have attachements while the cost array requires you to add the base weapons (there are no weapons with attachements in the arsenal). I will implement this in the next update.
  8. Now that you mention it i had the same problem when trying my approach. the kindOf command doesn't seem to work this way with weapon classnames but that is really weird. Trying "weaponClass" isKindOf "Rifle" didn't do what it was supposed to do...
  9. Thanks for that :) I was thinking about adding the option to automatically calculate prices too but the thing is that you'd need a function which can set a price for every item, not only weapons. The function will work via the config, just as you did in the example tough it first will have to determine the type of the item with BIS_fnc_itemType to get the correct config and apply the right costs. I found some price calculation in the Ravage mod and will probably go a similar way.
  10. Update v1.4 - cfgFunctions Developement still continues as I notice quirks and errors unintended features. The changelog in the orignial post is up-to-date. 7erra
  11. Yeah that line dictates the GUI Editor which grid to use. The problem is that the GUI Editor uses three grids: absolute, safezone and a custom one. The custom one is modifyable and is overwritten by the mod. At the same time you can't switch between GUI_GRID and UI_GRID as they both take up the custom slot. But what you can do is the following: Save the dialog as a config (#include in description.ext) Open the GUI Editor Hit CTRL+I (import) Enter this in the edit box: "missionConfigfile >> "yourDialogName" Press OK The dialog should now use the grid which was set in the GUI Editor beforehand.
  12. That is intended behaviour. The UI_GRID is the newest grid and is used by the 3den editor eg. As soon as you open the escape menu it is set as the default grid for the entire session. That's not supposed to happen I'll have a look and release a fix when I figure it out. Say what? That should not be possible in any way. If my mod is disabled the default behaviour of the GUI Editor applies. Are you importing dialogs via CTRL+V by any chace? Still sorry :/
  13. You sure? It says 1.3 in my browser? Cheers!
  14. Update v1.3 - Safety and UI All right the system is now in a state which I'd call finished. I fixed some minor bugs and added everything that I could think of. Of course I tested the new version but if there are any bugs then please report them. All changes can be found in the original post. The picture is up-to-date. 7erra
  15. I disabled all controls which could get you items for free. The script is run EVERY time an Arsenal is opened, regardless of the circumstances. Therefore there is no way to circumvent the system (at least that I know of). I already have some other possible exploits in mind which I'll try to fix. On that note: I intend to make the whole system safer in a future update. Atm I went for an easy setup for small groups who want to play fair.
  16. Just released another update: v1.2 - Better refunding Refunding of items in containers (uniform, vest, backpack) Selecting a new weapon won't add 4 free magazines, neither does removing a weapon delete the compatible mags I finally got a grasp of how the default Arsenal handles it's stuff (the script is 3206 lines long ) so future editing should be easier.
  17. Eh close enough: this addEventHandler ["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; _money = _killer getVariable [TER_moneyVariable,0];// get the variable, if not defined use default (0) _money = _money + 500;//add kill reward _killer setVariable [TER_moneyVariable, _money]; "You received 500$" remoteExec ["hint",_killer];// execute code local on the pc of the killer }];
  18. Hi everyone, I was playing around with the addVirtualXXXCargo commands and all work fine except for BIS_fnc_addVirtualBackpackCargo. Here is some test code: [cursorObject, "B_AssaultPack_mcamo_Ammo", true, true] call BIS_fnc_addVirtualBackpackCargo; It returns the "added" backpack but there is none in the arsenal. Ideas?
  19. I tried a different approach: _invOpenEH = player addEventHandler ["InventoryOpened",{ params ["_unit", "_container"]; _backpackUnit = allUnits select {backpackContainer _x == _container} select 0; { _x setVariable ["_unitLoadout",getUnitLoadout _x]; } forEach [_unit,_backpackUnit]; }]; _invCloseEH = player addEventHandler ["InventoryClosed", { params ["_unit", "_container"]; _backpackUnit = allUnits select {backpackContainer _x == _container} select 0; { _setLoadout = _x getVariable ["_unitLoadout",getUnitLoadout _x]; _x setUnitLoadout _setLoadout; } forEach [_unit,_backpackUnit]; }]; player setVariable ["_invOpenEH",_invOpenEH]; player setVariable ["_invCloseEH",_invCloseEH]; This will not prevent the player from opening the inventory but instead revert the loadout of both units to the state it was in before. Still there seems to be a problem with the setUnitLoadout command if you use it on an AI unit bc I couldnt access their inventory afterwards
  20. Well this is the closest I got: There are 2 problems though: 1. You can still drop your containers (backpack, vest, uniform) 2. You can't scroll through the items Testing around with ctrlRemoveAllEventhandlers did nothing for me. I guess they are set by config or engine.
  21. Updated the repository. Changes are in the first post. @gc8 @accuracythruvolume
  22. Just leaving a link here :)
  23. Sure. You can use the BIS_fnc_addVirtualXXXCargo commands to add specific items to an arsenal. The shop system applies to any Arsenal that is opened. I will modify the addArsenal function so you can add specific items/types and put it in the next update which will also add the possibilty to sell items @gc8 ;) Thanks for the ideas
  24. Not yet. I'm was running into a problem but I might have a lead now. The next update should fix this.
  25. I have never worked with Ravage before so I'm not familliar with the currency system and the shop system. I will take a look though :)
×