Enemy AI Static [resolved]

  • Offline Brian
  • Geared Up
  • **
  • Posts: 33
  • anyone in Kavala!?

Enemy AI Static [resolved]

« posted: Oct 28, 2013, 12:08 AM »
Is there a way to add in Static AI with the editor that will still shoot at independent players or does this have to be done with scripting?
  • Offline Brian
  • Geared Up
  • **
  • Posts: 33
  • anyone in Kavala!?

Re: Enemy AI Static

« Reply #1 posted: Oct 28, 2013, 02:49 PM »
Nevermind - totally figured it out.

For reference, if any of you want to create roaming AI patrolls on server start, it's quite easy.

Just create a CIVILIAN MAN on the map, and in the initialization field, place the following. You can alter it to change the loadout however you see fit.

Code: [Select]
removeAllAssignedItems this;
this addUniform "U_B_CombatUniform_mcam";
this addVest "V_PlateCarrier1_rgr";
this addMagazine "30Rnd_556x45_Stanag";
this addWeapon "arifle_TRG21_F";
this addMagazine "30Rnd_556x45_Stanag";
this addMagazine "30Rnd_556x45_Stanag";
this addMagazine "RPG32_HE_F";
this addWeapon "launch_RPG32_F";
this addMagazine "RPG32_HE_F";

Re: Enemy AI Static

« Reply #2 posted: Jan 21, 2014, 08:45 PM »
Nevermind - totally figured it out.

For reference, if any of you want to create roaming AI patrolls on server start, it's quite easy.

Just create a CIVILIAN MAN on the map, and in the initialization field, place the following. You can alter it to change the loadout however you see fit.

Code: [Select]
removeAllAssignedItems this;
this addUniform "U_B_CombatUniform_mcam";
this addVest "V_PlateCarrier1_rgr";
this addMagazine "30Rnd_556x45_Stanag";
this addWeapon "arifle_TRG21_F";
this addMagazine "30Rnd_556x45_Stanag";
this addMagazine "30Rnd_556x45_Stanag";
this addMagazine "RPG32_HE_F";
this addWeapon "launch_RPG32_F";
this addMagazine "RPG32_HE_F";

Can you post how ?

Re: Enemy AI Static [resolved]

« Reply #3 posted: Feb 20, 2014, 06:53 AM »
I tried doing this and it turns all the player slots into ai slots. Is there something I'm doing wrong that is causing this?
  • Offline JoSchaap
  • Developer
  • Mercenary
  • ******
  • Posts: 483
  • Had a life.. Got a modem.. (~1996)

Re: Enemy AI Static [resolved]

« Reply #4 posted: Feb 20, 2014, 02:07 PM »
I think best approach is to script in patrols instead of using the editor :)

make sure you side the AI to CIVILLIAN

Re: Enemy AI Static [resolved]

« Reply #5 posted: Feb 21, 2014, 12:31 AM »
Hmm ok. I just started looking into this and there seem to be some different ai patrol scripts out there.

JoSchaap have you used any of the ai patrol scripts? Are there any you might recommend?

Re: Enemy AI Static [resolved]

« Reply #6 posted: Feb 21, 2014, 05:29 AM »
ok so here's my progress on this.

So I went looking for an ai script so I didn't have to use the editor to try and create waypoints and whatnot. There are two scripts I'm using atm.

This one so the ai respwans
http://www.armaholic.com/page.php?id=6540

The second is the main ai patrol script
http://kronzky.info/ups/index.htm

(for future reference for others, be sure to get the latest script for Kronzky's script)

I first tried adding the ai as civilians. I used the loadouts posted earlier and put that code into the init. The problem I ran into was that only some of the items were loading. No ammo, no uniform, etc. They had guns but that was about it.

So what I did was I took out the independent AI spawns and just made the ai independent. Also, instead of spawning individual's I just used the add group method.

I still would rather keep the indepenent side for player spawns but I'm not sure how to get around the loadout issue. Anyone got any ideas?
  • Offline JoSchaap
  • Developer
  • Mercenary
  • ******
  • Posts: 483
  • Had a life.. Got a modem.. (~1996)

Re: Enemy AI Static [resolved]

« Reply #7 posted: Feb 21, 2014, 10:54 AM »
why not just hook into the mission's AI creation compiles?

for example: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/Development_main/server/missions/factoryMethods/createUnits/createRandomSoldier.sqf

Code: [Select]
_patrolstartpos = (startposition goes here);

_groupPatrol1 = createGroup civilian;
_soldier = [_groupPatrol1, _patrolstartpos] call createRandomSoldier;

and so on...


Re: Enemy AI Static [resolved]

« Reply #8 posted: Feb 21, 2014, 11:29 PM »
why not just hook into the mission's AI creation compiles?

for example: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/Development_main/server/missions/factoryMethods/createUnits/createRandomSoldier.sqf

Code: [Select]
_patrolstartpos = (startposition goes here);

_groupPatrol1 = createGroup civilian;
_soldier = [_groupPatrol1, _patrolstartpos] call createRandomSoldier;

and so on...

Thanks for the response Jo

I'll take a look at that but I'm not sure that's something I can technically do. I just don't have the coding knowledge. That's why I just wanted to run the separate script. pretty much plug and play.

There is also another larger issue with that idea and that has to do with the mission AI logic. (I guess this is more of a bug that should be brought up in the other section) The mission ai seem to be pretty dumb depending on the mission. For example if you've got a crashed helocopter site you can pretty much just drive up, drive over them, and then take the loot. Same thing is true for disable vehicle missions. I think so far the only mission I've done that will actually attack you while you're in a vehicle are the money missions. Now using kronzy's ai script for comparison, I put a fire team at the airport as independent and drove up in a hemit but couldn't get within 200 meters of them without getting blown up by a rocket.

The other thing with this is that I'm basically trying to set up roaming and re-spawning enemy ai. Kind of like the enemy's in the epoch mod. So that's why I was trying to use those two scripts, it was exactly what i needed. I am however running into a couple of issues......

Kronzy's script sets the default state of the ai to safe and the end result is that they basically stay at their spawn point. You can make a call in the leader init with additional parameters to change the default behavior.
ie. null=[this, "Patrol1", "NOSLOW", "NOWAIT"] execVM ubs.sqf.

The problem is that the respawn script wants you to make the call in the leader init to run that script.
i.e. null=[this, 99, 30, "Patrol1", "EastSpawn"] execVM ubs_repawn.sqf

(note: the above code/syntax might be totally accurate. I'm writing that from memory LOL)

There is a file in the respawn script that makes the call to run the ubs script. I just don't know how to get it to call with the extra parameters that are available for kronzy's script (ie noslow, nowait, etc).

Does any of that make sense? lol

  • Offline Juhan
  • Fresh Spawn
  • *
  • Posts: 9

Re: Enemy AI Static [resolved]

« Reply #9 posted: Jan 04, 2015, 06:26 PM »
Someone should really take another look into this, I've been lookign for a possibility to add random bots and random unmarked NPC patrols to our server.