Jump to content
Sign in to follow this  
easyeb

Random headgear config

Recommended Posts

Hello there fellow kids!

I'm learning faction config editing, what works best for me is editing existing configs to see how it looks when it works.

I'm want to ad random head gear (from a list of say about five items) to these dudes but I've not gotten it to work.

Any of you kind souls care to teach me the ways of the fo... I mean code.

Share this post


Link to post
Share on other sites

Hi!

 

I tried

 

  allowedHeadgear[] =
  {
  "H_Bandanna_blu",
  "H_Bandanna_cbr",
  "H_Bandanna_khk"
  };

 

also

​

headgearlist​[] =
  {
  "H_Bandanna_blu",
  "H_Bandanna_cbr",
  "H_Bandanna_khk"
  };

 

​right after the identityTypes ​part.

Share this post


Link to post
Share on other sites

Hi!

 

I tried

 

  allowedHeadgear[] =

  {

  "H_Bandanna_blu",

  "H_Bandanna_cbr",

  "H_Bandanna_khk"

  };

 

also

​

headgearlist​[] =

  {

  "H_Bandanna_blu",

  "H_Bandanna_cbr",

  "H_Bandanna_khk"

  };

 

​right after the identityTypes ​part.

you don't have an event handler .

 

 

 

Class CfgVehicles

{

class I_G_soldier_new: I_G_Soldier_base_F // Character class

{

/* ... */

/* [_headgearClass1, _probability1, _headgearClass2, _probability2, ...] */

headgearList[] =

{

"", 0.7, // Empty array means no headgear nor face wear

"H_FakeHeadgear", 0.9, // In this case, there is no headgear but there is a face wear

"H_HelmetB_light", 0.6, // Formerly member of the first list which had 60% to be selected

"H_Booniehat_khk", 0.6,

"H_Booniehat_oli", 0.6,

"H_Booniehat_indp", 0.6,

"H_Booniehat_mcamo", 0.6,

"H_Booniehat_grn", 0.6,

"H_Booniehat_tan", 0.6,

"H_Booniehat_dirty", 0.6,

"H_Booniehat_dgtl", 0.4, // Formerly member of the alternate list which had 40% to be selected

"H_Booniehat_khk_hs", 0.4,

"H_HelmetB_plain_mcamo", 0.4,

"H_HelmetB_plain_blk", 0.4,

"H_HelmetSpecB", 0.4,

"H_HelmetSpecB_paint1", 0.4,

"H_HelmetSpecB_paint2", 0.4,

"H_HelmetSpecB_blk", 0.4,

"H_HelmetIA", 0.4,

"H_HelmetIA_net", 0.4,

"H_HelmetIA_camo", 0.4,

"H_Helmet_Kerry", 0.4,

"H_HelmetB_grass", 0.4

};

// If the parent class doesn't have the headgear randomization

class EventHandlers: EventHandlers

{

// The function must be triggered to benefit from the randomization, its usage is documented in its header (see link above)

init = "if (local (_this select 0)) then {[(_this select 0), [], []] call BIS_fnc_unitHeadgear;};";

};

/* ... */

};

};

  • Like 1

Share this post


Link to post
Share on other sites

Let me know how you get on, as I need something like this for my up and coming KSK addon.

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
Sign in to follow this  

×