Arma 3
Not enough ratings
Custom Faction Randomization Function
   
Award
Favorite
Favorited
Unfavorite
Data Type: Mod
Mod Type: Editor Extension
File Size
Posted
126.394 KB
5 May @ 12:22am
1 Change Note ( view )

Subscribe to download
Custom Faction Randomization Function

Description
Have you ever wanted to make an absolutely atrocious militia faction or add some light randomization to your units when creating a faction?
Well… this is your answer! Custom Faction Randomization Function or “CFRF”

As a quick explanation this function is not my own work, this function was ripped straight out of the Community Factions Project so all the credit goes to them. All I did was single out the function and take away the requirements for anything CUP related so this function (AS FAR AS I'M AWARE) can be used with any combination of mods.

How to use:
In your factions Autogen locate the unit and replace their “init” with this-
—----------------------------------------------------------------------------------------------------------------------------------
init = "if (local (_this select 0)) then {_onSpawn = {_this = _this select 0;sleep 0.2; _backpack = gettext(configfile >> 'cfgvehicles' >> (typeof _this) >> 'backpack'); waituntil {sleep 0.2; backpack _this == _backpack};_loadout = getArray(configFile >> 'CfgVehicles' >> (typeOf _this) >> 'ALiVE_orbatCreator_loadout'); _this setunitloadout _loadout; [_this] call CFP_main_fnc_randomizeUnit; reload _this};_this spawn _onSpawn;(_this select 0) addMPEventHandler ['MPRespawn', _onSpawn];};";
—----------------------------------------------------------------------------------------------------------------------------------
Now insert this into the units equipment area (I put it under respawnMagazines[]) only input the probability type if you're going to use it, and if you use weapon probability you can't add attachments.

In the blanks insert the class name of your chosen equipment which you can extract from ace arsenal by using ctrl+C and pasting the class name into the “Blank” with ctrl+V.

You can also change the probabilities of stuff spawning in by changing the number, the higher it is the more likely it is to spawn.

randomGearProbability = 100;
randomweaponprobability = 100;

uniformList[] = {
"Blank", 0.90,
};

headgearlist[] = {
"Blank", 0.90,
};

facewearlist[] = {
"Blank", 0.90,
};

vestlist[] = {
"Blank", 0.90,
};

backpacklist[] = {
"Blank", 0.90,
};



riflelist[] = {
{"GUN",{"MAGTYPE",NUMBEROFMAGS}},
0.9,
};

handgunlist[] = {
{"GUN",{"MAGTYPE",NUMBEROFMAGS}},
0.9,
};

launcherlist[] = {
{"GUN",{"MAGTYPE",NUMBEROFMAGS}},
0.9,
};

(Most issues you have with this are likely syntax errors on your part, check your work before you complain!)
(ALL CREDITS GO TO CFP)
6 Comments
vina 20 Sep @ 4:22am 
Thank you so much, now i finally can do my Generial Southeast Asia Militia Faction
combat1017  [author] 19 Sep @ 7:46am 
Grenades and Medpacks im not too sure about.
JOSE TESTICULOS 16 Sep @ 6:39am 
:steamhappy:
JOSE TESTICULOS 16 Sep @ 6:38am 
how do you add grenades and medpacks?
combat1017  [author] 8 Sep @ 11:15am 
@Josef Terboven Gaming There is no way as far as I am aware to add attachments.
Sauce 12 Aug @ 3:14pm 
Yo, how would I setup attachments for weapons and also do you have a discord for easier communication? Might need some help setting this up for my ops.