Jump to content
Sign in to follow this  
SPC.Spets

Help - Artillery with trigger

Recommended Posts

I need help with a trigger, a mortar Podnos 2B14 to shot 4 rounds into a mark and then another 4 rounds in another mark. I use this in the On Act trigger, as you can see, I have no too much idea how to use scripts

[group mortar, (getmarkerpos "arty1"), ["IMMEDIATE", "HE", 1, 4]] call BIS_ARTY_F_ExecuteTemplateMission;

waitUntil {_battery getVariable "ARTY_COMPLETE"};

[group mortar, (getmarkerpos "arty2"), ["IMMEDIATE", "HE", 1, 4]] call BIS_ARTY_F_ExecuteTemplateMission;

mortar is the name of the podnos, and arty1 and arty2 the marks. the mortar only shot 4 rounds in mark1 but then nothing more

---------- Post added at 02:11 PM ---------- Previous post was at 01:50 PM ----------

Im reading the Frequently asked but I dont understand a Sh... :s

the only thing I need is a mortar to shot some rounds at one position and then change target and shot another 4 rounds... and I dont have idea how to do that

Share this post


Link to post
Share on other sites

yes, I read all. but I cant figure out how...

because, I need it with a trigger, not with a player call

When some player walk into the trigger it activates and shoot those rounds in a specific "mark" then stop and shoot another rounds in other "mark"

Share this post


Link to post
Share on other sites

just place the code you have created in a trigger and synch it to the unit, or use this in a anyone present trigger condition.

unitname in thisList

Share this post


Link to post
Share on other sites

Don't use the module and fire mission calls and all that, just spawn the round where you want it.

The players won't hear the radio messages about the fire mission and you don't want to have the wait the full time, right? You want the player to step in the wrong spot and get bombed nearby right?

Keep things simple.

BLUFOR PRESENT trigger named round1

condition of:

boom = "R_57mm_HE" createVehicle getMarkerPos "mark";

NONE COUNTDOWN 5/5/5 trigger

condition of:

triggerActivated round1

and onAct of:

boom = "R_57mm_HE" createVehicle getMarkerPos "othermark";

They enter the first trigger and your mark one marker explodes. 5 seconds later the othermark marker explodes. You can even add "incoming" sound effects if you wanted.

Share this post


Link to post
Share on other sites

You should put that code you have in an script, then call the script from your trigger.

You should not use waitUntil or sleeps in init lines for triggers or objects.

One problem I see with your code is in your waitUntill condition, your using a local _battery but you never defined that to point to your arty battery. Also you should never use local varaibles in init boxes, I'm supprized you did not get an error for doing that.

-----------

Edit: Kylania has a good point, keep it simple.

Edited by Riouken

Share this post


Link to post
Share on other sites

create an artillery module on the map and name it mortar. Sync it to your Podnos 2B14.

Use the example below in a trigger.

example: nul = [mortar, getmarkerpos "one", 100, "IMMEDIATE", "HE", 4, 4] execVM "mortar.sqf"

mortar.sqf

_battery = _this select 0;
_mortarTgtPos = _this select 1;
_dispersion = _this select 2;
_mission_type = _this select 3;
_round_type = _this select 4;
_rate_fire = _this select 5;
_rounds = _this select 6;

_firemission = [_mission_type, _round_type, _rate_fire, _rounds];

if ( [ _battery, _mortarTgtPos, _fireMission select 1 ] call BIS_ARTY_F_PosInRange ) then 
{ [_battery, _dispersion] call BIS_ARTY_F_SetDispersion; [_battery, _mortarTgtPos, _fireMission] spawn BIS_ARTY_F_ExecuteTemplateMission };

Edited by cobra4v320

Share this post


Link to post
Share on other sites

yeah i missed the part with waitUntil, simple is often the best solution, but if you dont want the simple one, you cansue spawn to call script with sleeps and waituntils in trigger on act.

_null = [] spawn {
place your code here.
};

you need ofc to name the _battery part aswell.

Share this post


Link to post
Share on other sites

Here's two examples.

This one is super simple, it just spawns rounds in a random area of the marker. Based on code from someone a few days ago. Download.

This one is more complex, it relies on actual mortars with crew and an observer unit to speed up firinging. It includes the 'falling mortar' sound. Download.

Share this post


Link to post
Share on other sites

Thanks! I will try all, in fact Im testing it now :p

EDIT: ok, the simplest one is good enough, but, how do I put incoming mortar sound fx to it? :/

Edited by SpetS15

Share this post


Link to post
Share on other sites

im using kylania's method, however when i do it the first marker is repeatedly bombarded with shells for an infinite amount of time. any suggestions?

Share this post


Link to post
Share on other sites

Check the size of the trigger and make sure it's set to ONCE instead of REPEATEDLY. To be honest I made that at work just before heading to dinner, so it might have some issues. heh

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  

×