Grumpy Old Man

[Release] GOM - Aircraft Loadout V1.22 Hotfix

88 posts in this topic

GOM_fnc_aircraftLoadout V1.22 (Hotfix)

 

by Grumpy Old Man

 

gg0DFPU.jpg

 

 

 

Features:

  • 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!

 

Read:

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 first six parameters of GOM_fnc_aircraftLoadoutInit.sqf to your liking, the comments tell you what each variable does.

 

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

[vehicle player,"PILOT"] call GOM_fnc_addAircraftLoadout

This way the pilot will only be able to modify the aircraft he's sitting in.

 

For usage on ammo trucks, flagpoles or rabbits:

[this] call GOM_fnc_addAircraftLoadout

This way any aircraft within 50m of the object can be modified by using the action attached to the object.

 

 

Planned:

Always open to suggestions.
 

 

 

V 1.22 Hotfix Download (no mission file included)

 

Known issues:

Loading a preset can sometimes not refill all ammo, gonna take a look into that.

Should be working fine other than that.

 

 

Changelog:

 

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

 

Spoiler

 

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

 

 

Enjoy

18 people like this

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
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

1 person likes this

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.

1 person likes this

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. 

1 person likes this

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

2 people like this

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 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?

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.

1 person likes this

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! 

 

1 person likes this

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

2 people like this

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