Jump to content
Sign in to follow this  
strike0277

Setting UP Mission Params, Help please.

Recommended Posts

How do I go about setting up AI difficulty to be selectable in mission params? I understand the titles and such go into the Description.ext but I'm confused.

Do I set the max number of AI available on the map so the parameters can scale them back based on the settings?

Better yet this is what I'm looking to do. Every mission I build I would like to have the ability to set the AI strength and difficulty at the start of the mission as It would depend on how many of my members have shown up for that OP.

Thanks for any and all help guys.

Share this post


Link to post
Share on other sites

I guess there is multiple ways to go at this, but here's one (just made it up, haven't tested). grpA, grpB etc are AI groups which should be deleted at the corresponding difficulty level. Doesn't matter how you go about making the list of the units, but it should be an array.

description.ext:

class Params
{
 class AIStrength {
   title = "AI Strength";
   values[] = {1,2,3,4};
   texts[] = {"Easy","Normal","Moderate","Hard"};
   default = 2;
 };
 class AISkill {
   title = "AI Skill";
   values[] = {1,3,5,7};
   texts[] = {"Easy","Normal","Moderate","Hard"};
   default = 3;
 };
};

init.sqf:

if isserver then {
 private ["_aistrength","_aistodelete","_aiskill"];
 _aistrength = paramsarray select 0;
 _aistodelete = switch _aistrength do {
   case 1: { (units grpA + units grpB + units grpC) };
   case 2: { (units grpA + units grpB) };
   case 3: { (units grpA) };
 };
 {deletevehicle _x} foreach _aistodelete;

 _aiskill = paramsarray select 1;
 {
   call compile format ["_x setskill 0.%1",_aiskill];
 } foreach allunits;
};

Share this post


Link to post
Share on other sites

Okay, my next question would be do I have to put the max amount of enemy ai on the map, then use the param to scale them back?

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  

×