Skip to content
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
wants to merge 44 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e9b4618
Pike prototype
PabstMirror Sep 21, 2016
e27881c
Merge branch 'master' into pike
PabstMirror Oct 28, 2017
f5994e4
Merge branch 'master' into pike
PabstMirror Dec 13, 2018
8243d2d
Magwells
PabstMirror Dec 13, 2018
f11ed76
move include
PabstMirror Dec 13, 2018
507b0bc
Update fnc_handleFired.sqf
PabstMirror Dec 13, 2018
f9f490d
Update configs
PabstMirror Dec 13, 2018
65b34e9
Merge branch 'master' into pike
PabstMirror Dec 9, 2020
452a041
initial clgp
PabstMirror Mar 3, 2021
bf1c092
Merge branch 'master' into pike
PabstMirror Oct 13, 2023
9d18dc6
redo using ammo events
PabstMirror Oct 15, 2023
04cbc02
bom
PabstMirror Oct 15, 2023
538c8c3
Merge branch 'master' into pike
PabstMirror Oct 23, 2023
1c4397d
Remove RVMAT for ammo model
PabstMirror Oct 23, 2023
e8ce14f
spelling of word
PabstMirror Oct 24, 2023
b0f0321
Apply suggestions from code review
PabstMirror Oct 24, 2023
478b11c
Merge branch 'master' into copperhead
PabstMirror Oct 26, 2023
a4fbbff
update clgp
PabstMirror Oct 26, 2023
6480203
reduce change to mg
PabstMirror Oct 26, 2023
986d4f3
More rework
PabstMirror Oct 26, 2023
865dc3d
more cleanup
PabstMirror Oct 27, 2023
590932b
Fly straight when no target data
PabstMirror Oct 28, 2023
6e6c6b7
use artillery drag
PabstMirror Oct 29, 2023
e42713d
Merge branch 'master' into copperhead
PabstMirror Nov 5, 2023
22a3efd
Merge branch 'master' into copperhead
PabstMirror Nov 6, 2023
4e72f9e
Update default laser code
PabstMirror Nov 6, 2023
bd6e7e3
Merge branch 'master' into copperhead
PabstMirror Apr 1, 2024
270979b
Merge branch 'pike' into copperhead
PabstMirror Apr 1, 2024
5a624b8
Merge pike
PabstMirror Apr 1, 2024
1717385
Update CfgAmmo.hpp
PabstMirror Apr 1, 2024
8d5f368
Merge branch 'master' into copperhead
PabstMirror Apr 12, 2024
3c983b6
Add framework doc
PabstMirror Apr 14, 2024
b40f5e1
Merge branch 'master' into copperhead
PabstMirror May 2, 2024
3f512d9
Merge branch 'master' into copperhead
PabstMirror May 24, 2024
e142d38
Disable alt flightmode for now
PabstMirror May 24, 2024
9084383
Merge branch 'master' into copperhead
PabstMirror Sep 28, 2024
c353100
Update for mg changes
PabstMirror Sep 28, 2024
1bcb5f5
Merge branch 'master' into copperhead
PabstMirror Nov 23, 2024
fc0fc22
Update fnc_onFiredGetArgs.sqf
PabstMirror Nov 23, 2024
6757af4
sort st
PabstMirror Nov 23, 2024
5f5dd70
Add frag configs
PabstMirror Nov 23, 2024
af20847
Merge branch 'master' into copperhead
PabstMirror Jan 13, 2025
cf0eb62
refactor to missile_clgp
PabstMirror Jan 13, 2025
c90dbfc
Merge branch 'master' into copperhead
PabstMirror Jan 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions addons/missile_clgp/ACE_GuidanceConfig.hpp
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);
};
};
96 changes: 96 additions & 0 deletions addons/missile_clgp/CfgAmmo.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,104 @@
class CfgAmmo {
class SubmunitionBase;
class ace_155mm_m712_launch: SubmunitionBase {
model = "\A3\weapons_f\ammo\shell";
hit = 1200;
indirectHit = 200;
indirectHitRange = 4;
EGVAR(frag,skip) = 0;
EGVAR(frag,charge) = 9979;
Copy link
Contributor

Choose a reason for hiding this comment

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

iirc these need to change, @lambdatiger gave me these values which should be accurate to the real shell

EGVAR(frag,metal) = 36000;
EGVAR(frag,gurney_c) = 2440;
EGVAR(frag,gurney_k) = "1/2";
EGVAR(frag,classes)[] = {QEGVAR(frag,large), QEGVAR(frag,large), QEGVAR(frag,large_HD), QEGVAR(frag,large), QEGVAR(frag,huge), QEGVAR(frag,huge_HD), QEGVAR(frag,huge)};

GVAR(artilleryDrag) = 1;
GVAR(deployCondition) = QFUNC(copperhead_deployCondition);
submunitionAmmo = "ace_155mm_m712_guidance";
submunitionCount = 1;
submunitionConeAngle = 0;
triggerDistance = 0;
muzzleEffect = "";
airFriction = 0;

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 = 1200;
indirectHit = 200;
indirectHitRange = 4;
EGVAR(frag,skip) = 0;
EGVAR(frag,charge) = 9979;
EGVAR(frag,metal) = 36000;
EGVAR(frag,gurney_c) = 2440;
EGVAR(frag,gurney_k) = "1/2";
EGVAR(frag,classes)[] = {QEGVAR(frag,large), QEGVAR(frag,large), QEGVAR(frag,large_HD), QEGVAR(frag,large), QEGVAR(frag,huge), QEGVAR(frag,huge_HD), QEGVAR(frag,huge)};

maneuvrability = 0;
airFriction = 0; // note: works differently from shellsim (v^3...)
sideAirFriction = 0; // -----ToDo-----

artilleryLock = 0; // would keep shell pointed towards velocity, but disables manuverability and airfric

initTime = 0;
thrustTime = 0;
thrust = 0; // free fall

manualControl = 0;
flightProfiles[] = {};
autoSeekTarget = 0;
weaponLockSystem = 0;
irLock = 0;
laserLock = 0;
airLock = 0;

timeToLive = 200;

class ace_missileguidance {
enabled = 2;
minDeflection = 0.001; // Minium flap deflection for guidance
maxDeflection = 0.001; // Maximum flap deflection for guidance
Copy link
Contributor Author

Choose a reason for hiding this comment

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

update for MG changes, eg:

    pitchRate = 15; // replace minDeflection, maxDeflection, incDeflection
    yawRate = 15;
    defaultNavigationType = "Direct";
    navigationTypes[] = { "Direct" };

Copy link
Contributor

Choose a reason for hiding this comment

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

preferably put this guidance config into CfgMissileTypesNato.hpp, but yeah this is required


// 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;
canVanillaLock = 0;
};
};

class GVAR(pike_launch): SubmunitionBase {
model = QPATHTOF(data\ace_pike_ammo.p3d);
submunitionAmmo = QGVAR(pike_guidance);
Expand Down
10 changes: 10 additions & 0 deletions addons/missile_clgp/CfgMagazines.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
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;
};

class 1Rnd_HE_Grenade_shell;
class ACE_40mm_Pike: 1Rnd_HE_Grenade_shell {
author = ECSTRING(common,ACETeam);
Expand Down
8 changes: 8 additions & 0 deletions addons/missile_clgp/CfgWeapons.hpp
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"};
};
};
92 changes: 92 additions & 0 deletions addons/missile_clgp/GUI.hpp
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 ButtonDial: GVAR(copperhead_dialButton) {
idc = 111;
tooltip = CSTRING(copperhead_dial_FlightProfile);
};
};
};
class Dial2 {
selection = "dial2";
class Controls {
class ButtonDial: GVAR(copperhead_dialButton) {
idc = 112;
tooltip = CSTRING(copperhead_dial_GuidanceDelay);
};
};
};
class Dial3 {
selection = "dial3";
class Controls {
class ButtonDial: GVAR(copperhead_dialButton) {
idc = 113;
tooltip = ECSTRING(laser,laserCode);
};
};
};
class Dial4 {
selection = "dial4";
class Controls {
class ButtonDial: GVAR(copperhead_dialButton) {
idc = 114;
tooltip = ECSTRING(laser,laserCode);
};
};
};
class Dial5 {
selection = "dial5";
class Controls {
class ButtonDial: GVAR(copperhead_dialButton) {
idc = 115;
tooltip = ECSTRING(laser,laserCode);
};
};
};
};
};
};
};
7 changes: 7 additions & 0 deletions addons/missile_clgp/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
LOG("prep");


PREP(copperhead_attackprofile);
PREP(copperhead_deployCondition);
PREP(copperhead_onfired);
PREP(copperhead_uiCanOpen);
PREP(copperhead_uiCreate);

PREP(submunition_ammoFired);
PREP(submunition_applyDrag);
PREP(submunition_submunitionCreated);
20 changes: 20 additions & 0 deletions addons/missile_clgp/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
#include "script_component.hpp"

// Copperhead - Add shell interface 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(actionsAdded), false]}) exitWith {};
_vehicle setVariable [QGVAR(actionsAdded), true];
private _copperheadMag = ["ace_1rnd_155mm_m712"] call EFUNC(common,getConfigName);
if (((_vehicle weaponsTurret [0]) findIf {_copperheadMag in (compatibleMagazines _x)}) != -1) then {
TRACE_2("adding copperhead action to vehicle",_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);
};
}, true] call CBA_fnc_addPlayerEventHandler
};


#ifdef ENABLE_QUICK_TESTING
call compileScript [QPATHTOF(dev\quickTesting.sqf)];
#endif
Binary file not shown.
Binary file added addons/missile_clgp/data/copperhead_dial_co.paa
Binary file not shown.
92 changes: 92 additions & 0 deletions addons/missile_clgp/data/copperhead_mat.rvmat
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
ambient[]={1,0.98500001,0.97000003,1};
diffuse[]={1,0.98500001,0.97000003,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.0001,0.0001,0.0001,0};
specularPower=2000;
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1
{
texture="#(argb,8,8,3)color(0.5,0.5,1,1)";
uvSource = "tex";
class uvTransform
{
aside[] = {1.0,0.0,0.0};
up[] = {0.0,1.0,0.0};
dir[] = {0.0,0.0,0.0};
pos[] = {0.0,0.0,0.0};
};
};
class Stage2
{
texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
uvSource = "tex";
class uvTransform
{
aside[] = {5,-4,0};
up[] = {8,1.931601,0};
dir[] = {0.0,0.0,0.0};
pos[] = {0.0,0.0,0.0};
};
};
class Stage3
{
texture = "#(argb,8,8,3)color(0,0,0,0,MC)";
uvSource = "tex";
class uvTransform
{
aside[] = {1.0,0.0,0.0};
up[] = {0.0,1.0,0.0};
dir[] = {0.0,0.0,0.0};
pos[] = {0.0,0.0,0.0};
};
};
class Stage4
{
texture="#(argb,8,8,3)color(0,1,1,1)";
uvSource = "tex";
class uvTransform
{
aside[] = {1.0,0.0,0.0};
up[] = {0.0,1.0,0.0};
dir[] = {0.0,0.0,0.0};
pos[] = {0.0,0.0,0.0};
};
};
class Stage5
{
texture="#(argb,8,8,3)color(1,1,1,1)";
uvSource = "tex";
class uvTransform
{
aside[] = {1.0,0.0,0.0};
up[] = {0.0,1.0,0.0};
dir[] = {0.0,0.0,0.0};
pos[] = {0.0,0.0,0.0};
};
};
class Stage6
{
texture = "#(ai,64,128,1)fresnel(1.5,1.22)";
uvSource = "tex";
class uvTransform
{
aside[] = {1.0,0.0,0.0};
up[] = {0.0,1.0,0.0};
dir[] = {0.0,0.0,0.0};
pos[] = {0.0,0.0,0.0};
};
};
class Stage7
{
texture = "a3\data_f\env_land_co.paa";
uvSource = "tex";
class uvTransform
{
aside[] = {1.0,0.0,0.0};
up[] = {0.0,1.0,0.0};
dir[] = {0.0,0.0,0.0};
pos[] = {0.0,0.0,0.0};
};
};
Binary file added addons/missile_clgp/data/copperhead_shell_co.paa
Binary file not shown.
Loading
Loading