Jump to content
jshock

Shock's Redressing Script

Recommended Posts

Hello Arma Community,



I present to you:

Shock's Redressing Script

Short Description:

This script allows for a mission developer to essentially dress units to his/her liking, from insurgent armies, to just about anything. This script is, as far as testing can tell, mod friendly all you need are the classnames.

*Confirmed compatiblity with Zeus and EOS systems.

Special thanks to:

Cuel - Script code

Dwringer - Script code

Larrow - Script Code

JCae2789 - Testing (v1.5b)

Usage:

Place the JSHK_Redress folder in your mission file.

Parameters for the script are as follows:

1- Side - (EAST, WEST, CIV, INDEPENDENT) (default: EAST)
2- Use of special units- (true/false) (default: true)
3- Check for spawned units- (true/false) (default: false)

Example call lines for your init.sqf:

//For only on mission start (one time redress)
null = [EAST, true, false] execVM "JSHK_Redress\redressInit.sqf";

//For continuous checking to redress any "spawned" units
null = [EAST, true, true] execVM "JSHK_Redress\redressInit.sqf";

Place the follwing in the descripting.ext file:

class CfgFunctions
{
#include "JSHK_Redress\cfgfunctions.hpp"
};

Then the fun part, filling out the gear and other arrays.

First go into the JSHK_Redress folder, and open the file named redressInit.sqf.

Within that you will see blocks of code exampled below:

//Need to exclude certain units/groups, fill out the below arrays!
//-----------------------------
_indvUnitExclude = [indv1, indv2];//<<Put individual unit's variable names here.
_grpUnitExculde = [grp1];//<<Put the group leaders' variable names here.
_factionExclusion = ["rhs_faction_msv"];//<<Put faction classnames here (can be obtained using the "faction" command on a unit)
                                       //https://community.bistudio.com/wiki/faction
//-----------------------------


//Gear classnames go below!
//-----------------------------
JSHK_weaponArr = ["LMG_Zafir_F","arifle_Mk20_F"];
JSHK_uniformArr = ["U_IG_Guerilla3_1","U_IG_Guerilla3_2","U_IG_Guerilla1_1","U_IG_Guerilla2_1","U_IG_Guerilla2_2","U_IG_Guerilla2_3","U_IG_leader"];
JSHK_vestArr = ["V_BandollierB_khk", "Vest_V_BandollierB_rgr", "Vest_V_Chestrig_rgr"];
JSHK_headArr = ["H_Shemag_olive","H_ShemagOpen_khk","H_ShemagOpen_tan"];
JSHK_goggleArr = [""];
JSHK_backpackArr = ["B_FieldPack_cbr","B_OutdoorPack_tan"];
//-----------------------------


//Special Units Classnames
//-----------------------------
JSHK_ATunits = ["O_Soldier_AT_F","I_Soldier_AT_F","B_Soldier_AT_F"];
JSHK_Medicalunits = ["O_medic_F","I_medic_F","B_medic_F"];
JSHK_AAunits = ["O_Soldier_AA_F","I_Soldier_AA_F","B_Soldier_AA_F"];
//-----------------------------

In the block of code regarding exclusion, any units or factions that you don't want to be redressed

place them in one of the three arrays provided.

In the block that says "Gear classnames go below!", place all the gear in their respective arrays,

default gear is a vanilla insurgent look.

In the block entitled "Special Units Classnames", these are your support units, currently supported

are AT, AA, and medical, just place the classname of these units in the array (can be mod units).

(You can alter these specific loadouts in the JSHK_Redress\fn_Redress.sqf file, PM me for questions in that regard)

Download:

news_download_a3_3.png

Changelog:

v1.5.2

>>Added functionality to exclude factions of a certain side (so some factions are/are not redressed).

v1.5.1

>>Fixed variable name error on special unit arrays in redress process causing script to not work.

v1.5b(BETA)

>>Added parameter for script support with systems such as MCC/Zeus/EOS/etc. (essentially when units are spawned during mission play time)

>>Script structure (moved to file functions)

>>Added the ability for user to define special unit (AT, AA, Medical) classnames

>>Removed capability to add grenades via the call line (can be altered in the JSHK_Redress\fn_Redress.sqf file)

v1.2

>>Added "exclusion" capability of individual or groups of units, so that they are not redressed.

v1.17.1

>> Added a goggles array for more redressing options.

v1.17

>>Fixed the uniform not being "redressed" issue.

v1.15

>>Added the option to redress "special" units (AT,AA,CLS) with proper gear (launchers, medikits), based on classname of the unit.

>>Added the option to provide grenades to units.

>>Added a vest array, the same as the other gear arrays given.

v1.1

>> Made it side dependent, not individual units.


Example/shared loadout profiles for the script (please post yours :D ):

Using CAF Aggressors Mod, adding militaristic features (chestrigs, etc.):

JSHK_ATunits = ["CAF_RPG7"];
JSHK_Medicalunits = [];
JSHK_AAunits = ["CAF_STRELA"];

JSHK_backpackarr = ["B_FieldPack_cbr","B_OutdoorPack_tan",""];

JSHK_weaponarr = ["CAF_AK74","CAF_AK74GL","CAF_PKM","CAF_RPK74","CAF_SVD"];  //CAF

JSHK_uniformarr = ["U_CAF_AG_ME_ROBES_01","U_CAF_AG_ME_ROBES_01a","U_CAF_AG_ME_ROBES_01a","U_CAF_AG_ME_ROBES_01b","U_CAF_AG_ME_ROBES_01c","U_CAF_AG_ME_ROBES_01d","U_CAF_AG_ME_ROBES_02","U_CAF_AG_ME_ROBES_02a","U_CAF_AG_ME_ROBES_02b","U_CAF_AG_ME_ROBES_02c","U_CAF_AG_ME_ROBES_03","U_CAF_AG_ME_ROBES_03a","U_CAF_AG_ME_ROBES_03b","U_CAF_AG_ME_ROBES_03c","U_CAF_AG_ME_ROBES_03d","U_CAF_AG_ME_ROBES_04","U_CAF_AG_ME_ROBES_04a","U_CAF_AG_ME_ROBES_04b","U_CAF_AG_ME_ROBES_04c","U_CAF_AG_ME_ROBES_04d","U_CAF_AG_ME_ROBES_mil_01","U_CAF_AG_ME_ROBES_mil_01a","U_CAF_AG_ME_FATIGUES_01","U_CAF_AG_ME_FATIGUES_01a","U_CAF_AG_ME_FATIGUES_01b","U_CAF_AG_ME_FATIGUES_01c","U_CAF_AG_ME_FATIGUES_01d"];  //CAF

JSHK_headarr = ["H_CAF_AG_TURBAN","H_CAF_AG_PAKTOL","H_CAF_AG_PAKTOL_01","H_CAF_AG_PAKTOL_02","H_CAF_AG_PAKTOL_03","H_CAF_AG_WRAP"];  //CAF

JSHK_vestarr = ["V_BandollierB_khk", "Vest_V_BandollierB_rgr", "Vest_V_Chestrig_rgr"];

JSHK_gogglearr = [""];

Edited by JShock
  • Like 2

Share this post


Link to post
Share on other sites
Guest

Thanks a lot for informing us about the new release and sorry for the delay.

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account (JShock) on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

** Note:

since this is a project on which more people are working we will contact you in the future to discuss how you want this to be setup on Armaholic.

Share this post


Link to post
Share on other sites

So this will add a 'change uniform' option to the action menu that allows you to alternate between the different unit classname that you define in the script?

Would there be a way to get the script to call kind of like V.A.S. does or the MCC box generator, where it somehow segregates everything into its respective categorys, so that one could have it load all included uniforms that are in the mission?

Share this post


Link to post
Share on other sites

There is not a "change uniform" option that shows up in the action menu, and the script calls whatever classnames of uniforms/weapons/headgear/backpack that you put into the arrays given.

For example in this section of code:

//The array earlier defined below.
{
if (typeOf _x == "O_Soldier_F") then {	//"O_Soldier_F" can be replaced with any unit's classname, but then every unit with that classname will "redress".
	_units set [count _units, _x];
};

} foreach allunits;

The "O_Soldier_F" is the classname of the unit that is placed down in the editor, and at the initialization of the mission the unit is "changed" into clothes and weaponry as defined by the arrays here:

_backpackarr = ["B_FieldPack_cbr","B_OutdoorPack_tan"];
//		^-- Fill this with all the classnames of backpacks you would like to have chosen.

_weaponarr = ["LMG_Zafir_F","arifle_Mk20_F"];
//		^-- Fill this with the weapon classnames you would like to use.

_uniformarr = ["U_IG_Guerilla3_1","U_IG_Guerilla3_2","U_IG_Guerilla1_1","U_IG_Guerilla2_1","U_IG_Guerilla2_2","U_IG_Guerilla2_3","U_IG_leader"];
//		^-- Fill this with the uniform classnames you would like to use.

_headarr = ["H_Shemag_olive","H_ShemagOpen_khk","H_ShemagOpen_tan"];
//		^-- Fill this with the headgear classnames you would like to use.

Now within the [ ] you can place every type of uniform/weapon/headgear/backpack that you want to be "changed" on the unit placed in the editor, and the script chooses randomly what goes on each of those units (units being every "O_Soldier_F") placed in the editor.

So in short, it is not like VAS or MCC in which it segregates on its own, however, it is you, the developer, segregating the items included in the redress through the arrays as exampled above.

Does this answer your questions?

Edited by JShock

Share this post


Link to post
Share on other sites

I got it to work, and it's very easy to use, and I've been looking for a thing like this since the fall of the ottoman empire.

But just one question; how can I get it to work on a mission where opfors spawn later and on sidemissions? I am not that good at this.

Share this post


Link to post
Share on other sites
I got it to work, and it's very easy to use, and I've been looking for a thing like this since the fall of the ottoman empire.

But just one question; how can I get it to work on a mission where opfors spawn later and on sidemissions? I am not that good at this.

Slampemil, I have also had this point brought to my attention within my regiment, and the only thing we could think of was to have it execute the script everytime the "spawn" occured, we also thought it would be very taxing to the server if this was the insurgency game mode, due to a high number of "spawning" situations, however, if your mission/scenario isn't like that you should be able to simply add the init line above to whatever trigger you have that spawns the enemies, and putting this afterwards should work nicely.

If it does execute too quickly though you could simply put a sleep ***; command where *** is the time it takes all your units to spawn in (time in seconds btw) and put this at the very top of the code, above the info section to make it easy.

Hope this answered your question, and if you need some more examples just let me know, but there might be a future version of this script that supports the spawn in feature.

---------- Post added at 16:54 ---------- Previous post was at 16:36 ----------

Thanks, sounds like a nifty script.

Thanks Katipo, love the emoticons too ;).

Edited by JShock

Share this post


Link to post
Share on other sites
Slampemil, I have also had this point brought to my attention within my regiment, and the only thing we could think of was to have it execute the script everytime the "spawn" occured, we also thought it would be very taxing to the server if this was the insurgency game mode, due to a high number of "spawning" situations, however, if your mission/scenario isn't like that you should be able to simply add the init line above to whatever trigger you have that spawns the enemies, and putting this afterwards should work nicely.

If it does execute too quickly though you could simply put a sleep ***; command where *** is the time it takes all your units to spawn in (time in seconds btw) and put this at the very top of the code, above the info section to make it easy.

Hope this answered your question, and if you need some more examples just let me know, but there might be a future version of this script that supports the spawn in feature.

---------- Post added at 16:54 ---------- Previous post was at 16:36 ----------

Thank you so much for the quick reply JShock.

Unfortunately the mission I wanna implement the script in, is kind of like a insurgency game mode and runs in on my local dedicated server just for me and a friend.

I'm very new to scripting and stuff, but do you think it's possible to make a big ass trigger over the whole map, and make it trigger the script if opfor is present?

And I'm swede, so my english grammar is a bit bad. =)

Share this post


Link to post
Share on other sites

Yeah if it's just you and your friend a big ass trigger should do just fine, make it OPFOR present and either put in a timeout of 30+ seconds on the trigger itself or put the sleep command on as I had stated before within the script, if your up for trying your hand at it :D. Now you may experience some lag spikes depending the number of units it needs to redress, but it should be completed quickly, and shouldn't affect gameplay too much overall though.

Share this post


Link to post
Share on other sites
Yeah if it's just you and your friend a big ass trigger should do just fine, make it OPFOR present and either put in a timeout of 30+ seconds on the trigger itself or put the sleep command on as I had stated before within the script, if your up for trying your hand at it :D. Now you may experience some lag spikes depending the number of units it needs to redress, but it should be completed quickly, and shouldn't affect gameplay too much overall though.

A big ass trigger did just fine! Thank you JShock!

But now I may be stupid, but how can I make it change uniforms on more opforsoldiers? I tried like; if (typeOf _x == "O_Soldier_F","O_sniper_F")then, but that did not help at all. Like I said, I suck at this.

Share this post


Link to post
Share on other sites

Yeah I actually did try this myself before the release, in many different ways, but found no luck. I believe it is just the code itself that doesn't allow it. Now if you look into your "insurgency" script or whatever it is that is giving you your spawned enemies and look for an array similar to mine above, but instead has the 20+ classnames of all the OPFOR units and then limit it to just this one classname, it may work (just make sure to make a backup of the mission file before doing so :P). And because arrays are funny as well, you may have to leave in one extra classname and have the occasional non redressed guy, but give me today and maybe a little of tommorow and I may have the ability to allow multiple units in that line of code.

Share this post


Link to post
Share on other sites

Try this:

{
if ((typeOf _x == "O_Soldier_F") || (typeOf _x == "O_sniper_F")) then {	
	_units set [count _units, _x];
};

} foreach allunits;

Just replace the entire if/then/foreach statement with this.

Share this post


Link to post
Share on other sites
Try this:

{
if ((typeOf _x == "O_Soldier_F") || (typeOf _x == "O_sniper_F")) then {	
	_units set [count _units, _x];
};

} foreach allunits;

Just replace the entire if/then/foreach statement with this.

Oh my god. I love you. Now I just have to try it on my dedicated server and try to find out how to put the sleep command in on the spawning. But it's just one mission at the time, so maybe it will work. Thank you. if you ever come to Sweden I'll buy you a beer.

Share this post


Link to post
Share on other sites

I might just take you up on that :p.

Share this post


Link to post
Share on other sites
I might just take you up on that :p.

You are welcome! But it's snowing like a clusterfuck at the moment. =P

One thing, then I will stop woth my stupid questions.. Can you make it like

if ((typeOf _x == "EAST")

I've been trying to alter the code myself, but I have no programming skills what so ever. =)

Share this post


Link to post
Share on other sites

You were close:

if (side _x == EAST)

Share this post


Link to post
Share on other sites
You were close:

if (side _x == EAST)

By Odins beard.. I think I love you. It works perfectly in the editor.. Now just hope it works on the dedicated. If it does, I'm gonna kiss you.

Share this post


Link to post
Share on other sites

****UPDATE****

Current Version - 1.1

Previous Version - 1.0

>> Made it side dependent, not individual units.

Share this post


Link to post
Share on other sites
Guest

Thanks a lot for informing us about the updated release :cool:

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account (JShock) on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

** Note:

since this is a project on which more people are working we will contact you in the future to discuss how you want this to be setup on Armaholic.

Share this post


Link to post
Share on other sites

I'm still trying to figure out how to get it to work with scripts like EOS or the one they use in this mission http://forums.bistudio.com/showthread.php?168315-A3-Patrol-Operations-Official-Thread ..

But otherwise I love it, and it works perfectly with @mas and addons like that! I owe you a beer, but the kiss will come as soon as I figure out the spawn shit. =)

Share this post


Link to post
Share on other sites

You could just try and trigger encompassing the entire map, without a timeout on it, and have OPFOR present as the confition and the exec line in the activation field and I would think it would work, but I have no idea how taxing this would be on a server, if there were enough people in different areas activating a lot more "squares" or AOs would be worse than a lot of people in one area.

Share this post


Link to post
Share on other sites

Future version will include:

a way to arm units with special weapons (AT, AA) and medics as well :party:

Share this post


Link to post
Share on other sites

this is freaking awesome. what a great idea.

i'm using your mission script as a guideline while learning this. is there not a vest array? and how would i add first aid packs and grenades back to blufor?

edit- also, if i want to add the chance of nothing to spawn in the array (ie no helmet or pack) then what would I place in the field?

edit#2- figured it out, add empty quotes [""]; it will say bad vehicle type, but it works

Edited by DirtyDel
additional question

Share this post


Link to post
Share on other sites
this is freaking awesome. what a great idea.

i'm using your mission script as a guideline while learning this. is there not a vest array? and how would i add first aid packs and grenades back to blufor?

edit- also, if i want to add the chance of nothing to spawn in the array (ie no helmet or pack) then what would I place in the field?

edit#2- figured it out, add empty quotes [""]; it will say bad vehicle type, but it works

Thanks Del,

To answer your question, there is not a vest array in the script, mainly because my original idea was mainly for making the "insurgent" look, and they are pretty limited on vests in my mind. But below I have included a vest array, same as all the others, I have also added in an "addmagazine" line for your grenades, which you can define the class and number of them that you would like, same with the FAKs (look for the line with //****************// next to them). For each type of grenade you would like just copy and paste this line and change the class and value to your liking.

This is just a temporary fix to get what you are looking for, but are some great points and will be added into the next update of the script.

Thanks for the information, and hope this helps!


/*////////////////////////////////////

Script by the Development Team of the Arma 3 Community, Joint Specialized Regiment (J-SERE)

Open to editing and public use!!!

BIG THANKS to Cuel and Dwringer for help in the making of this script!

See more of J-SERE at http://www.j-sere.com


*///////////////////////////////////

/*
To use the J-SERE Redress Script:

1. Place: null = [] execVM "jsere_Redress.sqf"; --in the init.sqf
2. Fill in all the arrays within the script to your liking (works with mods, that's right, mods).
3. Decide on the side you want to be "redressed" and place it in the init line above.
-WEST (null = [WEST] execVM "jsere_Redress.sqf";)
-EAST (null = [EAST] execVM "jsere_Redress.sqf";)
-RESISTANCE (null = [RESISTANCE] execVM "jsere_Redress.sqf";) (aka Independents, AAF)
-CIVILIAN (null = [CIVILIAN] execVM "jsere_Redress.sqf";)

4. Enjoy your insurgent army, or whatever you may be redressing and rearming units for.
*/

_faction = (_this select 0);

_units = []; //empty array, defined later

_backpackarr = ["B_FieldPack_cbr","B_OutdoorPack_tan"];
//		^-- Fill this with all the classnames of backpacks you would like to have chosen.

_weaponarr = ["LMG_Zafir_F","arifle_Mk20_F"];
//		^-- Fill this with the weapon classnames you would like to use.

_uniformarr = ["U_IG_Guerilla3_1","U_IG_Guerilla3_2","U_IG_Guerilla1_1","U_IG_Guerilla2_1","U_IG_Guerilla2_2","U_IG_Guerilla2_3","U_IG_leader"];
//		^-- Fill this with the uniform classnames you would like to use.

_headarr = ["H_Shemag_olive","H_ShemagOpen_khk","H_ShemagOpen_tan"];
//		^-- Fill this with the headgear classnames you would like to use.

_vestarr = [];//put your vest classnames here

{

if (side _x == _faction) then { _units set [count _units, _x];};

} foreach allunits;

//The redressing process...

if (isServer) then {

{

_backpack = _backpackarr call BIS_fnc_selectRandom;
_uniform = _uniformarr call BIS_fnc_selectRandom;
_head = _headarr call BIS_fnc_selectRandom;
_vest = _vestarr call BIS_fnc_selectRandom;
_weapon = _weaponarr call BIS_fnc_selectRandom;
  	_muzzles = getArray(configfile >> "cfgWeapons" >> (_weapon) >> "muzzles"); 
       _unit = _x;

_x unassignItem "NVGoggles_OPFOR";
_x unassignItem "NVGoggles";
_x unassignItem "NVGoggles_INDEP";
clearItemCargo _x;
clearWeaponCargo _x;
clearMagazineCargo _x;
removeallWeapons _x;
removeAllHandgunItems _x;
removeHeadgear _x;
removeGoggles _x;
removeUniform _x;
removeBackpack _x;
_x addBackpack _backpack;
_x addHeadgear _head;
_x addUniform _uniform;
_x addVest _vestarr;
_x addMagazine ["GrenadeHand", 3]; //*********************//
       _x addItem ["FirstAidKit", 3]; //******************//

  	 { 
      		 if (_x=="this") then {
		_mags = getArray(configfile >> "cfgWeapons" >> (_weapon) >> "magazines"); 
		{ 
			_unit addMagazines [_x, 10]; 
		} forEach [_mags select 0]; 
	} 
	else { 
		_mags = getArray(configfile >> "cfgWeapons" >> (_weapon) >> _x >> "magazines"); 
		{
				_unit addMagazines [_x, 10]; 
           	} forEach [_mags select 0]; 
        	}; 
   	 } forEach _muzzles;  

_x addWeapon _weapon;

} foreach _units;

};

Share this post


Link to post
Share on other sites

this seems to have broke it. only the squad leader is spawning with the redress. everyone else is vanilla.

jshock im using EOS as well. i want to try the super-sized trigger. what do i need to put in the trigger exec line?

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

×