Jump to content

Re-Worked WAI 0.173 - Supported System


Recommended Posts

Are you patroling or paradrops? 

Just change the type of heli you are using.  Can change the heli to one without guns.  I've noticed that ai seem to react better with an airplane or heli patroling over them, but it could also be in my head :P

  I tried to use the pooh transport but received a content download error :wacko:

Link to comment
Share on other sites

I can get in and edit the backpack-eating weapons out of the loot caches and off of the AI, but that brings up another question...

What is the best way to address this in general? can I swap for other version or create epoch friendly versions? currently every one of these guns is eating backpacks as it takes up the ARMA2 standard dual slots...

["RPK_74","75Rnd_545x39_RPK"],
["MK_48_DZ","100Rnd_762x51_M240"],
["M249_DZ","200Rnd_556x45_M249"],
["Pecheneg_DZ","100Rnd_762x54_PK"],
["M240_DZ","100Rnd_762x51_M240"]

Link to comment
Share on other sites

For anyone looking to add RPGs to AI units was posted on the old WAI thread. I just don't want to lose this info because it works REALLY well.

 

1) Open SpawnGroup.sqf in WAI/custom/ folder.

 

To remove RPG once AI is dead open ai_killed.sqf

 

All credit goes to the original author and WAI, I am merely keeping this information alive.

 

Next I want to find a way to give AI units NVGs, if anyone has that info please share it.

Found a small problem with this. I'm getting this error in the logs:

20:18:19 Error in expression <Magazine _magazine;};

if ((_x == 1) && (_RPG > 0)) then {

_unit addweapon "RPG7V>

20:18:19 Error Undefined variable in expression: _rpg

 

it repeats multiple times too. I'm new to Arma coding but should it be changed to && (_RPG = 1) ?

Link to comment
Share on other sites

Can anyone help me out, I've added a few new custom missions with cars, units and paradrops at certain intervals. I am trying to cleanup after a mission (not just my custom mission but all missions) and it's not working.

 

Basically, I don't want the AI to remain after the mission has ended and the box has been looted. I've had people walking in the area where an old mission was and be killed by AI that wasn't killed when the mission was active.

Unfortunately, the spawn_group function doesn't return anything (like an array corresponding to each unit spawned) so I can't just delete them that way. Is there any other way I can delete them after a set amount of time? I literally just need to know how to remove them, as I've got everything else in place to remove the box and vehicles once the mission has ended, but the units on foot and those that paradropped in are not being removed.

 

Thanks

Link to comment
Share on other sites

ai_mission_sysyem = True;  in AIconfig.sqf

 

Is this a typo or ment to be ?

typo i think, but also used in init.sqf so only a "cosmetical thing"

 

 

Found a small problem with this. I'm getting this error in the logs:

20:18:19 Error in expression <Magazine _magazine;};

if ((_x == 1) && (_RPG > 0)) then {

_unit addweapon "RPG7V>

20:18:19 Error Undefined variable in expression: _rpg

 

it repeats multiple times too. I'm new to Arma coding but should it be changed to && (_RPG = 1) ?

 

first line in SpawnGroup.sqf looks like

private ["_mission","_aipack","_aicskill","_position","_unitnumber","_skill","_gun","_mags","_backpack","_skin","_gear","_aiweapon","_aigear","_aiskin","_skillarray","_unitGroup","_weapon","_magazine","_weaponandmag","_gearmagazines","_geartools","_unit"];

add to the end

,"_RPG"

Made it a bit more dynamic, AI can have 0 launchers, or 10

_addRPG = floor(random 7); 


for "_i" from 1 to _mags do {_unit addMagazine _magazine;};
	if ((_addRPG == 5)) then {
	   removeAllItems _unit;
	   removeAllWeapons _unit;
           removeBackpack _unit;
	  _unit addweapon "RPG7V"; 
	  _unit addmagazine "PG7VL"; 
	  _unit selectweapon "RPG7V"; 
	} else {
	  _unit addBackpack _aipack;
};

Units try to change weapon if you are to close to them or to far away (looks a bit strange) but works perfectly.

Link to comment
Share on other sites

I can't seem to get the Ai to spawn, i have no idea what is going on.

 

[[11600,3260,0], [11688.4,3222.11,0.001], [11591.9,3136.57,8.995],
6,
0,    
"Random",      
4,
"",
"GUE_Soldier_2_DZ",
"Random"                  
] call spawn_group;
 
[[11600,3260,0], 
1,
2,    
5,      
6,
"DZ_LargeGunBag_EP1",
"GUE_Commander_DZ",
"Random"                  
] call spawn_group;
 
^ that is one of the groups I am trying to spawn.
Link to comment
Share on other sites

Are there any plans to include respawn?

 

Also, it would be a lot better to allow a radius of patrol for each group, that way I can have some protect a small area and others protect a much bigger area.

 

I actually came here to ask the same thing. Is it possible to move

 

/// Sets radius for AI patrols (call spawn_group)

ai_patrol_radius = 300; 

 

this to be a function of spawn group? In fact, ill let yu know :P

 

Edit (note, you can also do this with the waypoints variable, i havent tested yet what it does with too many waypoints in a small area):

 

in SpawnGroup.sqf find:

if (count _this > 8) then {
	_mission = _this select 8;
} else {
	_mission = False;
};

after, add:

if (count _this > 9) then {
	_patrolrange = _this select 9;
} else {
	_patrolrange = ai_patrol_radius;;
};

in spawnGroup.sqf (again), find:

[_unitGroup, _position, _mission] call group_waypoints;

replace with:

[_unitGroup, _position, _mission, _patrolrange] call group_waypoints;

In patrol.sqf find:

_radius = ai_patrol_radius;

replace with:

_radius = _this select 3;

Note: Make sure to use false as 9th variable as it might bug on the _mission part otherwise.

Link to comment
Share on other sites

Does anyone know if there's a way to make AI attack a player in a vehicle? I have various vehicles on my server which the AI simply wont fire on regardless of who's in it. If the player turns out, the AI will shoot at the player but once they turn in, the AI stop shooting. It kind of breaks the missions, since players can drive in and mow down the AI without any risk...

Link to comment
Share on other sites

typo i think, but also used in init.sqf so only a "cosmetical thing"

 

 

 

first line in SpawnGroup.sqf looks like

private ["_mission","_aipack","_aicskill","_position","_unitnumber","_skill","_gun","_mags","_backpack","_skin","_gear","_aiweapon","_aigear","_aiskin","_skillarray","_unitGroup","_weapon","_magazine","_weaponandmag","_gearmagazines","_geartools","_unit"];

add to the end

,"_RPG"

Made it a bit more dynamic, AI can have 0 launchers, or 10

_addRPG = floor(random 7); 


for "_i" from 1 to _mags do {_unit addMagazine _magazine;};
	if ((_addRPG == 5)) then {
	   removeAllItems _unit;
	   removeAllWeapons _unit;
           removeBackpack _unit;
	  _unit addweapon "RPG7V"; 
	  _unit addmagazine "PG7VL"; 
	  _unit selectweapon "RPG7V"; 
	} else {
	  _unit addBackpack _aipack;
};

Units try to change weapon if you are to close to them or to far away (looks a bit strange) but works perfectly.

Hey, mate? where do i add the _addRPG = floor(random 7);  ?

 

i have it like this:

_unit enableAI "TARGET";
	_unit enableAI "AUTOTARGET";
	_unit enableAI "MOVE";
	_unit enableAI "ANIM";
	_unit enableAI "FSM";
	_unit setCombatMode ai_combatmode;
	_unit setBehaviour ai_behaviour;
	removeAllWeapons _unit;
	removeAllItems _unit;
	_unit addweapon _weapon;
_addRPG = floor(random 7); 


for "_i" from 1 to _mags do {_unit addMagazine _magazine;};
	if ((_addRPG == 5)) then {
	   removeAllItems _unit;
	   removeAllWeapons _unit;
           removeBackpack _unit;
	  _unit addweapon "RPG7V"; 
	  _unit addmagazine "PG7VL"; 
	  _unit selectweapon "RPG7V"; 
	} else {
	  _unit addBackpack _aipack;
};
	{_unit addMagazine _x} forEach _gearmagazines;
	{_unit addweapon _x} forEach _geartools;
	if (ai_custom_skills) then {
		switch (_skill) do {
		case 0 : {_aicskill = ai_custom_array1;};
		case 1 : {_aicskill = ai_custom_array2;};
		case 2 : {_aicskill= ai_custom_array3;};
		case "Random" : {_aicskill = ai_skill_random call BIS_fnc_selectRandom;};
	};

And the AI isnt spawning

 

i have added the ,"_RPG" at the end of the "private ["_mission" line

 

any suggestions?

Link to comment
Share on other sites

 

I actually came here to ask the same thing. Is it possible to move

 

/// Sets radius for AI patrols (call spawn_group)

ai_patrol_radius = 300; 

 

this to be a function of spawn group? In fact, ill let yu know :P

 

Edit (note, you can also do this with the waypoints variable, i havent tested yet what it does with too many waypoints in a small area):

 

in SpawnGroup.sqf find:

if (count _this > 8) then {
	_mission = _this select 8;
} else {
	_mission = False;
};

after, add:

if (count _this > 9) then {
	_patrolrange = _this select 9;
} else {
	_patrolrange = ai_patrol_radius;;
};

in spawnGroup.sqf (again), find:

[_unitGroup, _position, _mission] call group_waypoints;

replace with:

[_unitGroup, _position, _mission, _patrolrange] call group_waypoints;

In patrol.sqf find:

_radius = ai_patrol_radius;

replace with:

_radius = _this select 3;

Note: Make sure to use false as 9th variable as it might bug on the _mission part otherwise.

 

Is this working? Anyone test it?

Link to comment
Share on other sites

Hey I'm having a weird issue, it started a while ago where only the Construction Supply Box would give you 50 rounds of M240 and 50 rounds of M249 (Is that the default inventory for the BAF_Vehicle_Box?) - But now it's happened to all of my missions! I'm guessing this is something wrong with calling the individual box inventories ie. MediumGunBox.sqf. Here's a snippet of the code for one of my missions.

 

_box = createVehicle ["BAF_VehicleBox",[(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"];

[_box] call Medium_Gun_Box;

 
Is there anything wrong with that? I'm pretty sure that hasn't been changed (We do have a few admins on our server). It would only make sense that either this or all my Box.sqf's are wrong... :(
Link to comment
Share on other sites

Yeah I am;

 

//Medium Gun Box

 
_box = _this select 0;
_box setVariable ["ObjectID","1",true];
_box setVariable ["permaLoot",true];
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_box];
 
clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;
 
// RIFLES
_box addWeaponCargoGlobal ["G36C", 1];
_box addWeaponCargoGlobal ["M4A1_AIM_CAMO", 1];
_box addWeaponCargoGlobal ["AK_47_M", 1];
_box addWeaponCargoGlobal ["RPK_74", 1];
_box addWeaponCargoGlobal ["M4A1_AIM_SD_camo", 1];
 
// PISTOLS
_box addWeaponCargoGlobal ["Glock17_EP1", 1];
_box addWeaponCargoGlobal ["UZI_EP1", 1];
 
// AMMUNITION
_box addMagazineCargoGlobal ["30Rnd_556x45_G36", 10];
_box addMagazineCargoGlobal ["30Rnd_556x45_Stanag", 10];
_box addMagazineCargoGlobal ["30Rnd_762x39_AK47", 10];
_box addMagazineCargoGlobal ["30Rnd_556x45_Stanag", 10];
_box addMagazineCargoGlobal ["75Rnd_545x39_RPK", 5];
_box addMagazineCargoGlobal ["30Rnd_556x45_StanagSD", 10];
 
_box addMagazineCargoGlobal ["17Rnd_9x19_glock17", 10];
_box addMagazineCargoGlobal ["30Rnd_9x19_UZI", 10];
 
// ITEMS
_box addWeaponCargoGlobal ["ItemToolbox", 2];
_box addWeaponCargoGlobal ["ItemMatchbox", 2];
_box addWeaponCargoGlobal ["ItemEtool", 2];
_box addWeaponCargoGlobal ["ItemCompass", 2];
 
// CLOTHING
_box addMagazineCargoGlobal ["Skin_Soldier1_DZ", 2];
_box addMagazineCargoGlobal ["Skin_Camo1_DZ", 2];
 
// BACKPACKS
_box addBackpackCargoGlobal ["DZ_British_ACU", 2];

 
That's my Medium Gun Box, haven't touched on the original, I added vehicle patrols into two of my missions the other day, but I don't see how that might effect the box contents of other missions...
 
EDIT: Fixed, I just got started from scratch again with the most recent WAI, threw a few similar edits in again and it's fine!
Link to comment
Share on other sites

sorry if this has been addressed but i can't find an answer in this thread.

 

I've noticed that the "dot" in the marker points exactly to the spawn location.  Is there a way to have the marker appear randomly in the circle or have the spawn other then right under the dot?

Link to comment
Share on other sites

sorry if this has been addressed but i can't find an answer in this thread.

 

I've noticed that the "dot" in the marker points exactly to the spawn location.  Is there a way to have the marker appear randomly in the circle or have the spawn other then right under the dot?

 

You can use BIS_fnc_findSafePos with the position of the drop as center and a small (like 100m) range to create a new center for the circle you make on the map. I actually do it the other way around:

// This selects thegeneral area where to pawn the box, and this is the center of the marker.
_position = [_spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;


//Marker: Just as example for the position
//_event_marker = createMarker [ format ["loot_event_marker_%1", _start_time], _position];

//Calculating a location to place the box on:
_loot_pos = [_position,0,(_markerRadius - 100),20,0,2000,0] call BIS_fnc_findSafePos;


enjoy

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...