Skip to content

Add ambient artillery and logistics modules#1062

Open
AnAngrySalad1 wants to merge 13 commits intomainfrom
feature/ambient-scripts
Open

Add ambient artillery and logistics modules#1062
AnAngrySalad1 wants to merge 13 commits intomainfrom
feature/ambient-scripts

Conversation

@AnAngrySalad1
Copy link
Contributor

When merged this pull request will:

  • Add ambient logistics modules (spawn and destination)
  • Add ambient artillery module

Neither have pretty pictures at the moment


TRACE_1("ambient arty", _position);

_artyPiece doArtilleryFire [_position, currentMagazine _artyPiece, _minimumRounds + round(_randomRounds)];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no randomness applied to the round count. Should be round (random _randomRounds)

(_this select 1) params ["_logic"];

private _artyPieces = (synchronizedObjects _logic) select {typeOf _x != "uksf_mission_moduleAmbientArtilleryTargetArea"};
private _targetAreas = (synchronizedObjects _logic) select {typeOf _x == "uksf_mission_moduleAmbientArtilleryTargetArea"};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exit if no arty or no target areas


(_this select 1) params ["_logic"];

private _artyPieces = (synchronizedObjects _logic) select {typeOf _x != "uksf_mission_moduleAmbientArtilleryTargetArea"};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use QGVAR()

*/
(_this select 1) params ["_logic"];

private _destinations = synchronizedObjects _logic;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exit if no destinations

(_this select 1) params ["_logic"];

private _destinations = synchronizedObjects _logic;
private _time = _logic getVariable [QGVAR(ambientLogisticsInterval), 0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a sensible defualt


private _artyPieces = (synchronizedObjects _logic) select {typeOf _x != "uksf_mission_moduleAmbientArtilleryTargetArea"};
private _targetAreas = (synchronizedObjects _logic) select {typeOf _x == "uksf_mission_moduleAmbientArtilleryTargetArea"};
private _time = _logic getVariable [QGVAR(ambientArtilleryInterval), 0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a sensible default

};

// create vehicle and crew
private _logiSpawnPos = getPos _logic;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer to keep vehicle and unit spawning in one place, use common,spawnGroupVehicle. Can't see anything here that it doesn't support


TRACE_1("ambient arty", _position);

_artyPiece doArtilleryFire [_position, currentMagazine _artyPiece, _minimumRounds + round(_randomRounds)];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no locality control

_artyPiece setVehicleAmmo 1;
}, [_artyPiece], 60] call cba_fnc_waitAndExecute;

}, _time, [_x, _targetAreas, _minimumRounds, _randomRounds]] call cba_fnc_addPerFrameHandler;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, use capital CBA prefix for function calls (and BIS too)

[{
params ["_artyPiece"];
_artyPiece setVehicleAmmo 1;
}, [_artyPiece], 60] call cba_fnc_waitAndExecute;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be simplified: [{_this setVehicleAmmo 1}, _artyPiece, 60] call CBA_fnc_waitAndExecute;

@tbeswick96 tbeswick96 changed the title Feature/ambient scripts Add ambient artillery and logistics modules Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants