Jump to content
POLPOX

Questions about Dynamic Loadout

Recommended Posts

I am trying to create my own in-game Dynamic Loadout script, and I have some problems. Are they possible?

  • Get Memory Point of a pylon either using index or pylon name.
  • Get magazine of a pylon from pylon name.
  • Get index from pylon name.
  • Get pylon name from index.

The feature is something... complicated and hard to use. Thank you in advice.

 

EDIT:

  • Use weapons properly after use animateBay.

Share this post


Link to post
Share on other sites

Sorry it's been so long for someone to reply to you. I was searching for a similar issue and happened upon your post. This is actually my first post on this forum, if I recall correctly. I don't frequent these forums much.

 

1. Are you asking for where a magazine would be placed on the model of the aircraft? Or are you asking for something like the "UIposition" parameter? (Which is used by EDEN to show you the approximate locations of the pylons.) It's late, so I'm not going to search for how to get you the former unless you tell me that's what you need. I can get you how to obtain the later, easily, however:

Spoiler

//"_uipos" is a positonal array ([x, y]) that will contain the location used by EDEN to show the appromixate location of pylons.
//"_classname" is a string containing the class name of the vehicle desired. For the black Kajman with dynamic loadouts (at the time of my posting) that would be, "O_Heli_Attack_02_dynamicLoadout_black_F".
//"_pylonname" is a string containing the class name of the pylon desired for the vehicle above. For the black Kajman with dynamic loadouts (at the time of my posting) this variable would equal one of the following: "PylonLeft1", "PylonLeft2", "PylonRight2", or "PylonRight1".
//Taken and modified from: https://community.bistudio.com/wiki/Arma_3_Vehicle_Loadouts

_uipos = getArray (configFile >> "CfgVehicles" >> typeOf (vehicle player) >> "Components" >> "TransportPylonsComponent" >> "Pylons" >> _pylonname >> "UIposition")]

 

2a. Getting the default magazine from a pylon can be done like this:

Spoiler

//"_magazinename" is a string that will contain the default magazine for the selected vehicle and selected pylon below.
//"_classname" is a string containing the class name of the vehicle desired. For the black Kajman with dynamic loadouts (at the time of my posting) that would be, "O_Heli_Attack_02_dynamicLoadout_black_F".
//"_pylonname" is a string containing the class name of the pylon desired for the vehicle above. For the black Kajman with dynamic loadouts (at the time of my posting) this variable would equal one of the following: "PylonLeft1", "PylonLeft2", "PylonRight2", or "PylonRight1".
//Taken and modified from: https://community.bistudio.com/wiki/Arma_3_Vehicle_Loadouts

_magazinename = getText (configFile >> "CfgVehicles" >> _classname >> "Components" >> "TransportPylonsComponent" >> "Pylons" >> _pylonname >> "attachment");

 

2b. To get the default magazines for ALL pylons on a vehicle:

Spoiler

//"_magazinenames" is an array of strings. Those strings will contain the default magazines for the selected vehicle below.
//"_classname" is a string containing the class name of the vehicle desired. For the black Kajman with dynamic loadouts (at the time of my posting) that would be, "O_Heli_Attack_02_dynamicLoadout_black_F".
//Taken and modified from: https://community.bistudio.com/wiki/Arma_3_Vehicle_Loadouts

_magazinenames = (configProperties [configFile >> "CfgVehicles" >> _classname >> "Components" >> "TransportPylonsComponent" >> "Pylons"]) apply {getText (_x >> "attachment")};

 

3. If you fetch the pylon names as immediately below, I believe they're returned in order. So, position 0 in the array would be pylon 1, position 1 is pylon 2, and so on. (I could be wrong on this, though. It's like, 2:30 AM when I'm posting this....so do some testing and forgive me if I'm wrong.)

Spoiler

//"_pylonnames" is an array of strings. Those strings will contain the names of each pylon for the selected vehicle below.
//"_classname" is a string containing the class name of the vehicle desired. For the black Kajman with dynamic loadouts (at the time of my posting) that would be, "O_Heli_Attack_02_dynamicLoadout_black_F".
//Taken and modified from: https://community.bistudio.com/wiki/Arma_3_Vehicle_Loadouts

_pylonnames = (configProperties [configFile >> "CfgVehicles" >> typeOf (vehicle player) >> "Components" >> "TransportPylonsComponent" >> "Pylons"]) apply {configName _x};

 

4. See #3. This is a reflexive relationship.

5. What are you using animateBay to do? I'm not sure how this relates to using weapons properly.... but a value of -1 with animateBay can be used to reset it to the default state of being handled by the engine. So, something like:

Spoiler

//Taken almost verbatim from: https://community.bistudio.com/wiki/animateBay
(vehicle player) animateBay ["pylonLeft1", -1];

 

 

Two final notes:

  1. Some people have already produced some pretty awesome Dynamic Loadout Scripts, too. (Available as of as of 9/27/2017 when I made this post.)
  2. I used local variables (they have underscores) in my examples. Change them to be global (remove the "_", though I don't see a good reason to do that for many of these variables) or make sure to make them private in your functions/scripts! (While his blog is still up, KillzoneKid's post about private variables is a great place to learn. His blog is still up, as of 9/27/2017 when I made this post.)
Edited by IceSword
Removed syntax highlighting from code segments, fixed an indexing/reference issue on my "bullets" added spoilers to code segments to reduce post length on first read. Then readded the code, as I accidentally deleted when initially adding the spoiler tags.

Share this post


Link to post
Share on other sites

Thank you for reply @IceSword.

After post the first I found some answers for these (and I didn't post it, my bad) but of course codes by you and every scripter are always happy and thankful for me and us.

 

BTW, few things.

 

1.

I mean

3 hours ago, IceSword said:

where a magazine would be placed on the model of the aircraft

this. Some say it is unable to achieve...

 

2.

It is achieved by:

(((getPylonMagazines _veh) select _pylonIndex - 1)

 

3 and 4.

It is achieved by the code you posted.

 

5.

I mean, after using animateBay (even if run as -1) the bay will never be opened (even if you fire a weapon inside the bay).

It is achieved by:

for "_i" from 1 to 10 do {
	_this animateBay [_i,-1,true] ;
} ;

but seems a bug don't you? Is this just only for me?

 

Once again, thank you and good night!

Share this post


Link to post
Share on other sites

1. In the limited research I've done this afternoon, it appears that's tied to a weapon's proxy. I think proxies are baked into the model, but someone more knowledgeable on models/engine behavior would have to tell you. I've never delved into the realm of models in ARMA.

2. My bad! I was thinking you wanted the default magazines. (I think was a bias introduced because of something I was searching for.) Glad you found out how to do what you wanted to!

3. & 4. Awesome.

5. Yep seems to be bugged, my bad. It seems to have been bugged since the release of the Jets DLC, too. There are two bug reports that have yet to be acknowledged by BI. #1. #2. You could try posting another bug report here or bringing more attention to those bugs since they seem to have been ignored.

Share this post


Link to post
Share on other sites

I am finding lots of issues with GOM's Loadout Script. I really wish BIS had implemented a vanilla UI for this when they brought it out. So farking annoying that they didn't. If you need a beta tester let me know.

Share this post


Link to post
Share on other sites
On 2017/12/15 at 2:42 PM, ozdeadmeat said:

I am finding lots of issues with GOM's Loadout Script. I really wish BIS had implemented a vanilla UI for this when they brought it out. So farking annoying that they didn't. If you need a beta tester let me know.

It was just an experimental project so...

Do you want that?

Share this post


Link to post
Share on other sites

POLPOX, dude that looks freaking awesome. I have a few questions.

Does it work in Multiplayer?

Does it work with all Dynamic Loadout Vehicles?

Does Night Vision work for night missions in that view?

 

Scope Creep(In order of priority)(must be multiplayer compatible, happy to help with testing and multiplayer code)

Is there an ability to save loadouts and recall them?

Can you add a black/white list capability to ban particular ordnance?

Can there be a vehicle variable that can be set to Ammo Trucks to over time drain the vehicle of Ammo, something that could be switched between cargoAmmo and a separate vehicle variable depending on the desires of the mission maker? (it would need to return values of weaponry if it is being de-racked)

Can there be all the cosmetic options similar to Virtual Garage, things like Textures and/or parts for the vehicles? (the MH-6 used to have a bunch of bits like side seats that you could take off)

Can there be an option to change the aircraft and the Number / numberplate?

 

I am OzDeaDMeaT on Steam, feel free to add me if you wish to collaborate.

Share this post


Link to post
Share on other sites

@ozdeadmeat

  1. The script was passed its local-multiplayer test, so yes.
  2. Yes, should be.
  3. Not added yet and should be.

 

  1. No, but it is a nice feature though, it'll take much time to implementation.
  2. Yes.
  3. I can't get what do you want to say.
  4. No, and should not be.
  5. No, and should not be.

The script is not developed for months because it completed its role, skills improve but I'll work some if you'd like.

Share this post


Link to post
Share on other sites
5 hours ago, POLPOX said:

The script is not developed for months because it completed its role, skills improve but I'll work some if you'd like.

Dude that would be awesome.  Even if I could get what you have to start with I would be very grateful

Share this post


Link to post
Share on other sites
On 1/26/2018 at 8:48 PM, POLPOX said:

@ozdeadmeatIf you are interested this yet, work-in-progress version is now ready for your use.

https://drive.google.com/open?id=1WIAzgTO7Lq96glKtZxV5Vfr5YoB3L-O7

See what's inside for description.

Mate that is truely excellent. Is there a way to allow players to change the livery (Texture) and Wing Number also?

Share this post


Link to post
Share on other sites
5 minutes ago, ozdeadmeat said:

Mate that is truely excellent. Is there a way to allow players to change the livery (Texture) and Wing Number also?

As I said that's negative. This should be dedicated and focused on loadouts. Livery and numbers are cannot be changed on a frontline.

  • Like 1

Share this post


Link to post
Share on other sites

Hey just wanted to give some local feedback about your dynamic loadout script - been trying to get it working in a dedicated MP server environment with a milsim modset (RHS, ACE, etc) and it doesn't seem to be working. Testing in non-dedicated local multiplayer has it working just fine though; unsure as to what could be causing the issue. Was looking at trying to build and implement a script that used the existing vanilla loadout framework then I happened upon this thread! I would be willing to help test and lend server resources to help debug the issue as well - my Steam profile is http://steamcommunity.com/id/SkyeGuy63/

Share this post


Link to post
Share on other sites

Thank you for report @SkyeGuy . I am assuming the occasion and trying to solve this problem but before that, can you try to activate the script via init.sqf?

Like:

_nil = ["init",<ammobox>] execVM "plp_loadout.sqf" ;

/*Something server-side script*/

Make sure it is running on any server/client.

 

If my anticipation is correct, this will run as well.

Share this post


Link to post
Share on other sites

I have / had the following in the server's standard "init.sqf" file:
 

// ------------------ PLP Vehicle Loadout Script Init -----------------------

PLP_fnc_loadout = "plp_loadout.sqf" ;

//player setVariable ["plp_loadout_authorized",true] ;
//_nil = ["init",a] execVM "plp_loadout.sqf" ;
//_nil = ["init",b] execVM "plp_loadout.sqf" ;
{_x allowDamage false} forEach [vehicle player,player] ;

I basically just copied/pasted from your template mission this line of code from the init field in your ammo truck: <_nil = ["init",this] execVM "plp_loadout.sqf">
and pasted it into the desired vehicle that I wanted to contain the Arsenal (in this case the standard HEMTT Ammo Truck).

Everything is working in non-dedicated MP. I'm assuming that I need to re-enable the 

//_nil = ["init",a] execVM "plp_loadout.sqf" ;
//_nil = ["init",b] execVM "plp_loadout.sqf" ;

lines of code, and define what "a" and "b" are?

Do I need to better define the "ammobox" to say "if this class of vehicle [say HEMTT Ammo] then = a"? Not entirely sure what to do here.

Thanks for the feedback, sorry for the super late reply.

Share this post


Link to post
Share on other sites

Sorry for late, and yes, define a and b as a Fighter and an ammobox. The script will execute depending on passed object, so no need to think carefully.

 

Since many months were passed, I don't know how should I deal with this script. I am not currently working with this. Maybe I should remake this.

Share this post


Link to post
Share on other sites

Ok, so noob question - how do I properly define "a" and "b" as a Fighter / Ammobox?

Share this post


Link to post
Share on other sites
13 hours ago, SkyeGuy said:

Ok, so noob question - how do I properly define "a" and "b" as a Fighter / Ammobox?

Just name it via Attributes.

Share this post


Link to post
Share on other sites

I have the following:

 

_nil = ["init",Vehicle_Rearm_1] execVM "plp_loadout.sqf" ;  // Where Vehicle_Rearm_1 is the HEMTT Ammo
_nil = ["init",Fighter_1] execVM "plp_loadout.sqf" ; // Where Fighter_1 is a F-18X Black Wasp

 

Still not working in a dedicated server MP environment. Tested and it works fine in local MP.

I also enabled the following line:

 

player setVariable ["plp_loadout_authorized",true] ;

 

(To see if having it commented out could be the issue, but no dice either way). Not sure if I'm doing things wrong or if there is something else happening. Thanks for the help and assisting me as well - it's greatly appreciated.

 

Share this post


Link to post
Share on other sites
10 hours ago, SkyeGuy said:

Still not working in a dedicated server MP environment. Tested and it works fine in local MP.

Uh-oh. Maybe I missed something at addAction. BIKI says it don't working on dedicated.

https://drive.google.com/file/d/1u-q_NPA0B_wuehxakNgOZ-SOnNw8CboM/view?usp=sharing

I don't know this will run as well but... please test this. Make sure everyone is running this script.

Share this post


Link to post
Share on other sites

I love this idea so much, but I'm a modding noob and haven't done much with compiling mods together.  That said, I've been working on-and-off on a casual-ish DUWS compliation of symmetrical/asymmetrical scenarios that's not dependent on any other mod to work, and would love to include your work.  Unfortunately, most of what I've been haphazardly slapping together have been functions already present in various DUWS versions (countersniper missions from the RHS version; Modiefied's revival/carry system; suicide bombers, reputation, and civilian presences from Godis' ISIS version, etc).  I haven't added in anything from an entirely separate mod before and don't really know how.

 

A few maybe-simple, maybe-not questions

 

1) If I wanted to insert the functionality of this mod into DUWS, could you give me any tips on implementation? 

 

2) Is it possible to make the a and b variables apply to a variety of planes or helos (to help with the 'dynamic' nature of the campaigns), or is your scripting focused on only one vehicle at a time?  I can probably work around that if I have to.

 

3) Most importantly, do you mind if I do this at all?  I know DUWS is kind of outdated, but I like it for localMP and SP casual gaming, and I know a few others who use it similarly, and I'd like to be able to offer something to the A3 community.

Share this post


Link to post
Share on other sites

I have no idea about DUWS though, you can do anything with my free works. I won't claim something. If you wish to do, please add me in your credits.

 

But, you can't expect my support. Notice this again, this is not an officially released project.

Share this post


Link to post
Share on other sites

Sorry for being two months late, but is this script available yet? I really like the way it looks, I tried the experimental version that was up for download but I couldn't figure out how to get it to work with attack UAVs (greyhawk, k40, etc)

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

×