-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ambient artillery and logistics modules #1062
base: main
Are you sure you want to change the base?
Conversation
|
||
TRACE_1("ambient arty", _position); | ||
|
||
_artyPiece doArtilleryFire [_position, currentMagazine _artyPiece, _minimumRounds + round(_randomRounds)]; |
There was a problem hiding this comment.
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"}; |
There was a problem hiding this comment.
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"}; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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)]; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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;
When merged this pull request will:
Neither have pretty pictures at the moment