Jump to content

HallyG

Member
  • Content Count

    254
  • Joined

  • Last visited

  • Medals

Everything posted by HallyG

  1. Here's a script snippet to play around with that can be used to visualise your shots during target practice. At the moment this only works in singleplayer (I haven't tested it in multiplayer). init.sqf The classname of the target used in the video is "TargetP_Inf_Acc2_F". Change HALs_hits_target_history to change how many previous hits that each target remembers. Change _w, _h in HALs_hits_fnc_ui to adjust the width and height of the ui. Change _max in HALs_hits_fnc_ui to change the maximum number hits that can be shown (on the ui) at once. Add a target object with [<obj>] call HALs_hits_fnc_removeTarget. Add a target object with [<obj>] call HALs_hits_fnc_addTarget. Set the target object's active shooter with [<obj>, <unit>] call HALs_hit_fnc_setTargetShooter. Add your own target types in HALs_hits_fnc_targetOffset.
  2. HALs Store v1.5 Video (v1.5): Overview: HALs Store adds a weapon store to any mission. This provides players with the opportunity to buy and sell equipment or weapons from stores defined by the mission maker. HALs Store v1.5 Download Changelog: v1.5 v1.4.1 v1.4 v1.1 Features: Easily configurable store; define your own traders and the items they buy and sell in description.ext. In-game currency system, fully integrated with the money objects (added in the Old Man update) available in the editor. Each Trader has its own categories, each with their own items. e.g. Handguns, Magazines, Backpacks Items have prices and can only be purchased if the player has sufficient money. Stores have stock - an item can only be purchased if it is stocked. Items can be purchased from the trader to the player, their equipment or nearby vehicles. Items can be sold to the trader from the player, their equipment or nearby vehicles. Helpful progress bars indicate the current load of a container, and the space available after purchase. Filter available items with preset conditions (compatible with equipped weapons, available for purchase). Progress bars show various stats about the available weapons and equipment. e.g. Ballistic Protection, Explosion Resistance, Impact, Accuracy Usage Unpack the downloaded .rar and check out the demo mission. For further details (such as changing the sell price), please see: Installation Configuration and Configuration Example How to use and useful functions for mission makers Cheers
  3. Hi, Here's a simple icon viewer that I threw together. This allows you to easily view and search through all icons present in loaded .pbos. Run the script from the debug console. Use the search bar to search for specific icons. Click on an icon to copy the path to your clipboard. Since it uses addonFiles, icons from .ebos cannot be viewed. Script: https://gist.github.com/HallyG/fa7a6cda10abcb630b1dc325f0523553 Cheers
  4. HallyG

    Icon Viewer Script

    Thanks. Here's a slightly modified version where the text has been moved to the tooltip of each image: Script:
  5. Hi all, Update v1.5 is now available. Notable changes: Improved the GUI appearance by minimising white-space and changing colours to match BIS' theme. Added an example mission to demonstrate using different stores. Added a help button that links to the Usage page on the GitHub wiki. Added optional target parameter to HALs_store_fnc_addTrader to determine what players (e.g. BLUFOR only) can access the store (default is everyone). Added function HALs_store_fnc_openStore to open the store without the action. Added function HALs_store_fnc_addActionTrader to add an open store action to all targets. Changed traders can be any type not just CAManBase, ReammoBox_F or Car_F. Changed stock and starting funds can now be greater than 999,999. Fixed typo in the store open action - with a new entry in stringtable.xml: STR_HALS_STORE_OPEN_ACTION. Visit the Usage page for information about how to use new/modified functions. Known issues: Sometimes you can't use grenades after they have been added to your inventory. This could potentially be solved using reload. Cheers
  6. Thanks! I've already improved the UI further.. so if you want a sneak peak: old versus new. In terms of converting the items to money, it's a take eventhandler, which selects an amount to add based on the item classname. In the current version dropping money is unavailable but I've already created a script to allow dropping money. Hi, I've updated the function usage with some examples (seems like I should have done that in the first place). In your case, <store type> needs to be replaced by the name of the store defined in the HALs\Addons\store\config.hpp. For example, in the provided test mission, you could use either "weapon" or "navigation": if (isServer) then {[this, "weapon"] call HALs_store_fnc_addTrader;}; if (isServer) then {[this, "navigation"] call HALs_store_fnc_addTrader;};
  7. Hi all, A new version is available, v1.4.1. This is a smaller update but in short: Added compatibility with the interactive money objects added from the Old Man update - pick up any of these objects to acquirer some sweet ol' cash (video). The player's money is now displayed in their inventory. Replaced addAction with the BIS_fnc_holdActionAdd. Various performance improvements and bug fixes. Weapons classes with attachments can now be sold (if not stocked, their price comes from their parent weapon class). Slight colour-schemes tweaks to better match in-game UI colours. The full change-log can be viewed here. Cheers
  8. Hi all, Version 1.4 is now available; in short it adds various optimisation improvements and selling 😉. Feedback is welcome for any bugs you find (I haven't extensively tested this). To sell an item, the store needs to stock it and you will need to check a certain checkbox. This version has actually been available for a while over on GitHub but due to lack of free-time I haven't been able to update anything here. Cheers
  9. I plan on adding this feature, yes. Currently I have very little free time due to RL stuff. I recommend checking the GitHub because sometimes I'll add features without mentioning. Was planning on adding a temporary script to sell everything in an ammo box (without an UI). I've written a very basic script for you and added comments to help you understand:
  10. This will return how many characters there are in a string which is an alternate syntax already documented.
  11. Money for killing enemy units: For adding money when searching a body, I would take a look at this. Alternatively, you could try creating an addAction on the enemies to, for example, pilfer their wallets. I'll make sure to add this as an option in the next update. Cheers
  12. [[1920,1080,792,594,1.77778,0.55],[18,16,8],[18,16,8],true]
  13. Unless you equip the uniform upon purchase, you will need a separate script to enable that functionality. I suggest you take a look at @pierremgi's "wear what you want" script. Thanks for the kind words, I'm glad it was able to give you some inspiration! If you're looking for additional gun-store-style inspiration then this is another approach I have been working on (solely with ctrlCreate) ((shameless plug)): Excellent, just make sure you listen to some Blur whenever it is used Cheers
  14. Certain uniforms can only be dressed by certain units. You cannot manually dress a unit with a restricted uniform unless you use the forceAddUniform command. To check whether a uniform can be worn by a specific unit use the isUniformAllowed command. Cheers
  15. Try removeMagazine like Schatten suggested. Also I don’t think it was entirely necessary to create a new thread when you have already posted a few times in the original thread.
  16. You want to modify HALs_money_fnc_getFunds (maintaining that it returns a scalar) to: For HALs_money_fnc_addFunds maybe something like: This should give you something to start and build upon.
  17. Hi, you could change the functions HALs_money_fnc_addFunds and HALs_money_fnc_getFunds without having to alter the functionality of the store script itself. I would provide some code for you to try but I am unable to test anything because my computer is completely broken. Cheers, Hal
  18. Just whipped this together quickly to demonstrate my point: player addEventHandler ["Fired", { (_this select 6) setShotParents [vehicle (_this select 0), (_this select 0)] }]; addMissionEventhandler ["Draw3D", { _friendlyGrenades = (player nearObjects ["GrenadeHand", 10]) select { (getShotParents _x) params ["_vehicle", "_unit"]; side group _unit isEqualTo side group player }; if (count _friendlyGrenades > 0) then { { drawIcon3D ["", [1,0,0,1], visiblePosition _x, 0, 0, 0, "Target", 1, 0.05, "PuristaMedium"]; nil; } count _friendlyGrenades; }; }];
  19. Not sure if it will work, but in the fired eventhandler you could use setShotParents and then, while using nearObjects, filter the indicators according to the side of the group and using the array returned by getShotParents.
  20. Try changing: [(visiblePosition _unit) select 0,(visiblePosition _unit) select 1,((visiblePosition _unit) select 2) + 10] to (visiblePosition _unit) vectorAdd [0,0,10] Then, _enemyArray = []; {if ((((side _x) == AIside) && (isFormationLeader _x)) or (((side _x) == AIside) && (vehicle _x != _x))) then {_enemyArray pushBackUnique (vehicle _x)}} forEach allUnits; to (using the select command) _enemyArray = allUnits select {((side _x isEqualTo AIside) && (isFormationLeader _x)) or ((side _x isEqualTo AIside) && (vehicle _x != _x))} apply {vehicle _x}; Additionally you are using str when format already returns a string. parseText parses structured text which the strings used do not contain (therefore it's not required): _text = str(parseText format["%1m",(str _distance)]); to _text = format ["%1m", _distance]; Additionally, you are using pushBack when you could use the apply command:
  21. To play sounds simultaneously, have a look at createSoundSource. For spawning flies, try bis_fnc_flies which is essentially:
  22. HallyG

    Hold Action Not Appearing

    Try increasing the distance in the condition. The distance command measures the distance from the centre of the object and as such, due to the object's geometry, you might be unable to get within 3 metres of it.
  23. I think the result you want to obtain is dependent upon your definition of a gunship. However, in my attempt I assume that it is a gunship if it has "CAS_Heli" in the array returned from the config value "availableForSupportTypes": //--- Get vehicles which are aircraft and can be spawned in the editor _allHelicoptersCfgPaths = "getNumber (_x >> 'type') isEqualTo 2 && getNumber (_x >> 'scope') >= 2" configClasses (configFile >> "cfgVehicles"); //--- Get all vehicles which have the 'helicopter' simulation and are not autonomous _allHelicoptersCfgPaths = _allHelicoptersCfgPaths select {toLower getText (_x >> 'simulation') isEqualTo "helicopterrtd" && {toLower getText (_x >> 'vehicleClass') != "autonomous"}}; //--- All Vehicles which are allowed to be used in cas module // _allHelicoptersCfgPaths = _allHelicoptersCfgPaths select {isClass (_x >> "Components" >> "TransportPylonsComponent")}; _allHelicoptersCfgPaths = _allHelicoptersCfgPaths select {"CAS_Heli" in (getArray (_x >> 'availableForSupportTypes'))}; //--- Dump config names to the clipboard copyToClipboard (_allHelicoptersCfgPaths apply {configName _x} joinString endl); (you could do this all in one line but it's easier to read like this) Obviously, this will only work if the helicopter has "CAS_Heli" in the array for "availableForSupportTypes" in the config. You could, however, modify the script to instead verify if the helicopter can equip missiles (might help for mods).
  24. Something like this maybe? _allVehiclesWithIcons = "getNumber (_x >> 'type') == 0 && getNumber (_x >> 'scope') >= 2 && getText (_x >> 'icon') != ''" configClasses (configFile >> "cfgVehicles"); _allVehiclesWithIcons = _allVehiclesWithIcons apply {getText (_x >> 'icon')}; _allVehiclesWithIcons = _allVehiclesWithIcons arrayIntersect _allVehiclesWithIcons; copyToClipboard (_allVehiclesWithIcons joinString endl) Which will dump to your clipboard: ... iconAnimal iconMan ...
  25. This script, by @Heeeere's johnny!, might provide you with a suitable starting point:
×