Jump to content
Sign in to follow this  
tlwhite0311

Editing Question

Recommended Posts

Hey im creating a mission on the desert map where you are in a fireteam in teh back of an LAV and you come up on the oil rig and clear it of a small contingent of enemy soldiers. I would like after that to add a few incoming enemy mortars to hit near your pos and then your team would have to go look for the enemy mortar pos. Just wondering how i could do this. thanks.

Be advised im a newb scripter so extra explanation would be helpful. Thanks.

Share this post


Link to post
Share on other sites

Is it a singleplayer or multiplayer mission?

And welcome to editing.

Share this post


Link to post
Share on other sites

I did something similar - here it is for single player. You can use any of the mortar scripts that people have written - look at armaholic.com.

With this method there is a delay as the mortars fly from the tubes to target.

Blufor end

You need a target object or marker - then put the following in a trigger (or series of triggers, each one sets off a volley of mortars - add extra targets/markers). blufor, once, present.

For object: OnAct

fireMission = ["IMMEDIATE", "HE", 0, 6]; nul = [getposasl [color="Red"]targetobject1[/color]] execvm "mortars.sqf";

For marker: OnAct

fireMission = ["IMMEDIATE", "HE", 0, 6]; nul = [getmarkerpos [color="Red"]"marker1"[/color]] execvm "mortars.sqf";

mortars.sqf save this to the mission folder.

//you need an Arty module named opfor_mortar on the map and synchronised with a crewed mortar

_mortarTgtPos = _this select 0;

if ([opfor_mortar, _mortarTgtPos, fireMission select 1] call BIS_ARTY_F_PosInRange) then

{

[opfor_mortar, _mortarTgtPos, fireMission] spawn BIS_ARTY_F_ExecuteTemplateMission;

_mrk = createMarker ["MortarTarget", _mortarTgtPos];

_mrk setMarkerColor "ColorRed";

_mrk setMarkerShape "ICON";

_mrk setMarkerType "mil_objective";

waitUntil {opfor_mortar getVariable "ARTY_ONMISSION"};

waitUntil {opfor_mortar getVariable "ARTY_COMPLETE"};

waitUntil {opfor_mortar getVariable "ARTY_SPLASH"};

sleep 10;

deleteMarker _mrk;

}

else

{

hint "mortar not fired: out of range or no named arty module or perams not defined.";

};

Opfor end

You need an artillery module named opfor_mortar.

The artillery module must be synchronised with a manned mortar. Edit: (You can sync the module with more than 1 mortar - I have used 2 or 3 in my missions).

You can have an empty mortar just make someone (named mortarman) get in it before blufor get to the trigger. Name the mortar "mortar" in this case. You could put this in mortarman's init.

mortarman assignAsGunner mortar;  [mortarman] orderGetIn true;

Extra fun

Have the mortar crew run away once discovered, you need a runaway marker:

Trigger blufor, once, present.

OnAct:

[mortarman] orderGetIn false; mortarman doMove getMarkerPos "runaway";

---------- Post added at 13:11 ---------- Previous post was at 12:57 ----------

If you need instant mortars this script by JimSolo is excellent, you can use it at the same time as the above:

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Immersion Fire Support Script. by:JimSolo

// Version 1.0

// License: Public (free to use & modify)

//-----------------------------------------------------------------------------------------------------------

// Special Thanks to: Joshii & CarlGustaffa

//

// Instructions - Create Marker named "target1"

// Instructions - Create Trigger with init: _anyname = ["target1","ARTY_Sh_82_HE",24] execVM "FireSupport.sqf";

// Instructions - Place Marker whereever you want fireworks.

//

// Notes: You can replace ammo type "ARTY_Sh_82_HE" with whatever suits your needs.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

explosive = "ARTY_Sh_82_HE"; // Type of weapon B_30mm_HE

ammount = 0; // Counter to get unique vehicle names

while { true } do // Infinite loop

{

impactZone = getMarkerPos "target1"; // Impactzone

_randomnumberx = ceil(random 2); // Creating a random number result is either 1 or 2

_randomnumbery = ceil(random 2); // Creating a 2nd random number

_impactx = impactZone select 0; // assigning the x value of the impactzone to the variable

_impacty = impactZone select 1; // same with the y value

switch(_randomnumberx) do // Using the random number to either add or subtract an ammount to / of the x value otherwise the artillery would always be infront or behind the player

{

case 1: { _impactx = _impactx + (random(100));}; // If 1 is the random number

case 2: { _impactx = _impactx - (random(100));}; // If 2 is the random number

};

switch(_randomnumbery) do // Using the random number to either add or subtract an ammount to / of the y value this will make the impact left / right random.

{

case 1: { _impacty = _impacty + (random(100)); };

case 2: { _impacty = _impacty - (random(100)); };

};

_vehiclename = format ["shell%1", ammount]; // Formating a unique name

_vehiclename = explosive createVehicle ([_impactx, _impacty, 10]);

ammount = ammount + 1; // Changing the ammount + 1 so the name stays unique

sleep 5; // So it's not 10 impacts per second and CPU cooldown

};

---------- Post added at 13:34 ---------- Previous post was at 13:11 ----------

To tell your player to go look for the mortars you could use in a trigger:

onAct:

hint "Mortars from the South East - go take em out!";

or

taskhint ["Take out mortars to South East\nlocation marked on map!", [1, 1, 1, 1], "taskCurrent"];

To create a marker on the map where the mortars are thought to be add this after one of the above:

marker = createMarker ["mortar_mkr1", getPos mortarman];
marker setMarkerShape "ELLIPSE";
marker setMarkerSize [40, 40];
marker setMarkerColor "ColorRed";
marker setMarkerBrush "FDIAGONAL";

Edited by PELHAM

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  

×