Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
ssm4862

artillery error

Recommended Posts

how i make the enemies shooting artilleries at my base for example?

The following script does not work.

/*

artillery example based on marker size.

By Demonized

Place functions module on map.

Place artillery module on map, name it in name field (in this example its art1)

Place a virtual artillery on map and synchronize it to artillery module.

Place more virtual artillerys and group them to first one (above) 3 total is used in this example.

Place a empty marker, name it: target_marker, make it rectangle, any size but keep it same sides, meaning size should be 100 100 or 399 399 as dispersion is based on a square size.

Place this in init.sqf:

// starting artillery.

artillery = false;

_null = ["target_marker",art1] execVM "arty_test.sqf";

Start the whole thing with radio trigger or something similar with this in on act:

artillery = true;

Pause the whole thing again with another trigger or something similar with this in on act:

artillery = false;

*/

_targetMarker = _this select 0;

_batteryLeader = _this select 1;

_size = 200; // dispersion used if not using markersize.

_debug = true; // display help player sidechats if true, if false, no player sidechats.

_barrageAdjust = 20; // this is how much area size is deivided n to get amount of shells / barrage, set to lower to get more shells, higher to get less shells.

// is function module active?, if not wait for function module to be activated.

waituntil {!isnil "bis_fnc_init"};

// this checks if you have triggered the radio trigger to activate artillery barrages.

waitUntil {artillery};

if (_debug) then {player sidechat "Artillery is starting, it will take a minute until first shells to arrive"};

while {true} do {

// get the size of the marker and use that as dispersion value, firing all over inside marker area.

_sizeM = getMarkerSize _targetMarker;

_size = (((_sizeM select 0)+(_sizeM select 1))/2);

if (_debug) then {player sidechat format["size of area is %1",_size]};

// determine amount of shells based on total area size / _barrageCnt - 500 big size makes it 25 shells / barrage.

_barrageCnt = _size/_barrageAdjust;

// waituntil artillery is ready to fire again.

waitUntil {([_batteryLeader] call BIS_ARTY_F_Available)};

if (_debug) then {player sidechat "artys are ready"};

// this will define what type of arty it is, in this case its d30 artillery.

[_batteryLeader, "D30"] call BIS_ARTY_F_SetVirtualGun; // Virtual D30

// make the shells spawn in the air if true, if false they can hit mountains if placed badly.

[_batteryLeader, true] call BIS_ARTY_F_SetShellSpawn;

// set the size/dispersion of fire area.

[_batteryLeader, _size] call BIS_ARTY_F_SetDispersion;

// this will do the actual firing, 1 second between each arty unit in group total area size / _barrageCnt pr barrage.

[_batteryLeader, (getMarkerPos _targetMarker), ["IMMEDIATE", "HE", 1, _barrageCnt]] call BIS_ARTY_F_ExecuteTemplateMission;

waitUntil {_batteryLeader getVariable "ARTY_ONMISSION"};

if (_debug) then {player sidechat "The battery is on a mission"};

waitUntil {_batteryLeader getVariable "ARTY_COMPLETE"};

if (_debug) then {player sidechat "Artillery is rounds complete"};

// check if it can continue else wait until it can continue.

if (!artillery) then {

if (_debug) then {player sidechat "Artillery is barrage is paused"};

waitUntil {artillery};

};

};

Share this post


Link to post
Share on other sites

place the script in a php code so we can read it properly, and that script is not the one that is posted where you found it.

this line is wrong:

[_batteryLeader, "D30"] call BIS_ARTY_F_SetVirtualGun; // Virtual D30

_read the artillery module wiki on BIS_ARTY_F_SetVirtualGun, also look into foreach command to fix it.

Also functions module is not needed, look in original post.

And why are you posting the same questions in 10 seperate posts??

Im done here.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×