Jump to content

Recommended Posts

Hi there people, 

 

Is there a way to make a static artillery emplacement such as a mortar have an infinite range across an entire map via a script?

 

I don't like using the virtual combat support modules as I like to hear/see the artillery being fired from a base camp far from the front lines. I've used the ALiVE mod and MCC forward observer artillery interface before however these both still require the artillery gun to be in range. I don't want to have to move Artillery vehicles across the map to get within range ya see. 

 

Thanks in advance, 

 

- Jack 

 

  • Like 1

Share this post


Link to post
Share on other sites

Don't think there's a way other than making an addon and increasing its range. You could fake it by creating a mortar and firing it, wait a while based on distance and see the round come down. I still don't know if you would hear the mortar fire at extreme ranges, might be worth a shot. You could customize the virtual module to fake a launch at range, i still don't think you'd be able to see/hear it tho. So faking is the only way i see, unless you're willing to make an addon.

  • Like 1

Share this post


Link to post
Share on other sites
3 minutes ago, Floof said:

creating a mortar and firing it

 

There is a script from quicksilver , invade & annex that i was using :

( but you need to reedit this )

Spoiler

private ["_flatPos","_accepted","_position","_flatPos1","_flatPos2","_flatPos3","_PTdir","_unitsArray","_priorityGroup","_distance","_dir","_c","_pos","_barrier","_enemiesArray","_radius","_unit","_targetPos","_firingMessages","_fuzzyPos","_briefing","_completeText","_priorityMan1","_priorityMan2"];

	//____________________ 1. FIND POSITION ____________________

	_flatPos = [0,0,0];
	_accepted = false;
	while {!_accepted} do {
		_position = [[[getPos player,2500]],["water","out"]] call BIS_fnc_randomPos;
		_flatPos = _position isFlatEmpty [5, 0, 0.2, 5, 0, false];

		while {(count _flatPos) < 2} do {
			_position = [[[getPos player,2500]],["water","out"]] call BIS_fnc_randomPos;
			_flatPos = _position isFlatEmpty [5, 0, 0.2, 5, 0, false];
		};

		if ((_flatPos distance (getMarkerPos "respawn_west")) > 2000 && (_flatPos distance (getPos player)) > 800) then
		{
			_accepted = true;
		};
	};

	_flatPos1 = [(_flatPos select 0) - 2, (_flatPos select 1) - 2, (_flatPos select 2)];
	_flatPos2 = [(_flatPos select 0) + 2, (_flatPos select 1) + 2, (_flatPos select 2)];
	_flatPos3 = [(_flatPos select 0) + 20, (_flatPos select 1) + random 20, (_flatPos select 2)];
	
	//____________________ 2. SPAWN OBJECTIVES ____________________

	_PTdir = random 360;
	
	sleep 0.3;
	
	priorityObj1 = "O_MBT_02_arty_F" createVehicle _flatPos1;
	waitUntil {!isNull priorityObj1};
	priorityObj1 setDir _PTdir;
	
	sleep 0.3;
	
	priorityObj2 = "O_MBT_02_arty_F" createVehicle _flatPos2;
	waitUntil {!isNull priorityObj2};
	priorityObj2 setDir _PTdir;
	
	sleep 0.3;
	
	priorityObj1 addEventHandler ["Fired",{if (!isPlayer (gunner priorityObj1)) then { priorityObj1 setVehicleAmmo 1; };}];
	priorityObj2 addEventHandler ["Fired",{if (!isPlayer (gunner priorityObj2)) then { priorityObj2 setVehicleAmmo 1; };}];
	
	//______ SPAWN AMMO TRUCK (for ambiance and plausibiliy of unlimited ammo) ________
	
	ammoTruck = "O_Truck_03_ammo_F" createVehicle _flatPos3;
	waitUntil {!isNull ammoTruck};
	ammoTruck setDir random 360;
		
	{_x lock 3;_x allowCrewInImmobile true; } forEach [priorityObj1,priorityObj2,ammoTruck];
		
	//____________________ 3. SPAWN CREW ____________________

	sleep 1;

	_unitsArray = [objNull];
	
	_priorityGroup = createGroup INDEPENDENT;
	
		"I_C_Soldier_Bandit_7_F" createUnit [_flatPos, _priorityGroup];
		"I_C_Soldier_Bandit_7_F" createUnit [_flatPos, _priorityGroup];
		"I_C_Soldier_Bandit_3_F" createUnit [_flatPos, _priorityGroup];
		"I_C_Soldier_Bandit_3_F" createUnit [_flatPos, _priorityGroup];
		"I_C_Soldier_Bandit_3_F" createUnit [_flatPos, _priorityGroup];
		"I_C_Soldier_Bandit_3_F" createUnit [_flatPos, _priorityGroup];
		
		priorityGunner1 = ((units _priorityGroup) select 2);
		priorityGunner2 = ((units _priorityGroup) select 3);
		
		((units _priorityGroup) select 0) assignAsCommander priorityObj1;
		((units _priorityGroup) select 0) moveInCommander priorityObj1;
		((units _priorityGroup) select 0) assignAsDriver priorityObj1;
		((units _priorityGroup) select 0) moveInDriver priorityObj1;
		((units _priorityGroup) select 2) assignAsGunner priorityObj1;
		((units _priorityGroup) select 2) moveInGunner priorityObj1;
		
		
		
		((units _priorityGroup) select 1) assignAsCommander priorityObj2;
		((units _priorityGroup) select 1) moveInCommander priorityObj2;
		((units _priorityGroup) select 1) assignAsDriver priorityObj2;
		((units _priorityGroup) select 1) moveInDriver priorityObj2;
		((units _priorityGroup) select 3) assignAsGunner priorityObj2;
		((units _priorityGroup) select 3) moveInGunner priorityObj2;

	//[(units _priorityGroup)] call QS_fnc_setSkill4;
	_priorityGroup setBehaviour "COMBAT";
	_priorityGroup setCombatMode "RED";	
	_priorityGroup allowFleeing 0;
	
	_unitsArray = _unitsArray + [_priorityGroup];

	
	
	//____________________ 4. SPAWN H-BARRIER RING __________________
/*	
	sleep 1;

	_distance = 16;
	_dir = 0;
	for "_c" from 0 to 7 do {
		_pos = [_flatPos, _distance, _dir] call BIS_fnc_relPos;
		_barrier = "Land_HBarrierBig_F" createVehicle _pos;
		waitUntil {alive _barrier};
		_barrier setDir _dir;
		_dir = _dir + 45;
		_barrier allowDamage false; 
		_barrier enableSimulation false;
		
		_unitsArray = _unitsArray + [_barrier];
	};
*/	
	//_____________ 5. SPAWN FORCE PROTECTION________________


   //  _enemiesArray = [priorityObj1] call QS_fnc_PTenemyINDEPENDENT;

	//_______________________ 7. BRIEF ________________________

	_fuzzyPos = [((_flatPos select 0) - 300) + (random 600),((_flatPos select 1) - 300) + (random 600),0];
	{ _x setMarkerPos _fuzzyPos; } forEach ["priorityMarker", "priorityCircle"];
	
	priorityTargetText = "Artillery group";
	"priorityMarker" setMarkerText "Priority Target: Artillery group";

	_briefing = "<t align='center' size='2.4'>CAUTION</t><br/><t size='1.5' color='#b60000'>Artillery group</t><br/>____________________<br/>They are tracking your location<br/>BEWARE FOR INCOMING SHELLS !";
	GlobalHint = _briefing; hint parseText _briefing; publicVariable "GlobalHint";
	showNotification = ["NewPriorityTarget", "Artillery group"]; publicVariable "showNotification";

	_firingMessages = [
		"** Thermal scans are picking up the Artillery_group firing! Heads down! **",
		"** Artillery rounds incoming! Advise you seek cover immediately. **",
		"** Artillery INCOMING SHELLS! Seek cover immediately! **",
		"** The Artillery group is firing! We need to take them out! **",
		"** The Artillery group is presice. We have to act now! Seek & Destroy! **",
		"** MOVE NOW! INCOMING Artillery shells!  EVACUATE **"
	];
	
	//__________________ FIRING SEQUENCE LOOP _________________ 

	_radius = 80;
	
	while { canMove priorityObj1 || canMove priorityObj2 } do {

		_accepted = false;
		_unit = objNull;
		_targetPos = [0,0,0];
		
		while {!_accepted} do {
			
			if (isMultiplayer) then {
				_unit = playableUnits select (floor (random (count playableUnits)));
			} else {
				_unit = switchableUnits select (floor (random (count switchableUnits)));
			};
			
			if (!isNull _unit) then {
				_targetPos = getPos _unit;
				
				if ((_targetPos distance (getMarkerPos "respawn_west")) > 1000 && vehicle _unit == _unit && side _unit == WEST) then { 
					_accepted = true; 
				} else {
					sleep 7;																// default 10
				};
			};
			sleep 3;
		};
		
		if (PARAMS_ArtilleryTargetTickWarning == 1) then {
			hqSideChat = _firingMessages call BIS_fnc_selectRandom; publicVariable "hqSideChat"; [WEST,"HQ"] sideChat hqSideChat;
		};
		
		_dir = [_flatPos, _targetPos] call BIS_fnc_dirTo;
		
		{ _x setDir _dir; } forEach [priorityObj1, priorityObj2];
		
		sleep 5;																		// default 5
		
		{
			if (alive _x) then {
				for "_c" from 0 to 4 do {
					_pos = 
					[
						(_targetPos select 0) - _radius + (2 * random _radius),
						(_targetPos select 1) - _radius + (2 * random _radius),
						0
					];
					_x doArtilleryFire [_pos, "32Rnd_155mm_Mo_shells", 1];
					sleep 8;															// default 8
				};
			};
		} forEach [priorityObj1,priorityObj2];
		
		if (_radius > 10) then { _radius = _radius - 10; };
		
		if (PARAMS_ArtilleryTargetTickTimeMax <= PARAMS_ArtilleryTargetTickTimeMin) then {
			sleep PARAMS_ArtilleryTargetTickTimeMin;
		} else {
			sleep (PARAMS_ArtilleryTargetTickTimeMin + (random (PARAMS_ArtilleryTargetTickTimeMax - PARAMS_ArtilleryTargetTickTimeMin)));
		};
	};

	//______________________________ DE-BRIEF __________________________

	_completeText = "<t align='center' size='2.4'>SAFE</t><br/><t size='1.5' color='#08b000'>NEUTRALISED</t><br/>____________________<br/>Artillery group is out.";
	GlobalHint = _completeText; hint parseText _completeText; publicVariable "GlobalHint";
	showNotification = ["CompletedPriorityTarget", "Artillery group Neutralised"]; publicVariable "showNotification";
	{ _x setMarkerPos [-10000,-10000,-10000] } forEach ["priorityMarker","priorityCircle"]; publicVariable "priorityMarker";

	//______________________________ DELETE _____________________________

	sleep 300; 		//300														
	{ _x removeEventHandler ["Fired", 0]; } forEach [priorityObj1,priorityObj2];
//	{ [_x] spawn QS_fnc_SMdelete } forEach [_enemiesArray,_unitsArray];
	{ deleteVehicle _x } forEach [priorityObj1,priorityObj2,ammoTruck];	

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

@Floof Making an addon using the Scorcher is defiantly doable I imagine it wouldn't take much work if there is a simple "Range" parameter I can edit or something. 

 

@GEORGE FLOROS GR This is very interesting mate, i'll have a play around with this when I have some more spare time. 

 

Cheers lads!  

  • Thanks 1

Share this post


Link to post
Share on other sites

As I mentioned in your other topic, all vanilla artillery pieces except for the Mk6 mortar can fire at ranges exceeding 50km. 

  • Like 1

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

×