Home   Help Search Login Register  

Author Topic: Artillery screen  (Read 1631 times)

0 Members and 1 Guest are viewing this topic.

Offline Dajan

  • Members
  • *
Artillery screen
« on: 23 Sep 2010, 21:12:22 »
Couldn't find anything directly relevant, if you can redirect please do

Ever seen We Were Soldiers? Alright movie I guess, but I ask as watching it marked the beginning of me realising that artillery can be used for defense instead of as a tool for attack. Specifically the shelling that was called down by the lost platoon every time they heard so much as a twig snap.

Lengthy preamble? It gets longer:-

I've tried on several occasions to recreate the scene, getting close in Arma by using a GL on a patrol route to trigger spawned bangs. I'm not going for a player or AI aimed afair here you understand - just a wall of random explosions that thin out attacking AIs. Of course this method did lead to ordnance making repeated hits on the same spot, but it wasn't too noticable.

What was all that about you ask? Well I'm trying to find a way to do the same in ArmaII:CO, but if possible without having to create so many triggers. That method seemed a little prone to failiure the first time round.
Does anyone have any ideas of other ways to do it? And as an aside, does anyone know of a way to stop your own side from blundering into the killzone?

Offline Pirin

  • Members
  • *
Re: Artillery screen
« Reply #1 on: 24 Sep 2010, 02:54:45 »
Just random shelling?  Here ya go, adapted from the BAF mortar attack script.

Create a Trigger on map, name of impactArea with a condition of mortarFalling and a Voice Effect of Mortar 1

Ran by:
Code: [Select]
// begin mortar shelling, mortar1 - mortar3 are objects, destroy them to stop the shelling.
{nul = [getpos tankBase, _x, tankBase] execVM "scripts\mortars.sqf";} forEach [mortar1, mortar2, mortar3];

mortars.sqf:
Code: [Select]
_targetPos = _this select 0;
_mortar = _this select 1;
_observer = _this select 2;
_tracking = if (count _this > 3) then {_this select 3} else {false}; // Optional tracking, added by kylania

_observerCoef = 1;

while {alive _mortar} do {
if (_tracking) then {_targetPos = getPos (vehicle player)}; // Optional tracking, added by kylania
//if (!(alive _observer)) then {_observerCoef = 3};
_randomPos = [_targetPos, (random 150) * _observerCoef, random 360] call BIS_fnc_relPos;
//{if (_randomPos distance _x < 5) then {_randomPos = [position _x, 5, random 360] call BIS_fnc_relPos}} forEach units player;
impactArea setPos _randomPos;
mortarFalling = TRUE;
publicVariable "mortarFalling";
sleep 1.75;

_shell = "Sh_85_AP" createVehicle _randomPos;
mortarFalling = FALSE;
publicVariable "mortarFalling";

sleep ((2 + random 3) * _observerCoef)
};

Demo Mission available.
« Last Edit: 24 Sep 2010, 02:56:30 by Pirin »

Offline Dajan

  • Members
  • *
Re: Artillery screen
« Reply #2 on: 24 Sep 2010, 23:41:12 »
OOO!  :scratch: Looks good, will have a play ASAP
Mucho gracias  :good: