Jump to content
Sign in to follow this  
hellcattz

I found supressive fire script in ARMA3 Adapt Campaing

Recommended Posts

Am.. first plz reading this script.

//Parameters

private ["_unit", "_target", "_roundsPerBurst", "_delayBetweenBursts", "_delayBetweenShots", "_condition"];

_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param;

_target = [_this, 1, [0,0,0], [[]]] call BIS_fnc_param;

_roundsPerBurst = [_this, 2, 20, [0]] call BIS_fnc_param;

_delayBetweenBursts = [_this, 3, 2, [0]] call BIS_fnc_param;

_delayBetweenShots = [_this, 4, 0.2, [0]] call BIS_fnc_param;

_condition = [_this, 5, { true }, [{}]] call BIS_fnc_param;

//The magazine type so we can add magazines if needed

private ["_magazines", "_magazine"];

_magazines = getArray (configfile >> "CfgWeapons" >> primaryWeapon _unit >> "magazines");

_magazine = _magazines select 0;

//The relative direction between unit and target

private "_direction";

_direction = [_unit, _target] call BIS_fnc_dirTo;

//Prepare unit

_unit disableAi "MOVE";

_unit disableAi "ANIM";

//The shots fired

private "_shotsFired";

_shotsFired = 0;

//Main loop

while { alive _unit && _condition } do {

//In deed to reload weapon?

if (needReload _unit < 1) then {

//Add magazines

if ({ _x == _magazine } count magazines _unit < 2) then {

_unit addMagazine _magazine;

};

//The shots fired

_shotsFired = _shotsFired + 1;

if (_shotsFired >= _roundsPerBurst) then {

//Reset counter

_shotsFired = 0;

//Delay between bursts

sleep _delayBetweenBursts;

} else {

//Force unit to fire his weapon

_unit setDir _direction;

_unit doWatch _target;

_unit selectWeapon primaryWeapon _unit;

_unit forceWeaponFire [primaryWeapon _unit, "Manual"];

//Delay between each shot

sleep _delayBetweenShots;

};

} else {

sleep 1;

};

};

//Enable AI

_unit enableAi "MOVE";

_unit enableAi "ANIM";

//Log

["Unit (%1) stopped suppressing fire", _unit] call BIS_fnc_logFormat;

now here is my question.

I found supressive fire script in ARMA3 Adapt Campaing. but my script Knowledge is so bad. I don't know C+ I just liteweight ARMA 3 user. I thought

private ["_unit", "_target", "_roundsPerBurst", "_delayBetweenBursts", "_delayBetweenShots", "_condition"];
this line is somekind of clue of script activation code. so I tested very very many time to use this script. but I can't use it. I wanna how to start and end this script. can anyone help me?

P.S extracting official pbo file are somekind of illegal behavior?. if it is illegal behavior. I delete my post. and sorry to BIS

Share this post


Link to post
Share on other sites

Looking at PBOs is fine.

If you want to figure out the script, open up the PBO for the mission in which it is used (the FOB attack) and look at all the editor elements.

Share this post


Link to post
Share on other sites
Looking at PBOs is fine.

If you want to figure out the script, open up the PBO for the mission in which it is used (the FOB attack) and look at all the editor elements.

um... I already do that. When I open that mission I found just some empty object in that mission. I can't find trigger. Anyway arma3 campaing is make something differnet way then another arma series. they called every script without mission editor

Share this post


Link to post
Share on other sites

Yes BIS missions are very script heavy. You'll have to search through the other script files to see where this script is called. It doesn't look like any parameters are being passed to the script, by my knowledge is limited. You can see where unit (AI firing) and target (firing at) defined here, but how the script knows who, is beyond me.

Like I said, you'll have to see how they use it, or wait for a higher knowledged person to figure it out.

Share this post


Link to post
Share on other sites

Looks like you'll be fine calling the script individually aslong as you pass on the unit and target. The rest is pre-defined. The interesting thing is though that the _target value is essentially a position instead of object and also doesn't accept an object. As a test, you could create a mission, define the whole function through CfgFunctions, and place down necessary stuff (an AI Rifleman and a marker). Then pass that onto the function, see what it does. I'm pretty sure it's in the function viewer from the beginning seeing it is a BI Function, probably called something along the lines of suppression or suppressive, but unless you find it there just add the function manually to your test mission.

Share this post


Link to post
Share on other sites

So, to test, place a rifleman and a marker and then put this in the rifleman INIT:

 null = [this, "markerName"] execVM "scriptName.sqf"; 

Share this post


Link to post
Share on other sites

Use getmarkerpos "markername" instead, has to be a position

Share this post


Link to post
Share on other sites

It needs a valid position away from player (I guess in targetable range)!

It seems that your target is right at unit's pos, so it is firing at himself.

Try this:

null = [this, [(getpos this) select 0, ((getpos this) select 1) + 100, (getpos this) select 2]] execVM "scriptName.sqf";

unit should fire north.

Share this post


Link to post
Share on other sites

All that happens when I run the script is that the unit targets the object and that's all it never fires.

The script is running correctly because if I use gl action ["useweapon",_unit,_unit,0]; instead of _unit forceWeaponFire [primaryWeapon _unit, "Manual"]; it works

gl being a game logic.

I have used getmarkerpos "mk" and getpos gl and both will work using the useaction but won't work when using forceweaponfire

Share this post


Link to post
Share on other sites

Most likely the unit can't fire because the script is using forceWeaponFire [_weapon,"Manual"] and according to BIKI, only "Single","Burst" and "FullAuto" are supported values.

On the contrary, currentWeaponMode returns "Single","Burst" and "Manual". Using (currentWeaponmode _unit) may be a better alternative than setting it manually.

Share this post


Link to post
Share on other sites

Thanks, "single" works " and so does (currentWeaponmode _unit)

But "burst" and "manual" don't.

It's not really a suppression script as it just fires on a spot.

Share this post


Link to post
Share on other sites

Well, that's kinda the definition of suppression. I suppose using a machinegunner with a full auto machinegun and practically zero delay between bursts should create a proper suppression. The question is also if AI react on said suppression or if the script was intended for cinematic purposes.

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  

×