Jump to content

Recommended Posts

I'm trying to create a little script for some units im making that will randomize weapon selection. I already have an idea on how to randomly select weapons from a pool, but I want to know if its possible to have the weapons in the pool based on the mods in use.

For example. The base mod I wanna use is RHS. So I want to have a pool of weapons from RHS (Basically some M4 Block IIs). But I also want the script to detect other mods like CUP or Specialist Military Arms, and add appropriate weapons from those mods into that pool, without overwriting the original RHS weapons in the pool. Does anybody know if this is possible? or will I have to make a whole bunch of different weapon pools that get activated based on mods?

Share this post


Link to post
Share on other sites
_weapons = ["vanilla-weapons"];
if ( isClass(configFile >> "CfgPatches" >> "rhsusf_main") ) then { _weapons append ["rhsusf-weapons"]; };
if ( isClass(configFile >> "CfgPatches" >> "rhs_main") ) then { _weapons append ["rhsafrf-weapons"]; };
if ( isClass(configFile >> "CfgPatches" >> "CUP_BaseData") ) then { _weapons append ["cup-weapons"]; };
_weapons;

This'll return an arry with all the weapons you add according to the presence of the addons.

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

×