Author Topic: AI Spawn Script  (Read 7342 times)

0 Members and 1 Guest are viewing this topic.

Fishgun123

  • Online Villain
  • ***
  • Posts: 223
    • View Profile
AI Spawn Script
« on: June 06, 2012, 04:46:02 pm »
Anybody know of an AI Spawn Script for Arma 2?

katie1992

  • Intentional Cheater
  • **
  • Posts: 38
    • View Profile
Re: AI Spawn Script
« Reply #1 on: June 06, 2012, 05:47:53 pm »
SpawnUnit_command = _this select 0;

SpawnUnit = "USMC_SoldierS_Sniper" createunit [[(getpos player select 0), (getpos player select 1), 50], group player, format["%1", SpawnUnit_command]];

~0.01
deletevehicle SpawnUnit
SpawnUnit = nearestobject [[(getpos player select 0), (getpos player select 1), 50],"USMC_SoldierS_Sniper"];
deletevehicle SpawnUnit
sleep 0.5
deletevehicle SpawnUnit
exit


Try that.

Fishgun123

  • Online Villain
  • ***
  • Posts: 223
    • View Profile
Re: AI Spawn Script
« Reply #2 on: June 06, 2012, 05:51:42 pm »
Wow thank you very much, it worked and thanks for being so helpful +1  :icon_biggrin2!

Fishgun123

  • Online Villain
  • ***
  • Posts: 223
    • View Profile
Re: AI Spawn Script
« Reply #3 on: June 06, 2012, 06:20:38 pm »
Also may I ask where you found that script? I want to be able to change the type of Unit Spawned or Civ.

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: AI Spawn Script
« Reply #4 on: June 06, 2012, 06:32:22 pm »
SpawnUnit_command = _this select 0;

SpawnUnit = "USMC_SoldierS_Sniper" createunit [[(getpos player select 0), (getpos player select 1), 50], group player, format["%1", SpawnUnit_command]];

~0.01
deletevehicle SpawnUnit
SpawnUnit = nearestobject [[(getpos player select 0), (getpos player select 1), 50],"USMC_SoldierS_Sniper"];
deletevehicle SpawnUnit
sleep 0.5
deletevehicle SpawnUnit
exit


Try that.

Change the red bit to the unit needed to spawn  :icon_thumbsup

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: AI Spawn Script
« Reply #5 on: June 06, 2012, 06:35:29 pm »
Code: [Select]
_grp_player = group player;
_units_player = units _grp_player;

if (({alive _x} count _units_player) > 0) then {
{
if (!isPlayer _x) then {
_x removeAllEventHandlers "killed";
if (vehicle _x == _x) then {
deleteVehicle _x;
} else {
unassignVehicle _x;
sleep 0.532;
deleteVehicle _x;
};
};
} forEach _units_player;
};

[playerSide,"HQ"] sideChat "All AI soldiers dismissed !!!!";

if (true) exitWith {};

Make sqf with this inside to delete them  :icon_thumbsup

BanHammer

  • Intentional Cheater
  • **
  • Posts: 46
    • View Profile
Re: AI Spawn Script
« Reply #6 on: June 06, 2012, 06:50:47 pm »
lol!

Code: [Select]
{deleteVehicle _x} foreach units (group player);

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: AI Spawn Script
« Reply #7 on: June 06, 2012, 06:54:06 pm »
True, forget that then, this is simpler  :icon_teehee

Chenarus93

  • Relentless Teamkiller
  • **
  • Posts: 61
    • View Profile
Re: AI Spawn Script
« Reply #8 on: June 06, 2012, 06:55:37 pm »
How would you go about getting these fellows to open fire on, say, zombies or players in Day Z?

I spawn them and attempt to use the squad commands, but I can't bring up the engagement menu (95% of the options are greyed out) and my units will not open fire on hostile survivors or zombies.
.

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: AI Spawn Script
« Reply #9 on: June 06, 2012, 06:56:39 pm »
lol!

Code: [Select]
{deleteVehicle _x} foreach units (group player);

LOL!

Code: [Select]
{deletevehicle _x;} foreach units player;
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

BanHammer

  • Intentional Cheater
  • **
  • Posts: 46
    • View Profile
Re: AI Spawn Script
« Reply #10 on: June 06, 2012, 07:00:47 pm »
True, forget that then, this is simpler  :icon_teehee

Snuff

  • Online Villain
  • ***
  • Posts: 184
    • View Profile
Re: AI Spawn Script
« Reply #11 on: June 06, 2012, 09:02:46 pm »
Code: [Select]
deleteObject cursorTarget;
That's all you need to delete something you look at, I lol'd when I realised this.

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: AI Spawn Script
« Reply #12 on: June 06, 2012, 09:12:51 pm »
What if its other side of map and you got no visual   :icon_rolleyes2

zlake

  • Relentless Teamkiller
  • **
  • Posts: 76
  • Killer space clowns. Twas a movie.
    • View Profile
Re: AI Spawn Script
« Reply #13 on: June 06, 2012, 09:39:50 pm »
Nice stuff. Just gotta figure out setfriend now.

katie1992

  • Intentional Cheater
  • **
  • Posts: 38
    • View Profile
Re: AI Spawn Script
« Reply #14 on: June 06, 2012, 09:42:31 pm »
Yeah, I need to figure out how to get an AI unit to kill someone.
Every time I "Open fire" and "Command them to target someone" they say engaging but dismiss them.

I.E: Zombies, they won't kill zombies -.-

Anyone know of an AI that will kill zombies, russians? USMC or something..
Specific name/