Jump to content

Recommended Posts

GOM_fnc_aircraftLoadout V1.35

 

by Grumpy Old Man

 

 

 

 

 

Features:

  • Change serial (tail) number on compatible aircraft (currently supported: Gryphon, Shikra and Black Wasp)
  • Change pylon priority (makes multiple pylons act as a single weapon if they have the same priority)
  • Works with all addon aircrafts with properly configured pylons
  • Preset function to save presets and load them, mission/server independent
    • deleting a preset works only when holding down CTRL to prevent mishaps
  • Option to set pylon ownership to either gunner or pilot, also works with presets
  • Change the livery of the aircraft if it's configured for one
  • Allows certain players to modify aircraft loadouts, as well as rearm the pylons and repair/refuel the aircraft
  • Can be restricted to work only if fuel/ammo/repair sources are within 50m of the object holding the menu
  • You can simultaneously only refuel as many aircraft as you have fuel sources
  • Can sort for compatible weapons or allow to mount all weapons on all pylons
  • Ability to set reporting, receiving of remote targets and own position
  • One click to clear all pylons if you changed your mind
  • Can be operated by a lone pilot or a designated logistics crew
  • Multiple players can install multiple pylons on the same plane, one pylon at a time
  • Pylon installation will take some time, depending on mag size (twin cannons or gatlings will install faster than a 12 missile dagr pod)
  • Rearming with engines on

 

How to use this script:

Unpack the downloaded .rar and check out the demo mission.

Copy the file structure besides init.sqf and mission.sqm into your own mission. Don't forget to back up before overwriting any files!

 

Functions for mission makers:
 

Spoiler

 

[YourAircraftName] call GOM_fnc_clearAllPylons; //clears all pylons
 [YourAircraftName,"123"] call GOM_fnc_aircraftSetSerialNumber; //only accepts 3 digit string. supported planes: gryphon, shikra and black wasp

 

 

The following commands allow you to add ammo, fuel or repair cargo to any vehicle or building
with this you can have a HQ building holding these resources or have a hemtt(box) holding all 3 resource types, up to you, range check still applies
also possible to override the default max. capacity of 10000kg/l per vehicle

This will override any default settings and also might solve the issue with ACE3 somehow messing with the transportCargo/Ammo/Repair values.

 

[this,2500] call GOM_fnc_setRepairCargo; //will set the vehicles repair cargo to 2500kg
[this,2500] call GOM_fnc_setFuelCargo; //will set the vehicles fuel cargo to 2500l
[this,2500] call GOM_fnc_setAmmoCargo; //will set the vehicles ammo cargo to 2500kg

 

_add = _this spawn GOM_fnc_addAircraftLoadout; //put this into the initPlayerLocal.sqf of your mission root folder if you want every player to have access to this menu or see the existing file for another example
you can further restrict access to this menu by filtering for UID or player objects, but this is entirely up to you how to implement it, a peek into the initPlayerLocal.sqf of this mission shows one possibility

_add = this spawn GOM_fnc_addAircraftLoadoutToObject; //put this into the init field of an object to have the object grant access to the loadout menu
see the mission for further examples on how to only add this to individual players

 

 

List of commands used by remoteExec (changed in 1.33😞

Spoiler

SetPylonLoadout
SetAmmoOnPylon
removeWeaponGlobal
setPylonsPriority
GOM_fnc_handleResources
setFuelCargo
setAmmoCargo
setRepairCargo
setFuel

 

 

Read:

 

The addAction on objects will only show up if the players weapon is lowered.

Make sure you have aircraft placed that are dynamic loadout compatible (especially for missions made pre 1.70!).

 

The script now by default needs to have at least one ammo source, repair source or fuel source within 50m of the object that is holding the loadout menu.

The respective options will be greyed out otherwise.

This can be changed however. Simply adjust the variables in the of GOM_fnc_aircraftLoadoutParameters.sqf to your liking, the comments tell you what each variable does.

 

(!) Check out the included mission file on how to add this menu to objects, players or triggers, dedicated server and local hosted server compatible.

 

Aircraft Loadout V1.35 Download

 

Known issues:

If you encounter any errors please send me a PM containing details (screenshots,.rpt,error messages etc).

If you encounter vehicle resources not working with ACE3 check out the functions for mission makers section above.

 

Spoiler

 

Make sure you only define CfgFunctions once, so the description.ext it should look like this:


class CfgFunctions
{

	#include "scripts\GOM\functions\GOM_fnc_functions.hpp"

};


class CfgCommunicationMenu
{

	#include "scripts\GOM\functions\GOM_fnc_aircraftLoadoutMenu.hpp"

};

#include "scripts\GOM\dialogs\GOM_dialog_parents.hpp"
#include "scripts\GOM\dialogs\GOM_dialog_controls.hpp"

The line containint "class CfgFunctions" should exist only once.

If you still experience issues feel free to PM me, way easier to ignore :yay:

 

 

Changelog:

 


V1.35

  • Fixed: Players are no longer able to load presets created with a different pylon restriction setting, thanks @magicsrp
    • Due to this change all presets needed to be reset

 

V1.342

  • (Most likely) Fixed: Error with CUP Aircraft not returning getAllHitPointsDamage

 

V1.341

  • Fixed: "Unknown attribute t" .rpt spam, thanks @magicsrp

 

Previous changes:

Spoiler

V1.34

  • Fixed: Proper removal of weapons if not used by other pylons

 

V1.33

  • Few tweaks and locality related stuff

 

V1.32

  • (HOTFIX) Fixed yet another variable error
  • Aircraft will no longer refuel beyond the point where they start leaking fuel
  • Aircraft damaged beyond 0.95 will not be refueled

 

V1.3

  • Added:(optional) Resource handling
    • Repairing, refueling and rearming will now deplete the resources of the respective vehicles
    • Mission makers can use functions mentioned above to add resources to vehicles, maybe as a reward for completing a mission or whatever comes to your mind
  • Added: The three digit serial (tail) number of the aircraft can be changed, if supported by the model (currently working on: Gryphon, Shikra and Black Wasp)
    • After selecting the aircraft enter the 3 digit number you want into the same field that's used to set the ammo amount for the pylons
    • Numbers like 5,6 are mirrored on the shirka, that's up on BI or the DLC dev to fix
  • Added: Pylon priority setting
    • Pylon priorities will be displayed in the info panel
    • Weapons on multiple pylons sharing the same priority will be listed as one weapon
    • Priority button usage:
      • LMB = Increase priority of currently selected pylon by 1
      • Shift+LMB = Decrease priority of currently selected pylon by 1
      • Alt+LMB = Set all pylons to the currently set priority
      • Ctrl+LMB = Set all pylons to priority 1
    • The priority will be set to the currently selected pylon when clicking the priority button
    • Selecting another pylon will display its current priority on the button
  • Added: Tons of functionality for the text display, loadout changes and resource changes will be displayed in realtime
    • Click on aircraft -> shows fuel/damage state, now also tracks kills made by the vehicle and successful landings
    • Click on pylon -> shows current loadout+ammo count for each pylon
    • Click on weapon -> shows installation details on what weapon will be installed on what pylon, who operates it and weapon details
    • Click on "Show Resources" Button -> will display all available supplies, their amounts and types, if the resource management is active
  • Upon closing the dialog all nearby supplies will display their current resource cargo value for 20 seconds
  • Added: Dedicated and local MP compatible example mission on how to set up the menu for players, objects and service zones
  • Changed: Weapon listbox is now sorting all weapons alphabetically
  • Changed: The aircraft loadout function will be reapplied upon respawn for players that are allowed to have it
  • Changed: Loadout menu can now be found in the communication menu if added to players (default: 0 - 8 - 1)
  • Changed: Rearming sound will be positional for each pylon
  • Changed: Rearming the plane will no longer empty all pylons, and just fill up the existing pylons instead
  • Changed: The menu now updates in real time, new planes within range will be displayed as soon as they are stationary and on the ground, same goes for resource vehicles if the option is enabled. So you no longer need to reOpen the dialog if any of these change
  • Fixed: Pylon loadout changes were not properly broadcast

 

V1.24

  • (HOTFIX) Fixed further dialog shenanigans (thanks @Teuf)

 

V1.23

  • (HOTFIX) Renamed the last remaining dialog parent classes, heh.

 

V1.22

  • (HOTFIX) Renamed dialog parents classes to prevent conflicts with other scripts (thanks @sarogahtyp), should fix any further compatibility issues with other scripts/mods

 

V1.21

  • (HOTFIX) Fixed error being unable to use repair/rearm/refuel with resource dependencies disabled (thanks @loopdk)
  • Changed the description.ext and cfgFunctions part to avoid issues with other scripts that are using this feature
  • Adjusted startup text info to be more clear if and which fuel/ammo/repair sources are nearby

 

V1.2

  • Added button to select who has control over the pylon (pilot or gunner)
  • Added customer presets saved individually for each vehicle for every player
    •  -Presets will be saved for each vehicle type, so you can equip multiple aircraft with the same loadout within a few clicks
    •  -Presets will contain the pylon loadout, ammo amount from each pylon, respective pylon owners (pilot, gunner) and the livery of the aircraft
    •  -Presets are stored in profileNamespace, so they'll persist everytime you use this loadout menu, no matter which server you're on
    •  -Delete button is locked by default, can only be used when holding CTRL to prevent mishaps
  • Added livery option, will change texture if the aircraft has any in the config
  • Added option to override the pylon compatibility check, yay 120 DAGR wipeout
  • Added option to make the presence of ammo/fuel/repair supplies necessary, no ammotruck? no fancy weapons!
  • Added duration to rearming an aircraft, fully rearming an empty 120 DAGR wipeout can take up to 2 minutes
  • Added duration to repairing an aircraft, default is set to 60s from 0 to 100% health
    •  -repair speed can be adjusted
  • Added duration to refuelling an aircraft, fillrate is set to 1800l/min as default and will be calculated accordingly (wipeout with 1000l fuel capacity will take 33s to refill to 100%)
    •  -refill rate can be adjusted
    •  -refuelling will abort when the aircraft is not stationary
    •  -you can only simultaneously refuel as much airplanes as you have fuel sources
  • Fixed 'clear all pylons' button now to properly remove all leftover weapon classes from the aircraft
  • Fixed 'rearm' button now to properly rearm all weapons, on board cannons, flare/chaff launchers
  • Adjusted text size
  • Improved the mission to give a quick 'demo'
  • Most likely some stuff I forgot


V1.1

  • Added compatibility check for magazines and pylons, so you can't add everything on every pylon.
  • Installing a pylon takes some time.
  • Added possibility to execute this for one pilot in a stationary aircraft or as an action from an ammo truck or whatever you'd like.
  • Added options for reporting and receiving of remote targets as well as reporting the aircrafts own position.
  • The 'clear all pylong' button now properly removes all pylons, no more leftovers

 

 

10.07.2021:

Added the file to google drive, so it should be permanent.

Also removed the armaholic link. RIP.

 

Enjoy

  • Like 39
  • Thanks 2

Share this post


Link to post
Share on other sites

That looks actually quite nice already. Could be something for our logistic buffs. ;)

Share this post


Link to post
Share on other sites

Glad Someone made this!!!

 

Could it be used in MP in its current state? 

Share this post


Link to post
Share on other sites
3 hours ago, Thunder.B said:

Glad Someone made this!!!

 

Could it be used in MP in its current state? 

Sure, just use the addAction in initPlayerLocal.sqf or/and onPlayerRespawn.sqf and either filter for UID or player names to add it to selected players only.

 

 

9 hours ago, belbo said:

That looks actually quite nice already. Could be something for our logistic buffs. ;)

Glad you like it. I'll probably adjust it so it can be added to an ammo truck and be run from there.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

This is great stuff and i ll surly put it in my servers mission.

Thx a lot for another nice feature.

  • Like 1

Share this post


Link to post
Share on other sites

Nice one Grumpy Old Man - thanks for sharing

  • Like 1

Share this post


Link to post
Share on other sites

Thanks, Great job.
I found pylon# on chatting msg does not match with pylon# of GOM Loadout Station menu. so <Clear all pylons> not clear all pylons. 

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, Grumpy Old Man said:

Sure, just use the addAction in initPlayerLocal.sqf or/and onPlayerRespawn.sqf and either filter for UID or player names to add it to selected players only.

 

 

Glad you like it. I'll probably adjust it so it can be added to an ammo truck and be run from there.

 

Cheers

I would love to see this added to an ammo truck.  I was about to try adding this to a little test mission I made for my unit to get used to all the new JETS sensors and planes.

I assume that the onPlayerRespawn.sqf is needed to re-init the scripts after players respawn?  And, unfiltered it would allow anyone to use the loadout editor?  We have a passworded server, so not a big problem fr everyone to have it.

 

Share this post


Link to post
Share on other sites
1 hour ago, magicsrp said:

Thanks, Great job.
I found pylon# on chatting msg does not match with pylon# of GOM Loadout Station menu. so <Clear all pylons> not clear all pylons. 

Fixed, thanks.

 

33 minutes ago, ski2060 said:

I would love to see this added to an ammo truck.  I was about to try adding this to a little test mission I made for my unit to get used to all the new JETS sensors and planes.

I assume that the onPlayerRespawn.sqf is needed to re-init the scripts after players respawn?  And, unfiltered it would allow anyone to use the loadout editor?  We have a passworded server, so not a big problem fr everyone to have it.

 

Already on it, expect an update later today.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites

Hi Grumpy Old Man

Been playing around with your script and love it!

Seems for the blackfoot that any altered loadouts are in the pilots control (I'm guessing it's the turret contol thing needing to be [0]) Could this be tweaked please?

 

thanks again

Share this post


Link to post
Share on other sites
8 hours ago, Grumpy Old Man said:

Sure, just use the addAction in initPlayerLocal.sqf or/and onPlayerRespawn.sqf and either filter for UID or player names to add it to selected players only.

 

 

Glad you like it. I'll probably adjust it so it can be added to an ammo truck and be run from there.

 

Cheers

Hello Grumpy Old Man,
i am not that long into Arma and scripting. Can you explain it a bit more to get it work for MP? What i also want to know is, if this work with Helicopters as well

 

Share this post


Link to post
Share on other sites

Awesome! good work making this less than a day after release, been adding it into our server, and we made a small edit to make it so players couldn't turn their engine off and glide over the rearm area, this also has the added effect of allowing the player to rearm their aircraft with the engine on while stationary in the rearm area (if your remove the !isEngineOn check) which is possible in games like DCS, and i assume IRL, this is what we added.

 

player addAction ["Aircraft Loadouts",{_start = [] call GOM_fnc_aircraftLoadout}, [], 0, false, false, "", "(speed player < 1)"];

 

Also a small bug: your array for setting weapons to pylon x starts at 1 instead of 0 meaning you can't change the weapons on pylon 1 (BI actually made this pylon 0) and pylon 12 on the black wasp. Because setting a gbu12 to pylon 1 in your GUI sets the gbu 12 onto pylon 2 (actually 1 because the array starts at 0). trying to work out a fix atm will post if i find one.

 

PS might be an idea to have a version that can just be added to an object in the editor like an ammo truck, seems unnecessary to have it running on a whitelist level for most groups or small groups of friends, just have an addaction the same way arsenals are done, that way it runs at a lower level and not on a loop, and if you do want "whitelisting" you can give certain players slots a variable name and include that in the add action so it only appears to players in that slot

 

eg how my group makes it so only zeus's can open the door to the armory room

 

this addAction ["<t color='#ee4e00' size='1.5'>Open Door</t>", "opendoor.sqf", [], 888, true, false, "", "((_target distance _this) <10 && _this==bis_curatorUnit)"];

Share this post


Link to post
Share on other sites

I know hardly anything about scripting but how would you get something like this to see addon weapons pack like Firewill's Aircraft Weapons Systems pack?

Share this post


Link to post
Share on other sites
11 minutes ago, Tac21 said:

I no hardly anything about scripting but how would you get something like this to see addon weapons pack like Firewill's Aircraft Weapons Systems pack?

Firewill and other modders need to update there aircraft to use BI's new "pylons" system first, then i imagine Grumpy Old Man or communities that use his mod will have to add in the magazine and vehicle classnames of mod vehicles or it might be able to grab an array of all available magazines.

  • Like 1

Share this post


Link to post
Share on other sites
34 minutes ago, SnakeDocc said:

"Quote"

 

eg how my group make it so only zeus's can open the door to the armory room

 

this addAction ["<t color='#ee4e00' size='1.5'>Open Door</t>", "opendoor.sqf", [], 888, true, false, "", "((_target distance _this) <10 && _this==bis_curatorUnit)"];

 

Thanks for this bit of Code still wrapping my head around SQF and i can use this on my current project!

 

9 hours ago, Grumpy Old Man said:

Sure, just use the addAction in initPlayerLocal.sqf or/and onPlayerRespawn.sqf and either filter for UID or player names to add it to selected players only.

 

 

Glad you like it. I'll probably adjust it so it can be added to an ammo truck and be run from there.

 

Cheers

 

I plan on having this on our public servers Rearm Pads so our pilots can customize Aircraft from a spawner. i will keep an eye out for your next version! 

 

  • Like 1

Share this post


Link to post
Share on other sites

Using this I'm noticing that weapons previously loaded will remain selectable while the ammo has been cleared using the clear pylon action.

Share this post


Link to post
Share on other sites

 

1 hour ago, Thunder.B said:

 

Thanks for this bit of Code still wrapping my head around SQF and i can use this on my current project!

I plan on having this on our public servers Rearm Pads so our pilots can customize Aircraft from a spawner. i will keep an eye out for your next version! 

 

2

 

No problem man, we also added this to our asor vehicle spawner but it could be added to this mod as well (3 checkbox's in your UI so people can choose their datalink options would be cool) to enable datalink on all the vehicles we spawn, because its off by default for some reason

 

_veh setVehicleReportRemoteTargets true;

_veh setVehicleReceiveRemoteTargets true;

_veh setVehicleReportOwnPosition true;

Share this post


Link to post
Share on other sites
2 hours ago, SnakeDocc said:

Also a small bug: your array for setting weapons to pylon x starts at 1 instead of 0 meaning you can't change the weapons on pylon 1 (BI actually made this pylon 0) and pylon 12 on the black wasp. Because setting a gbu12 to pylon 1 in your GUI sets the gbu 12 onto pylon 2 (actually 1 because the array starts at 0). trying to work out a fix atm will post if i find one.

2

Seemed to fix this on line# 119 by increasing the array selection by 1. Seems the pylon array starts at 1 and not 0.

Also need to change the "clear all pylons" index so its offset by 1 because of this.

 

This is the fixed version plus the removal of the isEngineOn check in favor of an isMoving check and changed it down to 30mm radius to avoid picking up other people's vehicles to much

https://pastebin.com/raw/fNXPticb

Share this post


Link to post
Share on other sites
2 hours ago, petek said:

Hi Grumpy Old Man

Been playing around with your script and love it!

Seems for the blackfoot that any altered loadouts are in the pilots control (I'm guessing it's the turret contol thing needing to be [0]) Could this be tweaked please?

 

thanks again

I'll look into it over the weekend.

 

2 hours ago, Justice Molton said:

Hello Grumpy Old Man,
i am not that long into Arma and scripting. Can you explain it a bit more to get it work for MP? What i also want to know is, if this work with Helicopters as well

 

Should work with choppers just fine.

Adding an explanation to the first post.

 

@SnakeDocc:

Removed the engine check and replaced it with a speed check.

Pylon bug has been fixed.

Also added an option to either use an ammo truck/object that receives the action, alternatively you can add the option to pilots inside the jets to use the loadout menu:

[vehicle player,"PILOT"] call GOM_fnc_addAircraftLoadout

Will instantly open the loadout menu, so up to you how to implement it (addAction, trigger, whatever)

 

2 hours ago, Tac21 said:

I no hardly anything about scripting but how would you get something like this to see addon weapons pack like Firewill's Aircraft Weapons Systems pack?

The function is reading all pylon compatible mags for the specific vehicle out of the config.

Up to the mod author to properly configure their aircrafts.

 

1 hour ago, Tac21 said:

Using this I'm noticing that weapons previously loaded will remain selectable while the ammo has been cleared using the clear pylon action.

No idea if there's a way to fix this, open to suggestions.

 

1 hour ago, SnakeDocc said:

 

 

No problem man, we also added this to our asor vehicle spawner but it could be added to this mod as well (3 checkbox's in your UI so people can choose their datalink options would be cool) to enable datalink on all the vehicles we spawn, because its off by default for some reason

 

_veh setVehicleReportRemoteTargets true;

_veh setVehicleReceiveRemoteTargets true;

_veh setVehicleReportOwnPosition true;

Added.

 

53 minutes ago, SnakeDocc said:

Seemed to fix this on line# 119 by increasing the array selection by 1. Seems the pylon array starts at 1 and not 0.

Also need to change the "clear all pylons" index so its offset by 1 because of this.

 

This is the fixed version plus the removal of the isEngineOn check in favor of an isMoving check and changed it down to 30mm radius to avoid picking up other people's vehicles to much

https://pastebin.com/raw/fNXPticb

Already fixed.

 

Update should be coming within the next hour.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, Tac21 said:

Using this I'm noticing that weapons previously loaded will remain selectable while the ammo has been cleared using the clear pylon action.

 

11 minutes ago, Grumpy Old Man said:

No idea if there's a way to fix this, open to suggestions.

1

 

Ok so you cant just remove weapons from the vehicle because the main gun, laser des and flares are considered "weapons". So I created a new array of each of the 'turrets' then removed the weapons from each of them.
 

private _pylonWeapons = [];
{ _pylonWeapons append getArray (_x >> "weapons") } forEach ([_veh, configNull] call BIS_fnc_getTurrets);
{ _veh removeWeaponGlobal _x } forEach ((weapons _veh) - _pylonWeapons);
 

Share this post


Link to post
Share on other sites

The ammo truck or object option would work with any object?

 

For example, helipad, huron container, or the USS Freedom itself?

 

Thanks,

Reed

Share this post


Link to post
Share on other sites
2 minutes ago, Jnr4817 said:

The ammo truck or object option would work with any object?

 

For example, helipad, huron container, or the USS Freedom itself?

 

Thanks,

Reed

For all I care you could attach it to a rabbit.

 

Cheers

Share this post


Link to post
Share on other sites
13 minutes ago, Grumpy Old Man said:

For all I care you could attach it to a rabbit.

 

Cheers

Now that is a great idea. ;)

Nice work BTW

Share this post


Link to post
Share on other sites

Where and how would I put this for a dedicated server so that it happens for any pilot who gets in the aircraft at the start of the mission and JIP?

 

Thanks,

Reed

 

Open the dialog instantly for a pilot that's inside a jet/chopper:

[vehicle player,"PILOT"] call GOM_fnc_addAircraftLoadout

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

×