Jump to content

Is it possible to make AI gear change by skill level?


Recommended Posts

All of the missions use skill level 0 and skill level 1.  I was thinking of making a new mission in which the AI are skill level 2 and have the possibility of finding an item ON the ai.  However, currently it seems that DZMS just randomly picks from a set of gear no matter what skill level (I am talking about the magazines\tools NOT weapons).  How would we go about changing this to set gear by skill level... I tried this but now they have NO gear...

	switch (_skill) do {
		case 0: {_aigearArray = [DZMSGear1,DZMSGear2]; };
		case 1: {_aigearArray = [DZMSGear1,DZMSGear2];};
		case 2: {_aigearArray = [DZMSGear2,DZMSGear3];};
	};	
	_aigear = _aigearArray call BIS_fnc_selectRandom;
	_gearmagazines = _aigear select 0;
	_geartools = _aigear select 1;

if they have skill 0 this should choose arrays 1 & 2.  skill 1 should choose 1 & 2.  And my new harder mission at skill 2 should use gear set 2 and sometimes the nicer loot set of 3.  But instead they get nothing but weapons, ammo, backpack :-/

Link to comment
Share on other sites

Make this code:

	//Get the gear array
	_aigearArray = [DZMSGear0,DZMSGear1,DZMSGear2,DZMSGear3,DZMSGear4];
	_aigear = _aigearArray call BIS_fnc_selectRandom;
	_gearmagazines = _aigear select 0;
	_geartools = _aigear select 1;

change to this:

	//Get the gear array
	switch (_skill) do {
		case 0: {_aigear = DZMSGear0;};
		case 1: {_aigear = DZMSGear1;};
		case 2: {_aigear = DZMSGear2;};
		case 3: {_aigear = DZMSGear3;};
		case 4: {_aigear = DZMSGear4;};
	};
	_gearmagazines = _aigear select 0;
	_geartools = _aigear select 1;
Link to comment
Share on other sites

Doesn't the skill level only go 0,1, or 2 though? So case 3 and 4 would never happen. Was trying to leave some randomness to the gear also by leaving each skill level with a couple gear sets to choose from. I can't figure out y my code didn't work can u not create an array inside a switch statement? Or is it that the bis_selectRandom requires more than just the two options I was supplying it with?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...