Jump to content
Sign in to follow this  
CaptainBravo

enemy artillery ?

Recommended Posts

Hi McSpuds,

"i say again", most of the credit really needs to go to inkompetent for that script, i just twisted it to my own evil ends ;)

There are far more learned people on these forums who are giving advice, I just tried to make the explanations clear from the point of view of someone who knows absolutely nothing, as at that time I knew only slightly more than absolutely nothing!

Glad to see it worked for you. :)

regarding your problem

No entry 'bil\config.bin/CfgMagazines.2b14_82mm'.

I think it could just be as simple as not giving it the correct magazine classname, did i really say this addmagazine "2b14_82mm"? :eek:

Seems I did, I do apologise - from the class list, it should be as follows:

All the Russian, CDF, Guerilla, Takistani mortars use

ARTY_8Rnd_82mmHE_2B14

And US forces

ARTY_8Rnd_81mmHE_M252

:yay:???

Share this post


Link to post
Share on other sites

by the way McSpuds if you are getting into this stuff, I heartily recommend you to install

http://forums.bistudio.com/showthread.php?t=105860

for looking at and editing sqf files

Gave me the confidence to move up a level and start regularly using "scary" things like if then else and foreach loops.

before: what's with all the curly brackets, why do some have a ; afterwards and others not? :confused:

after: :pet7: (smurf as i am in Belgium)

Share this post


Link to post
Share on other sites
Hey everyone,

I am searching for a script where enemy uses artillery against you?

Does such script exist?

Thanks for your help in advance.

Im my new Taliban Mission Mortars are very important.You use Mortars and the Enemy use Mortars.

I used 2 Scripts.Own Mortar is controlled by the brilliant "R3F Arty and Logistics" Script.I love it.

The Enemy Artillery is controlled by the "Forward Observer" Script.

This is very good and easy,make a Battery of enemy Artillery,sync it with ari module and name the Module.Then copy the Code of Script to the Inti of Soldiers who shall act as forward observers.

When the FO spots Players he will order Artillery fire on them,you can set the Range too its default 500 i increased to 1500.

Share this post


Link to post
Share on other sites

Ashram, could I ask a favor of you?

I need to do two things with the script. I can not get it right.

I need the chat to stop. I tried to delete the player chat but it stops working.

I also need to see if I can get the mortars to fire smoke. Is this possible.

Share this post


Link to post
Share on other sites

hi mcspuds, you're in luck - i just started a two week holiday so time won't be a problem. i'll try and sort it out today. in fact, it had better be today before the british forces are released, or you might have to wait a long time :D

not sure about the smoke, is there even a smoke or illumination round for the mortars???? hmmm can't find anything in the classnames list

ahh, trusty googles:

http://tactical.nekromantix.com/tactical/wiki/doku.php?id=arma2:editor_modules:artillery_examples

ARTY_8Rnd_82mmWP_2B14

ARTY_8Rnd_82mmILLUM_2B14

the debug chat stuff shouldnt be a problem though to remove, just something i never got round to.

---------- Post added at 12:32 PM ---------- Previous post was at 11:34 AM ----------

right then, i don't believe there is a smoke round for the mortars, you will just have to use WP :evil:

change the trigger activation stuff to:

firemission = ["IMMEDIATE","WP",0,[b]4[/b]]; nul=[getPosASL (thisList select 0)] execVM "mortar.sqf";

note that i changed it from 8 rounds of HE to 4 rounds of WP, adjust to taste

add WP magazine(s) to all the mortar units' init boxes:

this addMagazine "ARTY_8Rnd_82mmWP_2B14";

in mortar.sqf change the "true" on the first line to "false", which will turn off most of the debugging. there are also a couple of lines in the script with the hint command. comment those lines out with // at the beginning. also do the same for the lines which create and delete the marker so nothing appears on the map.

updated version:

#define __debug false
private "_mortarTgtPos";
_mortarTgtPos = _this select 0;

if (__debug) then { player sideChat "Executing mortar.sqf" };

if ([iNS_mortar, _mortarTgtPos, fireMission select 1] call BIS_ARTY_F_PosInRange) then
{	
[iNS_mortar, 200] call BIS_ARTY_F_SetDispersion;
[iNS_mortar, _mortarTgtPos, fireMission] spawn BIS_ARTY_F_ExecuteTemplateMission;
//hint "mortars: Firing.";
//_mrk = createMarker ["MortarTarget", _mortarTgtPos];
//_mrk setMarkerColor "ColorBlack";
//_mrk setMarkerShape "ICON";
//_mrk setMarkerType "mil_objective";

waitUntil {INS_mortar getVariable "ARTY_ONMISSION"};
if (__debug) then { player sideChat "mortars are on a mission" };
if (__debug) then { player sideChat format["ammo used: %1", INS_mortar getVariable "ARTY_AMMO"] };
waitUntil {INS_mortar getVariable "ARTY_COMPLETE"};
if (__debug) then { player sideChat "mortars have finished fire mission" };
waitUntil {INS_mortar getVariable "ARTY_SPLASH"};
if (__debug) then { player sideChat "mortars about to splash!" };

sleep 10;

//deleteMarker _mrk;
}
else
{
//hint "mortars: Target out of range";
};

if (__debug) then { player sideChat "Exiting mortar.sqf" };

Share this post


Link to post
Share on other sites

quick question?

I been reading all this info on here, which is freegin awsome I might add...you guys are insanely good at this stuff!!

lol some is a bit too techy for me as I just like to fiddle in the editor....imagination is a great thing :p

Anywhoz, been playin with the FO script, great job BTW....

My question is, can I intergrate any of the arty stuff with the 8.8 in the 31st mod?

like, instead of having to use a modern russian mortar pr D30, can I use any of the WW2 equipment to fire arty rounds?

I used the script and just replaced the mortar with an 88 but to no avail...any way to make these work?

Share this post


Link to post
Share on other sites

I still can not get these scripts to work by themselves. The mortar script and the FO script. When I use both, it works wonderfully. But separate them and nothing works.

Here is what I have to get it to work. I need to see if I can get the script to work with the D30 instead because it has dedicated smoke rounds...

1. I create 3 Podnos mortars grouped.

in int I place:

this addMagazine "ARTY_8Rnd_82mmHE_2B14";

2.. I create a Module named RU_mortar

3. I sync Module with mortar leader

4. I create the trigger, 3000x3000 to cover area and set to activate BLUFOR detect by OPFOR, REPEAT

on act:

firemission = ["IMMEDIATE","HE",0,8]; nul=[getPosASL (thisList select 0)] execVM "mortar.sqf";

5. I create FO and in int I add:

crap = [this, RU_mortar, 1, west] execVM "fo\forward_observer.sqf";

I have the following sqf file in the mission folder named "mortar"

#define __debug false
private "_mortarTgtPos";
_mortarTgtPos = _this select 0;

if (__debug) then { player sideChat "Executing mortar.sqf" };

if ([iNS_mortar, _mortarTgtPos, fireMission select 1] call BIS_ARTY_F_PosInRange) then
{	
[iNS_mortar, 200] call BIS_ARTY_F_SetDispersion;
[iNS_mortar, _mortarTgtPos, fireMission] spawn BIS_ARTY_F_ExecuteTemplateMission;
//hint "mortars: Firing.";
//_mrk = createMarker ["MortarTarget", _mortarTgtPos];
//_mrk setMarkerColor "ColorBlack";
//_mrk setMarkerShape "ICON";
//_mrk setMarkerType "mil_objective";

waitUntil {INS_mortar getVariable "ARTY_ONMISSION"};
if (__debug) then { player sideChat "mortars are on a mission" };
if (__debug) then { player sideChat format["ammo used: %1", INS_mortar getVariable "ARTY_AMMO"] };
waitUntil {INS_mortar getVariable "ARTY_COMPLETE"};
if (__debug) then { player sideChat "mortars have finished fire mission" };
waitUntil {INS_mortar getVariable "ARTY_SPLASH"};
if (__debug) then { player sideChat "mortars about to splash!" };

sleep 10;

//deleteMarker _mrk;
}
else
{
//hint "mortars: Target out of range";
};

if (__debug) then { player sideChat "Exiting mortar.sqf" };

In a folder named "FO" I have two sqf files, one named forward_observer:

sleep 5;	// This needs to be figured out better, probably needs to watch the arty modules and see when they are done with init.
_fo 		= _this select 0;
_battery 	= _this select 1;
_wait 		= _this select 2; //this is in minutes, min 2 minutes;
_side 		= _this select 3;
_isAssigned = _fo getVariable "FO_Assigned";

_forceMultiplier = 1;

_lastMission = [-10000,-10000,0];

if (_wait < 0.5) then { _wait = 0.5; };

if (isNil "_isAssigned") then {
_fo setVariable ["FO_Assigned", 1, true];
while {(alive _fo and [_battery] call BIS_ARTY_F_StillViable)} do {
	_mostCount = 0;
	_target = null;
	_units = nearestObjects [_fo, ["LandVehicle", "CAManBase"], 500];
	//player sideChat "Looking for targets...";
	{
		if (side _x == _side and alive _x) then {
			//player sideChat "Found...";
			_liveCount = 0;
			_objects = [];

			_near = nearestObjects [_x, ["LandVehicle", "CAManBase"], 100];
			_liveCount = 0;
			_objects = [];
			{
				if(side _x == _side and alive _x and (damage _x) < 0.5) then {
					_liveCount = _liveCount + 1;
					_objects = _objects + [_x];
				};
			} forEach _near;



			if(_liveCount > _mostCount and (_x distance _lastMission) > 120) then {
				_forceMultiplier = 1;
				//player sideChat format["Distance from last mission: %1", (_x distance _lastMission)];
				_tanks = "Tank" countType _objects;
				_forceMultiplier = _forceMultiplier + (_tanks * 0.33);
				_apcs = "Wheeled_APC" countType _objects;
				_forceMultiplier = _forceMultiplier + (_apcs * 0.25);
				_mostCount = _liveCount;
				_lastMission = getPos _x;
				if((leader _x) != _x and ((leader _x) distance _x) <= 100) then {
					_target = leader _x;
				} else {
					_target = _x;
				};
			};
			//player sideChat format["Objects near %1: %2", _x, (count _near)];
			sleep 0.025;
		}
	} forEach _units;
	if( isNil "_target") then {
		_lastMission = [-10000,-10000,0];
		//player sideChat "No targets found near the FO";
	} else {

		//player sideChat format["Target is: %1 counting for %2 units total.", _target, _mostCount];

		//player sideChat format["Executing fire mission on %1", _target];
		_fo setVariable ["FO_MissionComplete", false, true];
		crap = [_battery, _target, _mostCount, _fo, _forceMultiplier] execVM "fo\engage.sqf";
		//player sideChat "Waiting for FO to finish mission";
		waitUntil { _fo getVariable "FO_MissionComplete"; };
		//player sideChat "FO has finished mission";
	};
	//player sideChat format["Waiting %1 minutes till next search.", _wait];
	sleep (round (_wait*60));
}
} else {
//player sideChat "FO is already searching for targets";
};
//player sideChat format["FO %1 is no longer operating!", _fo];

and a file named engage:

_battery 		= _this select 0;
_target			= _this select 1;
_targetCount	= _this select 2;
_fo				= _this select 3;
_fm				= _this select 4;
_pieces 		= count (units (_battery getVariable "ARTY_LEAD"));
_rounds 		= (ceil ((ceil (_targetCount/2) max 2)*_fm))*_pieces;
_rounds         = _rounds min (_pieces*8);

if(_rounds > 2) then {
_rounds = (_rounds + (_rounds % 2));
};
_mission 		= ["IMMEDIATE", "HE", 0, _rounds];

if(_rounds > 2 and ((ceil (random 9) > 6))) then {
// Do adjust fire mission!
// Number of adjustments to do.
_adjustments = (ceil (random 2) max 1); 
//player sideChat format["Firing %1 adjustment rounds", _adjustments];
while {_adjustments > 0} do {
	_adjustX = ((round (random 50)) + (_adjustments*75));
	_adjustY = ((round (random 50)) + (_adjustments*75));
	if( round (random 1) == 0) then {
		_adjustY = _adjustY*-1;
	};
	if( round (random 1) == 0) then {
		_adjustX = _adjustX*-1;
	};

	_targetPos = getPosASL _target;
	_adjustPoint = [((_targetPos select 0) + _adjustX), ((_targetPos select 1) + _adjustY), _targetPos select 2];
	//player sideChat format["Firing adjustment at: %1", _adjustPoint];
	[_battery, _adjustPoint, ["IMMEDIATE", "WP", 0, 1]] call BIS_ARTY_F_ExecuteTemplateMission;
	waitUntil {_battery getVariable "ARTY_ONMISSION"};
	//player sideChat "Adjust mission started";
	waitUntil {!(_battery getVariable "ARTY_ONMISSION")};
	//player sideChat "Adjust mission ended";
	waitUntil {_battery getVariable "ARTY_SPLASH"};
	//player sideChat "adjust splash";
	sleep 15;
	_adjustments = _adjustments - 1;
};
//player sideChat "Adjustments complete, firing for effect!";
};
//player sideChat format["%1: firing for effect %2 rounds", _battery, _rounds];
[_battery, ((round (_rounds*12.5)) min 200)] call BIS_ARTY_F_SetDispersion;
[_battery, (getPosASL _target), ["IMMEDIATE", "HE", 0, _rounds]] call BIS_ARTY_F_ExecuteTemplateMission;
waitUntil {_battery getVariable "ARTY_ONMISSION"};
//player sideChat format["%1: FFE mission started", _battery];
waitUntil {!(_battery getVariable "ARTY_ONMISSION")};
//player sideChat format["%1: FFE mission ended", _battery];
waitUntil {_battery getVariable "ARTY_SPLASH"};
//player sideChat format["%1: FFE splash", _battery];
sleep 10;
_fo setVariable ["FO_MissionComplete", true, true];

Share this post


Link to post
Share on other sites

Anyone still pay attention to this thread?

If so my other question is, does the artillery keep a safe distance from the fo when giving fire orders?

Like....if I am using the FO and I approach an enemy unit at 50m will the arty still drop even tho the unit is so danger close?

If so can this be changed to a minimum safe distance?

Share this post


Link to post
Share on other sites

He will kill himself, the AI does not recognize "Danger Close"... lol

Share this post


Link to post
Share on other sites

I have similar problem with my own enemy artillery system. During the initial phase, closeby AI will be recognized and accounted for, if AI is close then smoke will be used instead. The problem is, a lot of things can change during flight time :p It's not feasible to check what every AI intends to do.

The options:

1) Let AI kill their own. It's a fairly common event irl, but nothing near what I'm seeing in my mission :)

2) Before impact, scan the target area and either move the round to somewhere safe (call it a miss), or replace it with smoke.

50m is not danger close, it's well within the kill zone. By default, unless otherwise specified by the FO, FDC assumes a 100m aiming radius as dispersion pattern. That's big enough to cover an entire grid and then some. For gaming purposes, I guess it's safe to assume a smaller size though. Isn't 600m the (155mm) distance where a mission changes into danger close? Bigger even for rocket artillery and the big naval guns.

Share this post


Link to post
Share on other sites

Right on...thanks.

Ill just stop sending the FO with other units....Leave him back at a certain distance I guess.

Using a UAV works sometimes but only when flyin around 150m....doesnt last long when AA is around tho.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×