Forum Jump : FORUMS Editing / Addon editing Editing / Mission editing Editing / Scripting Editing / Addon editing / Armed Assault Editing / Addon editing / Arma 2 / Arma 2: Operation Arrowhead Editing / Addon editing / Arma 3 Editing / Mission editing / Armed Assault Editing / Mission editing / Arma 2 / Arma 2: Operation Arrowhead Editing / Mission editing / Arma 3 Editing / Scripting / Armed Assault Editing / Scripting / Arma 2 / Arma 2: Operation Arrowhead Editing / Scripting / Arma 3 Arma 3 / General Discussion Arma 3 / Troubleshooting Arma 3 / Addons and Mods: Complete Arma 3 / Addons and Mods Arma 3 / Missions: Complete Arma 3 / Missions WIP Arma 3 / Addons and Mods: Complete / Islands Arma 3 / Addons and Mods: Complete / Modules Arma 3 / Addons and Mods: Complete / Sounds Arma 3 / Addons and Mods: Complete / Units Arma 3 / Addons and Mods: Complete / Vehicles Arma 3 / Addons and Mods: Complete / Weapons Arma 3 / Addons and Mods: Complete / Other Arma 3 / Addons and Mods: Complete / Gear Arma 3 / Addons and Mods / Addons and Mods: WIP Arma 3 / Addons and Mods / Addon requests Arma 3 / Missions: Complete / Multiplayer missions Arma 3 / Missions: Complete / Singleplayer missions Operation Arrowhead / General Discussion Operation Arrowhead / Troubleshooting Operation Arrowhead / Addons and Mods: Complete Operation Arrowhead / Addons and Mods Operation Arrowhead / Missions: Complete Operation Arrowhead / Missions WIP Operation Arrowhead / Addons and Mods: Complete / Islands Operation Arrowhead / Addons and Mods: Complete / Modules Operation Arrowhead / Addons and Mods: Complete / Sounds Operation Arrowhead / Addons and Mods: Complete / Units Operation Arrowhead / Addons and Mods: Complete / Vehicles Operation Arrowhead / Addons and Mods: Complete / Weapons Operation Arrowhead / Addons and Mods: Complete / Other Operation Arrowhead / Addons and Mods / Addons and Mods: WIP Operation Arrowhead / Addons and Mods / Addon requests Operation Arrowhead / Missions: Complete / Multiplayer missions Operation Arrowhead / Missions: Complete / Singleplayer missions Arma 2 / General Discussion Arma 2 / Troubleshooting Arma 2 / Addons and Mods: Complete Arma 2 / Addons and Mods Arma 2 / Missions: Complete Arma 2 / Missions WIP Arma 2 / Addons and Mods: Complete / Islands Arma 2 / Addons and Mods: Complete / Modules Arma 2 / Addons and Mods: Complete / Sounds Arma 2 / Addons and Mods: Complete / Units Arma 2 / Addons and Mods: Complete / Vehicles Arma 2 / Addons and Mods: Complete / Weapons Arma 2 / Addons and Mods: Complete / Other Arma 2 / Missions: Complete / Multiplayer missions Arma 2 / Missions: Complete / Singleplayer missions Arma 2 / Addons and Mods / Addon requests Arma 2 / Addons and Mods / Addons and Mods: WIP Armed Assault / General Discussion Armed Assault / Troubleshooting Armed Assault / Addons and Mods: Complete Armed Assault / Addons and Mods: Discussion Armed Assault / Missions: Complete Armed Assault / Missions WIP Armed Assault / Missions: Complete / Multiplayer missions Armed Assault / Missions: Complete / Singleplayer missions Armed Assault / Addons and Mods: Complete / Islands Armed Assault / Addons and Mods: Complete / Modules Armed Assault / Addons and Mods: Complete / Sounds Armed Assault / Addons and Mods: Complete / Units Armed Assault / Addons and Mods: Complete / Vehicles Armed Assault / Addons and Mods: Complete / Weapons Armed Assault / Addons and Mods: Complete / Other Armed Assault / Addons and Mods: Discussion / Addons and Mods: WIP Armed Assault / Addons and Mods: Discussion / Addon requests Advertising / Advertisement Site Related / Armaholic in general Site Related / Armaholic Subscription System Site Related / Armaholic in general / Announcements Offtopic / Chit chat Offtopic / Hardware and software Offtopic / Other Games Offtopic / Other Games / Arma: Cold War Assault / Operation Flashpoint Offtopic / Other Games / Take On Helicopters Offtopic / Other Games / Carrier Command: Gaea Mission Internation Forum / Français Internation Forum / Español Internation Forum / Dutch
Author
Message
Posts: 25
Rank:
Country:
Location: Christchurch, New Zealand
Occupation:
Age:
In-game name: madiba127
#1 Posted at 2011-01-08 00:38
i am new here and i have searched all over the place for the answer to my question but i can't find one
so what i am trying to do is have some AI shoot at targets (the practice Range Ones) but they don't, i would like them to do this over and over (forever) as i am trying to make a movie with ARMA II (so far so good) and it involves a training base where i am using AI as soldiers being trained
any one know how to get the AI to attack/shoot the range targets over and over again and in prone/crouch positions
sorry if I'm to hard to understand its hard to describe what i am trying to do
===Madiba127===
This post was edited by Foxhound (2011-01-24 11:20, ago)
Author
Message
Posts: 25
Rank:
Country:
Location: Christchurch, New Zealand
Occupation:
Age:
In-game name: madiba127
#2 Posted at 2011-01-14 08:20
ok so i take it that no one knows how to do this which i am fine with as this is not a high priority for me
Author
Message
Posts: 510
Rank:
Country:
Location: Baltimore, Maryland
Occupation:
Age:
In-game name:
#3 Posted at 2011-01-14 23:00
well it is possible as i have done it many times however, when i ported my template from A2 to A2OA it seemed to stop working..dont know why, i use the same code in but for some reason they only shoot the first magazine then quite, i use to have it set up so they would use a ammobox with infinite ammo(but man after awhile it got annoying lmao), im at work but ill try to upload a deamo to get you started untill i find an solution!
Dave,
"Respect is the key to life... with out it we have nothing"
Author
Message
Posts: 25
Rank:
Country:
Location: Christchurch, New Zealand
Occupation:
Age:
In-game name: madiba127
#4 Posted at 2011-01-16 21:18
thanks
Author
Message
Posts: 510
Rank:
Country:
Location: Baltimore, Maryland
Occupation:
Age:
In-game name:
#5 Posted at 2011-01-17 14:01
still have not had time to look into this, but try this for now and let me know! Target1 (the object the AI will shoot at), Gunman1 (the AI who will target your Object=Target1).
Gunman1 doTarget Target1; Gunman1 doFire Target1;
"Respect is the key to life... with out it we have nothing"
Author
Message
Posts: 753
Rank:
Country:
Location:
Occupation: *Retired from ArmA*
Age:
In-game name: Paly
#6 Posted at 2011-01-17 16:19
soldier2390 method worked ok, but not with all objects, just shooting range target (still testing)
This post was edited by palyarmerc (2011-01-19 01:15, ago)
....that's all folks....!
Author
Message
Posts: 510
Rank:
Country:
Location: Baltimore, Maryland
Occupation:
Age:
In-game name:
#7 Posted at 2011-02-02 16:54
yeah i noticed that too, seems to only work on targets and "Sometimes" other AI! however unfutunitly i find it way easier to have AI shoot there own guys, then the enemy lol!
"Respect is the key to life... with out it we have nothing"
Author
Message
Posts: 25
Rank:
Country:
Location: Christchurch, New Zealand
Occupation:
Age:
In-game name: madiba127
#8 Posted at 2011-03-17 08:34
so i decide to use the targets after changing a lot on my FOB but the ai only attack once and then stop, but i want them to keep attacking
Author
Message
Posts: 18
Rank:
Country:
Location:
Occupation:
Age:
In-game name:
#9 Posted at 2012-08-01 14:55
I have this script, It's the AI Fire script and an unlimited ammo script, try that
Gunman1 doTarget Target1; Gunman1 doFire Target1;this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}]
Author
Message
Posts: 23
Rank:
Level: Hidden
Country:
Location:
Occupation:
Age: 25
In-game name: Mohammed
#10 Posted at 2012-08-01 15:00
i really knows a bit about arma2 scripts but i think that should be a script or something to make the AI fire at specified area ??
Author
Message
Posts: 18
Rank:
Country:
Location:
Occupation:
Age:
In-game name:
#11 Posted at 2012-08-02 22:02
I actually got the answer [Thank you ltsThomas]
Heres the Script
Gunman1 doTarget Target1; Gunman1 doFire Target1;
this allowdamage false; this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}]
I tried it, it works, Have them fire at a vehicle like a Takistani Army UAZ, put this allowdamagefalse in the init and then add the usual targeting scripts to the people, name the UAZ Target1, the shooter Gunman1 and voila!
This post was edited by Seancm98 (2012-08-03 15:05, ago)
Author
Message
Posts: 24
Rank:
Country:
Location:
Occupation:
Age:
In-game name:
#12 Posted at 2013-04-02 20:32
So does this work?
Author
Message
Posts: 2
Rank:
Country:
Location:
Occupation:
Age:
In-game name:
#13 Posted at 2015-08-29 17:48
Found this script and got it running in Arma3 as I wanted to have some ambient shooting at the Kamino Shooting-Range. It seems this is only working on Training targets, which is fair enough for me. Unfortunatly my tanks only shoot once, but not repeatingly. Any suggestion how to adjust this script to let it run infinitely?
this doTarget Target1; this doFire Target1; this allowdamage false; this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}]
Author
Message
Posts: 59
Rank:
Country:
Location: Quebec
Occupation:
Age:
In-game name:
#14 Posted at 2015-08-29 18:26
Try this...
// CALL USING: nul = [unit_Name, _target_Name] execVM "fireRange.sqf";
private ["_Unit","_Target","_Group","_Magazine","_Primary","_CurrentWeapon","_WeaponMode","_Ammo"];
_Unit = _this select 0;
_Target = _this select 1;
while {true} do {
_Group = group _Unit;
_Magazine = primaryWeaponMagazine _Unit;
_PrimaryWeapon = primaryWeapon _Unit;
_CurrentWeapon = currentWeapon _Unit;
if (_CurrentWeapon != _PrimaryWeapon)
then {_Unit selectWeapon _PrimaryWeapon};
sleep 1;
_WeaponMode = currentWeaponMode _Unit;
_Ammo = _Unit ammo _PrimaryWeapon;
doStop _Unit;
_Group reveal _Target;
_Unit doTarget _Target;
_Unit doWatch _Target;
_Unit setBehaviour "COMBAT";
_Unit setCombatMode "YELLOW";
_Unit setUnitPos "MIDDLE";
if (_Ammo == 0 ) then {reload _Unit;};
sleep 1;
_Unit disableAI "TARGET";
_Unit disableAI "AUTOTARGET";
for [{_i = _Ammo},{_i > 0},{_i =_i-1}] do
{
_Unit forceWeaponFire [_PrimaryWeapon, _WeaponMode];
sleep (0.01+(random 1));
};
sleep 1;
reload _Unit;
};
Author
Message
Posts: 59
Rank:
Country:
Location: Quebec
Occupation:
Age:
In-game name:
#15 Posted at 2015-09-02 11:41
The previous example did not seem to work apparently... this one might...requires testing in-game.
// CALL USING: nul = [unit_Name, _target_Name] execVM "fireRange.sqf";
private ["_Unit","_Target","_Group","_Magazine","_Primary","_CurrentWeapon","_WeaponMode","_Ammo","_magazineClass"];
_Unit = _this select 0;
_Target = _this select 1;
while {true} do {
_Group = group _Unit;
_Magazine = primaryWeaponMagazine _Unit;
_PrimaryWeapon = primaryWeapon _Unit;
_CurrentWeapon = currentWeapon _Unit;
if (_CurrentWeapon != _PrimaryWeapon)
then {_Unit selectWeapon _PrimaryWeapon};
sleep 1;
_WeaponMode = currentWeaponMode _Unit;
_Ammo = _Unit ammo _PrimaryWeapon;
_magazineClass = currentMagazine _Unit;
doStop _Unit;
_Group reveal _Target;
_Unit doTarget _Target;
_Unit doWatch _Target;
_Unit setBehaviour "COMBAT";
_Unit setCombatMode "YELLOW";
_Unit setUnitPos "MIDDLE";
if (_Ammo == 0 ) then {reload _Unit;};
sleep 1;
_Unit disableAI "TARGET";
_Unit disableAI "AUTOTARGET";
for [{_i = _Ammo},{_i > 0},{_i =_i-1}] do
{
_Unit forceWeaponFire [_PrimaryWeapon, _WeaponMode];
sleep (0.01+(random 1));
};
sleep 1;
_Unit addMagazine _magazineClass;
sleep 1;
reload _Unit;
};