Jump to content

Check if aircraft loadout is correct or not -- How do I implement this?


Recommended Posts

Posted

I am building a mission, where I want the player aircraft(Hornet) to carry a specific loadout (eg. 2xGBU38 on Stn. 7 + 2xCBU12 on Stn. 3) only. So if anyone else playing the mission changes the loadout in-game using Alt+('), he or she must check using the F10 menu if the loadout is correct for the mission. If not then mission will be a failure.

 

How do I implement this?

Rig - I7-9700K/GIGABYTE Z390D/RTX-2080 SUPER/32-GB CORSAIR VENGEANCE RAM/1-TB SSD

Mods - A10C / F18C / AV8B / Mig21 / Su33 / SC / F14B

Posted (edited)

This may be possible in a roundabout way in Lua. I've never done it, but you could, upon take-off, invoke Unit.getAmmo() on the player's unit and then match the returned values against the ammunition (missiels etc) you want them to fly with and fail on divergence.

 

I guess a better (or at least equally good) question is: why would you want to do that? You, as a mission designer already design the correct, best way to enjoy your mission. Why would you want to spend any effort to enforce your vision? What is the added value for you? Different people like different things. If someone likes your mission and wants to 'improve' it for their own taste, let them, no skin off your nose - you already have the best experience. The amount of time you would have to spend on enforcing your vision you can probably use for much more creative things. I wouldn't worry about it. IMHO of course 🙂

 

Edited by cfrag
Posted
1 hour ago, cfrag said:

This may be possible in a roundabout way in Lua. I've never done it, but you could, upon take-off, invoke Unit.getAmmo() on the player's unit and then match the returned values against the ammunition (missiels etc) you want them to fly with and fail on divergence.

 

I guess a better (or at least equally good) question is: why would you want to do that? You, as a mission designer already design the correct, best way to enjoy your mission. Why would you want to spend any effort to enforce your vision? What is the added value for you? Different people like different things. If someone likes your mission and wants to 'improve' it for their own taste, let them, no skin off your nose - you already have the best experience. The amount of time you would have to spend on enforcing your vision you can probably use for much more creative things. I wouldn't worry about it. IMHO of course 🙂

 

 

Correct on your side, but I had once been on a multiplayer server, couldn't remember which, where there was a method to check the correct loadout using the F10 menu. Otherwise they would state that your loadout was not legal or valid. I thought it was a cool feature. So wanted a process to implement it. Nothing more.

  • Like 1

Rig - I7-9700K/GIGABYTE Z390D/RTX-2080 SUPER/32-GB CORSAIR VENGEANCE RAM/1-TB SSD

Mods - A10C / F18C / AV8B / Mig21 / Su33 / SC / F14B

Posted (edited)

Well, in that case, you can do that by

- installing a callback to your check routine in the "F-10 Other..." menu with missionCommands.addCommandForGroup() - make sure you only have single-unit groups for the players, and install one such callback for each player group that needs the check. Pass the Unit/Group in the free parameter.

- in the check, retrieve the Unit from the free-form parameter and use Unit:getAmmo() and iterate the returned table against the list of ammo (and perhaps the quantities) that is appropriate. Since I haven't done this before I don't know if this will allow you to check the pylons that were used.

 

Cheers,

-ch

Edited by cfrag
Posted

I've hid my original post as mist.getPayload() only works for payloads created in the ME loadout and no "live" data can be gathered, My apologies. I also have never tried doing this before but would like to see something come of it as it would be something cool to see. I'll try working on something and see what I can come up with to help out. Thanks for the pointers cfrag.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...