Jump to content

Problem with gear and units randomization

Recommended Posts

So I am making a small addon for my group that is just a simple config file using assets from other mods from our modline (mainly 4 rhs, 3cb factions and dhi uniforms)

I`ve already done 1 faction (USMC early 00s) and everything works as intended. I copied those files to create new faction (rgfc). I changed all required pathings and names of files, however it doesn't seem to be working properly.


1) Problem with randomizer script.



In config.cpp I define:

class CfgFunctions{
	#include "functions.hpp"

in functions.hpp I define:

class Znc
	tag = "Znc";
	class functions
		class random {file = "RGFC\functions\fn_randomrgfcarid.sqf";};

And finally in infantry.hpp I have:

class B_Soldier_F;
class NN_i_RGFC_Soldier_Arid_AKM: B_Soldier_F
	class EventHandlers
			init = "[(_this select 0)] call Znc_fnc_randomrgfcarid";

Units are present in editor, and I can place them. However, there is no randomization of their equipment. For my USMC faction everything works properly.

I am not sure, but maybe it has something to do with uniform restrictions? I tried changing sides of RGFC but that didn't help either. I also tried using randomizer script for usmc uniforms, didn't work.

Randomizer script:


private "_this";
_this = _this select 0;

_uniform = selectrandom [
"uk3cb_tka_o_u_combatuniform_01_adpm", "uk3cb_tka_o_u_combatuniform_01_adpm",
"uk3cb_tka_o_u_combatuniform_02_adpm", "uk3cb_tka_o_u_combatuniform_02_adpm",

_headgear = selectrandom [ 
"uk3cb_tka_i_h_ssh68_khk", "uk3cb_tka_i_h_ssh68_khk",
"uk3cb_tka_i_h_ssh68_oli", "uk3cb_tka_i_h_ssh68_oli", 

_vest = selectrandom [

_magazines = magazines _this;
_items = items _this; // Medkits, ToolKits etc.
_assitems = assignedItems _this; // NVG's, GPS etc.

_this forceadduniform _uniform;
_this addheadgear _headgear;
_this addvest _vest;

{_this addItem _x} forEach _items;
{_this addMagazine _x} forEach _magazines;
{_this addItem _x} forEach _assitems;
{_this assignItem _x} forEach _assitems;




2) Problem with gear.hpp and weapons.hpp


In config.cpp I define:

class CfgVehicles{
	#include "infantry.hpp"
	#include "gear.hpp"

class CfgWeapons{
	#include "Weapons.hpp"

In gear.hpp:

	class rhs_sidor;
	class NN_sidor_rpk: rhs_sidor
        displayname = "Sidor"; //In-Game Name
        scope = 1;

        class TransportItems //Items it's carrying
            class rhs_75rnd_762x39mm //Item Classname
                name = "rhs_75rnd_762x39mm";
                count = 4; 

In weapons.hpp:

	class uk3cb_svd_old; //Predefining Inheritence class - VERY IMPORTANT  
	class NN_svd_old_pso: uk3cb_svd_old
        scope = 2;
        displayName = "SVD";
        class LinkedItems
            class LinkedItemsOptic //Attachment: Optics
                slot = "CowsSlot";
                item = "rhc_acc_pso1m2";

Marksman doesn't have a scope.

Dude with backpack gives me error: Bad vehicle type NN_sidor_rpk


Share this post

Link to post
Share on other sites

Small update.

I`ve been trying to fix problem #1 for few days now.

Just after posting it here I realized that in functions.hpp there should be

class random_ARID {file = "RGFC\functions\fn_random_arid.sqf";};

still no juice.

I just copied everything once again and new version seems to be working properly. No idea why, just arma things I guess.


As for bad vehicle type error and gear.hpp I edited wrong file by mistake lol.


No scope on SVD still solved, misspelled classname.

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