-
Notifications
You must be signed in to change notification settings - Fork 733
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
Missile Guidance - Add Copperhead M712 #8210
Draft
PabstMirror
wants to merge
37
commits into
master
Choose a base branch
from
copperhead
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 6 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
e9b4618
Pike prototype
PabstMirror e27881c
Merge branch 'master' into pike
PabstMirror f5994e4
Merge branch 'master' into pike
PabstMirror 8243d2d
Magwells
PabstMirror f11ed76
move include
PabstMirror 507b0bc
Update fnc_handleFired.sqf
PabstMirror f9f490d
Update configs
PabstMirror 65b34e9
Merge branch 'master' into pike
PabstMirror 452a041
initial clgp
PabstMirror bf1c092
Merge branch 'master' into pike
PabstMirror 9d18dc6
redo using ammo events
PabstMirror 04cbc02
bom
PabstMirror 538c8c3
Merge branch 'master' into pike
PabstMirror 1c4397d
Remove RVMAT for ammo model
PabstMirror e8ce14f
spelling of word
PabstMirror b0f0321
Apply suggestions from code review
PabstMirror 478b11c
Merge branch 'master' into copperhead
PabstMirror a4fbbff
update clgp
PabstMirror 6480203
reduce change to mg
PabstMirror 986d4f3
More rework
PabstMirror 865dc3d
more cleanup
PabstMirror 590932b
Fly straight when no target data
PabstMirror 6e6c6b7
use artillery drag
PabstMirror e42713d
Merge branch 'master' into copperhead
PabstMirror 22a3efd
Merge branch 'master' into copperhead
PabstMirror 4e72f9e
Update default laser code
PabstMirror bd6e7e3
Merge branch 'master' into copperhead
PabstMirror 270979b
Merge branch 'pike' into copperhead
PabstMirror 5a624b8
Merge pike
PabstMirror 1717385
Update CfgAmmo.hpp
PabstMirror 8d5f368
Merge branch 'master' into copperhead
PabstMirror 3c983b6
Add framework doc
PabstMirror b40f5e1
Merge branch 'master' into copperhead
PabstMirror 3f512d9
Merge branch 'master' into copperhead
PabstMirror e142d38
Disable alt flightmode for now
PabstMirror 9084383
Merge branch 'master' into copperhead
PabstMirror c353100
Update for mg changes
PabstMirror File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
z\ace\addons\clgp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class EGVAR(missileguidance,AttackProfiles) { | ||
class copperhead { | ||
onFired = QFUNC(copperhead_onfired); | ||
functionName = QFUNC(copperhead_attackprofile); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
class CfgAmmo { | ||
|
||
class SubmunitionBase; | ||
class ace_155mm_m712_launch: SubmunitionBase { | ||
model = "\A3\weapons_f\ammo\shell"; | ||
hit = 160; // low for testing | ||
indirectHit = 50; | ||
indirectHitRange = 8; | ||
|
||
GVAR(deployCondition) = QFUNC(copperhead_deployCondition); | ||
submunitionAmmo = "ace_155mm_m712_guidance"; | ||
submunitionCount = 1; | ||
submunitionConeAngle = 0; | ||
triggerDistance = 0; | ||
muzzleEffect = ""; | ||
airFriction = 0; | ||
|
||
EGVAR(frag,skip) = 1; // don't frag because this is a scripted ammo | ||
class Eventhandlers { | ||
fired = QUOTE(call FUNC(submunition_ammoFired)); | ||
}; | ||
class CamShakeFire { | ||
power = 3.00922; | ||
duration = 1.8; | ||
frequency = 20; | ||
distance = 72.4431; | ||
}; | ||
class CamShakePlayerFire { | ||
power = 0.01; | ||
duration = 0.1; | ||
frequency = 20; | ||
distance = 1; | ||
}; | ||
}; | ||
|
||
class ammo_Bomb_LaserGuidedBase; | ||
class ace_155mm_m712_guidance: ammo_Bomb_LaserGuidedBase { | ||
model = "\A3\Weapons_F_EPC\Ammo\Bomb_04_fly_F.p3d"; | ||
hit = 160; | ||
indirectHit = 50; | ||
indirectHitRange = 8; | ||
|
||
maneuvrability = 12; | ||
airFriction = 0.04; // note: works differently from shell (v^3...) | ||
sideAirFriction = 0.225; | ||
|
||
artilleryLock = 0; // would keep shell pointed towards velocity, but disables manuverability and airfric | ||
|
||
initTime = 0; | ||
thrustTime = 0; | ||
thrust = 0; // free fall | ||
|
||
flightProfiles[] = { "Direct" }; | ||
class Direct {}; | ||
class Components {}; | ||
|
||
manualControl = 1; | ||
maxControlRange = 100000; | ||
missileManualControlCone = 360; | ||
missileLockCone = 360; | ||
missileKeepLockedCone = 360; | ||
missileLockMaxDistance = 100000; | ||
missileLockMinDistance = 0; | ||
|
||
autoSeekTarget = 0; | ||
weaponLockSystem = 0; | ||
irLock = 0; | ||
laserLock = 0; | ||
airLock = 0; | ||
|
||
timeToLive = 200; | ||
|
||
class ace_missileguidance { | ||
enabled = 2; | ||
|
||
useVanillaDeflection = 1; // use missileTarget for deflection | ||
minDeflection = 0.01; // Minium flap deflection for guidance | ||
maxDeflection = 0.01; // Maximum flap deflection for guidance | ||
|
||
canVanillaLock = 0; | ||
|
||
// Guidance type for munitions | ||
defaultSeekerType = "SALH"; | ||
seekerTypes[] = { "SALH" }; | ||
|
||
defaultSeekerLockMode = "LOAL"; | ||
seekerLockModes[] = { "LOAL" }; | ||
|
||
seekerAngle = 70; // Angle in front of the missile which can be searched | ||
seekerAccuracy = 1; // seeker accuracy multiplier | ||
|
||
seekerMinRange = 0; | ||
seekerMaxRange = 3000; // Range from the missile which the seeker can visually search | ||
|
||
seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] | ||
|
||
// Attack profile type selection | ||
defaultAttackProfile = "copperhead"; | ||
attackProfiles[] = {"copperhead"}; | ||
useModeForAttackProfile = 0; | ||
}; | ||
}; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class Extended_PreStart_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); | ||
}; | ||
}; | ||
class Extended_PreInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); | ||
}; | ||
}; | ||
class Extended_PostInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class CfgMagazines { | ||
class 32Rnd_155mm_Mo_shells; | ||
class ace_1rnd_155mm_m712: 32Rnd_155mm_Mo_shells { | ||
author = ECSTRING(common,ACETeam); | ||
displayNameMFDFormat = "M712"; | ||
displayNameShort = "M712"; | ||
displayName = "Copperhead"; | ||
ammo = "ace_155mm_m712_launch"; | ||
count = 1; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class CfgWeapons { | ||
class CannonCore; | ||
class mortar_155mm_AMOS: CannonCore { | ||
reloadTime = 1; | ||
magazineReloadTime = 1; | ||
magazines[] += {"ace_1rnd_155mm_m712"}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
class RscObject; | ||
class RscButton; | ||
|
||
class GVAR(copperhead_dialButton): RscButton { | ||
style = 2; | ||
x = 0; | ||
y = 0; | ||
w = 99; | ||
h = 99; | ||
soundEnter[] = {"", 0.2, 1}; | ||
soundPush[] = {"", 0.2, 1}; | ||
soundClick[] = {"", 0.2, 1}; | ||
soundEscape[] = {"", 0.2, 1}; | ||
color[] = {0,0,0,0}; | ||
colorBackground[] = {0,0,1,0}; | ||
// colorBackground[] = {0,0,1,0.1}; | ||
colorBackgroundDisabled[] = {0,0,0,0}; | ||
colorBackgroundActive[] = {0,0,0,0}; | ||
colorFocused[] = {0,0,0,0}; | ||
text = ""; | ||
}; | ||
|
||
class GVAR(copperhead_dialog) { | ||
idd = -1; | ||
enableSimulation = 1; | ||
onLoad = QUOTE(with uiNamespace do {GVAR(copperhead_dialog) = _this select 0}); | ||
duration = 1e99; | ||
class ControlsBackground {}; | ||
class Controls {}; | ||
class Objects { | ||
class TheThing: RscObject { | ||
type = 82; | ||
idc = 100; | ||
model = QPATHTOF(data\ace_copperhead_interactive.p3d); | ||
direction[] = {0,0,1}; | ||
up[] = {0,1,0}; | ||
position[] = {0,-0.338,0.5}; | ||
positionBack[] = {0,-0.338,0.5}; | ||
enableZoom = 0; | ||
zoomDuration = 1; | ||
scale = 1; | ||
inBack = 0; | ||
class Areas { | ||
class Dial1 { | ||
selection = "dial1"; | ||
class Controls { | ||
class ButtonDial1: GVAR(copperhead_dialButton) { | ||
idc = 111; | ||
tooltip = "Flight Profile"; | ||
}; | ||
}; | ||
}; | ||
class Dial2 { | ||
selection = "dial2"; | ||
class Controls { | ||
class ButtonDial2: GVAR(copperhead_dialButton) { | ||
idc = 112; | ||
tooltip = "Guidance Delay"; | ||
}; | ||
}; | ||
}; | ||
class Dial3 { | ||
selection = "dial3"; | ||
class Controls { | ||
class ButtonDial3: GVAR(copperhead_dialButton) { | ||
idc = 113; | ||
tooltip = "Laser Code"; | ||
}; | ||
}; | ||
}; | ||
class Dial4 { | ||
selection = "dial4"; | ||
class Controls { | ||
class ButtonDial4: GVAR(copperhead_dialButton) { | ||
idc = 114; | ||
tooltip = "Laser Code"; | ||
}; | ||
}; | ||
}; | ||
class Dial5 { | ||
selection = "dial5"; | ||
class Controls { | ||
class ButtonDial5: GVAR(copperhead_dialButton) { | ||
idc = 115; | ||
tooltip = "Laser Code"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ace_clgp | ||
=================== | ||
|
||
Cannon Launched Guided Projectiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
LOG("prep"); | ||
|
||
PREP(copperhead_attackprofile); | ||
PREP(copperhead_deployCondition); | ||
PREP(copperhead_onfired); | ||
PREP(copperhead_uiCanOpen); | ||
PREP(copperhead_uiCreate); | ||
|
||
PREP(submunition_ammoFired); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,58 @@ | ||||||
#include "script_component.hpp" | ||||||
|
||||||
// Add shell config action to vehicles that can fire it | ||||||
if (hasInterface) then { | ||||||
["turret", { | ||||||
params ["_player", "_turret"]; | ||||||
TRACE_3("turret",_player,_turret,typeOf vehicle _player); | ||||||
if (_turret isNotEqualTo [0]) exitWith {}; | ||||||
private _vehicle = vehicle _player; | ||||||
if ((!alive _player) || {!alive _vehicle} || {_vehicle getVariable [QGVAR(copperhead_actionHandled), false]}) exitWith { TRACE_1("exit",_vehicle); }; | ||||||
|
||||||
private _canFireCopperhead = false; | ||||||
{ | ||||||
if ("ace_1rnd_155mm_m712" in ([_x] call CBA_fnc_compatibleMagazines)) exitWith { _canFireCopperhead = true; }; | ||||||
} forEach (_vehicle weaponsTurret [0]); | ||||||
|
||||||
if (_canFireCopperhead) then { | ||||||
TRACE_2("adding action to object",_vehicle,typeOf _vehicle); | ||||||
private _action = [QGVAR(copperhead), LLSTRING(copperhead_action), "", | ||||||
LINKFUNC(copperhead_uiCreate), LINKFUNC(copperhead_uiCanOpen)] call EFUNC(interact_menu,createAction); | ||||||
[_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject); | ||||||
}; | ||||||
_vehicle setVariable [QGVAR(copperhead_actionHandled), true]; | ||||||
}, true] call CBA_fnc_addPlayerEventHandler | ||||||
}; | ||||||
|
||||||
|
||||||
#ifdef ENABLE_QUICK_TESTING | ||||||
["recompile", "recompile", "recompile", { | ||||||
private _start = diag_tickTime; | ||||||
[] call ACE_PREP_RECOMPILE; | ||||||
[] call ace_common_fnc_dumpPerformanceCounters; | ||||||
private _end = diag_tickTime; | ||||||
systemChat format ["recompile took [%1 ms]", (1000 * (_end - _start)) toFixed 1]; | ||||||
|
||||||
if (productVersion #4 == "Diag") then { | ||||||
call compile "diag_mergeConfigFile ['P:\z\ace\addons\clgp\config.cpp']"; | ||||||
}; | ||||||
false | ||||||
}, {false}, [33, [false, false, false]], false] call CBA_fnc_addKeybind; // F Key | ||||||
|
||||||
["turret", { | ||||||
params ["_player", "_turret"]; | ||||||
private _veh = vehicle _player; | ||||||
if (currentWeapon _veh == "mortar_155mm_AMOS") then { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
If |
||||||
systemChat "loading"; | ||||||
_veh addMagazineTurret ["ace_1rnd_155mm_m712", [0], 1]; | ||||||
_veh addMagazineTurret ["ace_1rnd_155mm_m712", [0], 1]; | ||||||
_veh addMagazineTurret ["ace_1rnd_155mm_m712", [0], 1]; | ||||||
_veh addMagazineTurret ["ace_1rnd_155mm_m712", [0], 1]; | ||||||
_veh addMagazineTurret ["ace_1rnd_155mm_m712", [0], 1]; | ||||||
_veh addMagazineTurret ["ace_1rnd_155mm_m712", [0], 1]; | ||||||
_veh loadMagazine [[0], "mortar_155mm_AMOS", "ace_1rnd_155mm_m712"]; | ||||||
}; | ||||||
}, true] call CBA_fnc_addPlayerEventHandler | ||||||
|
||||||
|
||||||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "script_component.hpp" | ||
|
||
ADDON = false; | ||
|
||
PREP_RECOMPILE_START; | ||
#include "XEH_PREP.hpp" | ||
PREP_RECOMPILE_END; | ||
|
||
ADDON = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "script_component.hpp" | ||
|
||
#include "XEH_PREP.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "script_component.hpp" | ||
|
||
class CfgPatches { | ||
class ADDON { | ||
name = COMPONENT_NAME; | ||
units[] = {}; | ||
weapons[] = {}; | ||
requiredVersion = REQUIRED_VERSION; | ||
requiredAddons[] = {"ace_missileguidance"}; | ||
author = ECSTRING(common,ACETeam); | ||
url = ECSTRING(main,URL); | ||
VERSION_CONFIG; | ||
}; | ||
}; | ||
|
||
#include "ACE_GuidanceConfig.hpp" | ||
|
||
#include "CfgEventhandlers.hpp" | ||
#include "CfgAmmo.hpp" | ||
#include "CfgMagazines.hpp" | ||
#include "CfgWeapons.hpp" | ||
#include "GUI.hpp" |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Surely the lazy eval doesn't save anything with such a cheap check ?