Jump to content

[EMS] 0.3.1 Defents Edit


Defent

Recommended Posts

Thanks, and as mentioned above:

[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,1,"DZMSUnitsMajor"] call DZMSAISpawn;
,3,1,"DZMSUnitsMajor"]

Number 3 here is the count of enemies and 1 is the skill level.

Thank you for your quick response.

 

I already tried setting AI unit numbers to 15-20 but they stopped functioning. Rather than defending their mission area, at high numbers they started running a few meters > going prone > getting up > running a few meters & looping this behavior without shooti

 

 

Let me rephrase my question: is there a way to make MANY EMS spawned AI units function properly? In my limited testing experience you CANNOT have 20 AI units function properly. They do spawn but they do not do their job (of attacking players). This seems to be the case even on a good server with one player (=me, just testing).

Link to comment
Share on other sites

Thank you for your quick response.

 

Let me rephrase my question: is there a way to make MANY EMS spawned AI units function properly? In my limited testing experience you CANNOT have 20 AI units function properly. They do spawn but they do not do their job (of attacking players). This seems to be the case even on a good server with one player (=me, just testing).

I do not know to be honest. :/  I have not tested with more ai's than what my "repack" currently has, mainly because I did not like it and that I thought my servers would lag too much with it. You can always test it and report back here. 

Also, what do you mean by function properly? Do they not shoot, move, look or whatever?

Link to comment
Share on other sites

I wonder if I replace the backpack options with a RPG if that would give them the second weapon I'm wanting.

 

change this 

DZMSPacklist = [
"DZ_Patrol_Pack_EP1",
"DZ_Assault_Pack_EP1",
"DZ_Czech_Vest_Puch",
"DZ_ALICE_Pack_EP1",
"DZ_TK_Assault_Pack_EP1",
"DZ_British_ACU",
"DZ_CivilBackpack_EP1",
"DZ_Backpack_EP1"
];

to this

DZMSPacklist = [
"RPG7V"
];
Link to comment
Share on other sites

I do not know to be honest. :/  I have not tested with more ai's than what my "repack" currently has, mainly because I did not like it and that I thought my servers would lag too much with it. You can always test it and report back here. 

Also, what do you mean by function properly? Do they not shoot, move, look or whatever?

I experienced, at high numbers (=12,15,20) They are doing the behavior described below...

 

 

I already tried setting AI unit numbers to 15-20 but they stopped functioning. Rather than defending their mission area, at high numbers they started running a few meters > going prone > getting up > running a few meters & looping this behavior without shooting at all.

Link to comment
Share on other sites

Does seem like an issue with how fire team groups are dealt with. Perhaps the enemy ai groups require a fire team leader to direct their attention and fire. Generally there is only 1 leader per every 4-5 unit, perhaps this relates to the issue you mentioned.

Link to comment
Share on other sites

Does seem like an issue with how fire team groups are dealt with. Perhaps the enemy ai groups require a fire team leader to direct their attention and fire. Generally there is only 1 leader per every 4-5 unit, perhaps this relates to the issue you mentioned.

It is something I would like to have (10+ AI units at missions) so I will further test it as soon as I clear my urgent issues queue. I will report here for others' benefit. Thanks for the input.

Link to comment
Share on other sites

Hi mgm, have you tried breaking the squad apart and making more than 1 AI spawn block?

 

This would then give more RPG's as the current setting gives 1 per squad and doing this should also fix the commanding issue.

 

So instead of 1 squad of 20 make 4 squads of 5 or 5 squads of 4 etc..?

 

I know when I did this on another system it sharpened them up a lot and there were a lot more RPG's flying about if players tried the run over trick. :)

 

Just a suggestion, I can't confirm this will work until someone tests it.

 

I haven't installed this system yet as I'm still ironing out some issues with my 112555/1051 version combo. Tbh, I'm probably going to end up waiting until dotjosh can get 125548 on DZC before I add anything else heavy on my server as 112555 just can't hack it.

 

But, intend to install this as soon as I can.

Link to comment
Share on other sites

Modify the backpack list didn't do anything. However when I added the RPG to their gear list, they do spawn with a RPG but do not use them. I killed each one from a distance ran to their body and the RPG despawned while their primary weapon stayed. I assume its because the way I added the RPG to their inventory. It's interesting how Arma / DayZ stores the RPG inside the database for a player. Its not on the primary weapon slot nor on the backpack list. 

 

 

Here is an alternate way possibly, if I was able to always spawn in a DSHKM into a mission, would the AI mount it to defend the mission? I see where I can add vehicles to spawn with a mission, but that random, how can I add DSHKMs to always spawn with the scenery?

Link to comment
Share on other sites

Hi mgm, have you tried breaking the squad apart and making more than 1 AI spawn block?

 

This would then give more RPG's as the current setting gives 1 per squad and doing this should also fix the commanding issue.

 

So instead of 1 squad of 20 make 4 squads of 5 or 5 squads of 4 etc..?

 

I know when I did this on another system it sharpened them up a lot and there were a lot more RPG's flying about if players tried the run over trick. :)

 

Just a suggestion, I can't confirm this will work until someone tests it.

 

I haven't installed this system yet as I'm still ironing out some issues with my 112555/1051 version combo. Tbh, I'm probably going to end up waiting until dotjosh can get 125548 on DZC before I add anything else heavy on my server as 112555 just can't hack it.

 

But, intend to install this as soon as I can.

Shall try. Cheers
Link to comment
Share on other sites

I see it, but I don't understand how this is just added to the one AI, I would prefer to add it to all AI.

That shouldn't be a problem; again using the original DZMS/Scripts/DZMSAISpawn.sqf (here an excerpt):

for "_x" from 1 to _unitcount do {

	//Lets pick a skin from the array
	_aiskin = DZMSBanditSkins call BIS_fnc_selectRandom;
	
	//Lets spawn the unit
	_unit = _unitGroup createUnit [_aiskin, [(_position select 0),(_position select 1),(_position select 2)], [], 10, "PRIVATE"];
	
	//Make him join the correct team
	[_unit] joinSilent _unitGroup;
	
	//Add the behaviour
	_unit enableAI "TARGET";
	_unit enableAI "AUTOTARGET";
	_unit enableAI "MOVE";
	_unit enableAI "ANIM";
	_unit enableAI "FSM";
	_unit setCombatMode "YELLOW";
	_unit setBehaviour "COMBAT";
	
	//Remove the items he spawns with by default
	removeAllWeapons _unit;
	removeAllItems _unit;
	
	//Now we need to figure out their loadout, and assign it
	
	//Get the weapon array based on skill
	_weaponArray = [_skill] call DZMSGetWeapon;
	
	_weapon = _weaponArray select 0;
	_magazine = _weaponArray select 1;
	
	//diag_log text format ["[DZMS]: AI Weapon:%1 / AI Magazine:%2",_weapon,_magazine];
	
	//Get the gear array (increase gold spawn (13)
	_aigearArray = [DZMSGear00,DZMSGear01,DZMSGear02,DZMSGear03,DZMSGear04,DZMSGear05,DZMSGear06,DZMSGear07,DZMSGear08,DZMSGear09,DZMSGear10,DZMSGear11,DZMSGear12,DZMSGear13,DZMSGear14,DZMSGear15,DZMSGear16,DZMSGear17,DZMSGear18,DZMSGear13,DZMSGear13,DZMSGear13,DZMSGear13,DZMSGear13];
	_aigear = _aigearArray call BIS_fnc_selectRandom;
	_gearmagazines = _aigear select 0;
	_geartools = _aigear select 1;
	
	//Gear the AI backpack
	_aipack = DZMSPacklist call BIS_fnc_selectRandom;

	//Lets add it to the Unit
	for "_i" from 1 to 3 do {
		_unit addMagazine _magazine;
	};
	_unit addWeapon _weapon;
	_unit selectWeapon _weapon;
	
	_unit addBackpack _aipack;
	
	if (DZMSUseNVG) then {
		_unit addWeapon "NVGoggles";
	};
	
	{
		_unit addMagazine _x
	} forEach _gearmagazines;
	
	{
		_unit addWeapon _x
	} forEach _geartools;
	
	_aicskill = DZMSSkills1;
	//Lets set the skills
	switch (_skill) do {
		case 0: {_aicskill = DZMSSkills0;};
		case 1: {_aicskill = DZMSSkills1;};
		case 2: {_aicskill = DZMSSkills2;};
		case 3: {_aicskill = DZMSSkills3;};
	};
	
	{
		_unit setSkill [(_x select 0),(_x select 1)]
	} forEach _aicskill;
	
	//Lets prepare the unit for cleanup
	_unit addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM DZMSAIKilled; }];
	_unit setVariable ["DZMSAI", true];
};

//Lets give a launcher if enabled
//The last _unit should still be defined from the FOR above
if (DZMSUseRPG) then {
	_unit addWeapon "RPG7V";
	_unit addMagazine "PG7V";
	_unit addMagazine "PG7V";
};

  • The loop over all members in the unit starts at line 27, ends at 107.
  • The RPGs are given in lines 111-115 to the last _unit from the loop above.
  • Simply move the if clause 111-115 before the bracket closing the loop (l.107)
Link to comment
Share on other sites

So you mean like this?

	_aicskill = DZMSSkills1;
	//Lets set the skills
	switch (_skill) do {
		case 0: {_aicskill = DZMSSkills0;};
		case 1: {_aicskill = DZMSSkills1;};
		case 2: {_aicskill = DZMSSkills2;};
		case 3: {_aicskill = DZMSSkills3;};
	};
	
	{
		_unit setSkill [(_x select 0),(_x select 1)]
	} forEach _aicskill;
	
	//Lets prepare the unit for cleanup
	_unit addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM DZMSAIKilled; }];
	_unit setVariable ["DZMSAI", true];
	
	//Lets give a launcher if enabled
//The last _unit should still be defined from the FOR above
	if (DZMSUseRPG) then {
	_unit addWeapon "RPG7V";
	_unit addMagazine "PG7V";
	_unit addMagazine "PG7V";
	};
};
Link to comment
Share on other sites

Yes.

 

BTW:

 

I've never thought about that but it may be that you'll wind up with none of the units wearing a backpack.

At missions occasionally I find killed AI without a pack, perhaps these are the ones that get their pack replaced by the RPG (though it might be that some units spawn without, anyway).

 

If that is the case one could replace the RPG7 with a launcher that doesn't use the pack slot - if there is such a thing.

Link to comment
Share on other sites

Nah I'm fine with that. I wonder if I do this that it will give the last guy a stinger, thoughts?

	_aicskill = DZMSSkills1;
	//Lets set the skills
	switch (_skill) do {
		case 0: {_aicskill = DZMSSkills0;};
		case 1: {_aicskill = DZMSSkills1;};
		case 2: {_aicskill = DZMSSkills2;};
		case 3: {_aicskill = DZMSSkills3;};
	};
	
	{
		_unit setSkill [(_x select 0),(_x select 1)]
	} forEach _aicskill;
	
	//Lets prepare the unit for cleanup
	_unit addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM DZMSAIKilled; }];
	_unit setVariable ["DZMSAI", true];
	
	//Lets give a launcher if enabled
	if (DZMSUseRPG) then {
	_unit addWeapon "RPG7V";
	_unit addMagazine "PG7V";
	_unit addMagazine "PG7V";
	};
};

	//Lets give a launcher if enabled
	//The last _unit should still be defined from the FOR above
if (DZMSUseRPG) then {
	_unit addWeapon "Stinger";
	_unit addMagazine "Stinger";
	_unit addMagazine "Stinger";
};
Link to comment
Share on other sites

I think the classnames are correct.

However your method would give the last unit 2 launchers. Perhaps they'll be simply swapped, but I'm not sure about this.

So, to be on the safe side, perhaps something like this?

if (DZMSUseRPG) then {
  if ( _x = 1 ) {
	_unit addWeapon "Stinger";
	_unit addMagazine "Stinger";
	_unit addMagazine "Stinger";
  } else {
	_unit addWeapon "RPG7V";
	_unit addMagazine "PG7V";
	_unit addMagazine "PG7V";
  }
}

Edit: scratch that thought. The _x is an internal loop variable and at this place does not have the value from

for "_x" from 1 to _unitcount do {

So perhaps a new local variable _flag_stinger to be set to true on _x=1 (right at the top of the loop) and false, else.

 

But maybe it's easier to just try overwriting as you proposed. Tell me if that works, then I'll have learned something :-)

Link to comment
Share on other sites

Worked like a champ, some of the backpacks do disappear, but meh. The RPG gets cleaned up as well after the AI dies which is perfect. The Stinger also works well and doesn't get cleaned up, but works perfect.

 

 

Any thoughts on how to make the AI engage targets that are father out? I have the spotDistance to 1.00 however it still seems a little short.

Link to comment
Share on other sites

Worked like a champ, some of the backpacks do disappear, but meh. The RPG gets cleaned up as well after the AI dies which is perfect. The Stinger also works well and doesn't get cleaned up, but works perfect.

 

 

Any thoughts on how to make the AI engage targets that are father out? I have the spotDistance to 1.00 however it still seems a little short.

1 = 100%

 

The variable runs from 0.01-1.00

 

if you're having difficulty you could try changing the behaviour of the AI to Red & Stealth in DZMSAISpawn like this:

_unit setCombatMode "RED";
_unit setBehaviour "STEALTH";
 
See this link for more info on those settings:
Link to comment
Share on other sites

No idea about the engagement range.

 

For cleanup of the Stingers I guess you'll have to add

if (DZMSUseRPG AND ("Stinger" in (weapons _unit))) then {
    _unit removeWeapon "Stinger";
    _unit removeMagazines "Stinger";
};

to DZMS/Scripts/DZMSAIKilled.sqf just as it is done for the RPG7 near line 65.

Link to comment
Share on other sites

 

If you're having difficulty you could try changing the behaviour of the AI to Red & Stealth in DZMSAISpawn like this:
_unit setCombatMode "RED";
_unit setBehaviour "STEALTH";

 

Thanks for this; I've always found WAI missions much more difficult than DZMS and now remember that there the CombatMode is set to red. I'll try this change, tomorrow :-)

Link to comment
Share on other sites

Hi Defent, is there any reason why this shouldn't sit alongside DZMS? 

 

If OK, where shall I put the initial call, before or after the DZMS call?

 

Thanks

I guess I have my answer.... :(

 

21:07:39 [EMS]: <ERROR> EMS is Installed Twice or Installed Incorrectly!
 
I am trying to achieve having hard, medium and easy missions running at the same time on my server and have had WAI and DZMS running fine alongside giving me hard and medium. Was hoping to add this and make easy for fresh spawns, single players etc....
 
Anyone know of a way around this so I can have DZMS and EMS running at the same time? Any help would be gratefully appreciated.
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
×
×
  • Create New...