TFAR radios and Custom loadouts.

Workshop for all Mission Engineer Comrades. Home of the FA Mission Making Template.
Post Reply
Davanseth
Posts: 12
Joined: Mon Nov 03, 2014 2:19 pm

TFAR radios and Custom loadouts.

Post by Davanseth »

Hi all,

Making my second mission atm, and have a problem with custom loadouts made with the A3 Arsenal. The backpack LR radios seem to work fine, but the SR radios are not appearing in its slot in game.
My question is why? And how to make work properly?

Thanks in advance guys, keep up the good work. :)

Davanseth
Posts: 12
Joined: Mon Nov 03, 2014 2:19 pm

Re: TFAR radios and Custom loadouts.

Post by Davanseth »

Anyone?

User avatar
wolfenswan
Posts: 1209
Joined: Wed May 25, 2011 4:59 pm

Re: TFAR radios and Custom loadouts.

Post by wolfenswan »

Hey Davanseth,

unfortunately we don't use TFR at Folk ARPS so I had to relay the question to those who do. Meanwhile you can also try posting the question on our github or /r/armaDev.

How are you assigned the custom loadouts exactly?

Davanseth
Posts: 12
Joined: Mon Nov 03, 2014 2:19 pm

Re: TFAR radios and Custom loadouts.

Post by Davanseth »

wolfenswan wrote:Hey Davanseth,

unfortunately we don't use TFR at Folk ARPS so I had to relay the question to those who do. Meanwhile you can also try posting the question on our github or /r/armaDev.

How are you assigned the custom loadouts exactly?
Very simple. I assigned the loadout in arma3 arsenal. Copied it in clipboard, and paste it in replacement of the assign gear script in the init of the unit. Everything worked fine except TFR radios and AGM bandages and earplugs. I can avoid this problem by adding boxes. But it doesn't seem right.
Thx for your reply anyway.
Cheers.

User avatar
wolfenswan
Posts: 1209
Joined: Wed May 25, 2011 4:59 pm

Re: TFAR radios and Custom loadouts.

Post by wolfenswan »

Ah if I'm not mistaken then the TFR and AGM components require F3 Assign gear to work correctly. Try modifying the unit types in F3 assign gear so they reflect your Arsenal-settings. If you paste your Arsenal-export here I can give you an example.

Davanseth
Posts: 12
Joined: Mon Nov 03, 2014 2:19 pm

Re: TFAR radios and Custom loadouts.

Post by Davanseth »

Ok. Gonna do that tomorrow when I'll get back home. Thx for your help.

Maybe something to work for a future release :lol:

Davanseth
Posts: 12
Joined: Mon Nov 03, 2014 2:19 pm

Re: TFAR radios and Custom loadouts.

Post by Davanseth »

Herre is an example of a loadout made with the Arsenal.


comment "Remove existing items";
removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;

comment "Add containers";
this forceAddUniform "MNP_CombatUniform_Ranger_A";
for "_i" from 1 to 3 do {this addItemToUniform "30Rnd_556x45_Stanag";};
for "_i" from 1 to 3 do {this addItemToUniform "AV_15Rnd_9x19_Mag";};
this addVest "MNP_Vest_M81b";
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
for "_i" from 1 to 3 do {this addItemToVest "30Rnd_556x45_Stanag";};
for "_i" from 1 to 3 do {this addItemToVest "30Rnd_556x45_Stanag_Tracer_Red";};
for "_i" from 1 to 4 do {this addItemToVest "1Rnd_HE_Grenade_shell";};
for "_i" from 1 to 3 do {this addItemToVest "1Rnd_Smoke_Grenade_shell";};
for "_i" from 1 to 2 do {this addItemToVest "1Rnd_SmokeRed_Grenade_shell";};
for "_i" from 1 to 2 do {this addItemToVest "1Rnd_SmokePurple_Grenade_shell";};
this addBackpack "tf_rt1523g_green";
for "_i" from 1 to 4 do {this addItemToBackpack "30Rnd_556x45_Stanag";};
for "_i" from 1 to 2 do {this addItemToBackpack "30Rnd_556x45_Stanag_Tracer_Red";};
for "_i" from 1 to 2 do {this addItemToBackpack "HandGrenade";};
this addHeadgear "H_Beret_Colonel";
this addGoggles "G_Lowprofile";

comment "Add weapons";
this addWeapon "RH_M4_ris_M203";
this addPrimaryWeaponItem "RH_compm4s";
this addWeapon "av_m9";
this addWeapon "Rangefinder_RU";

comment "Add items";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "tf_microdagr";
this linkItem "tf_anprc152_1";
this linkItem "ItemGPS";

I just copy/paste in the unit'init, like I said. I usualy erase the radio, because I know it wont apear in game.

User avatar
wolfenswan
Posts: 1209
Joined: Wed May 25, 2011 4:59 pm

Re: TFAR radios and Custom loadouts.

Post by wolfenswan »

As said, the assignGear component needs to run first for the radio replacement to work properly (as it checks for the unit-type such as "co" etc. to know which radio to give to whom).

It is pretty easy to convert the Arsenal export into assignGear though, for example if we'd assume the gear you posted would be for the unit-type "co":

Code: Select all

case "co":
{
_unit addmagazines ["30Rnd_556x45_Stanag",3];
_unit addweapon "RH_M4_ris_M203";
_unit addmagazines ["AV_15Rnd_9x19_Mag",3];
_unit addweapon "RH_compm4s";
_unit addmagazines [1Rnd_HE_Grenade_shell",4];
_unit linkItem "ItemGPS";
};
etc.
Uniforms and backpacks can be also adjusted/set up in assignGear.
Likewise if you use these weapons for multiplay layouts it makes sense to instead configure the variables at the beginning of the script (such as _rifle).
In the radio component you'd configure which radios the unit would get (detailed on the wiki).

On a side-note:
It's not advisable to do stuff like this in the unit init. The code in a unit's initialization field will run once for every client connecting (and the server) so if you'd have 10 players join your mission, the unit would actually be (re)equipped 11 times, which is wasteful and can cause desync. This might not seem that bad but imagine if you'd spawned 10 AI from the unit init, then you'd have 10 AI when testing for yourself but suddenly 110 in MP.

If you check at the top of the fn_assignGear.sqf file you'll see a local check. This means that the assignGear component will only continue to run where the unit "belongs" to, so either the individual player or in case of AI the server.

Davanseth
Posts: 12
Joined: Mon Nov 03, 2014 2:19 pm

Re: TFAR radios and Custom loadouts.

Post by Davanseth »

Thx for your answer Wolf. So if I understand correctly I take the custom loadouts (your code) and set it in the assign Gear blablabla .sqf? Is that right? Or I edit the loadout line by line.
Sorry if I mistaken. It is the way I understand it.

Anyway I thank you for your help.

Post Reply