mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Pike prototype
This commit is contained in:
parent
0143dd40ba
commit
e9b4618d6a
1
addons/pike/$PBOPREFIX$
Normal file
1
addons/pike/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\pike
|
58
addons/pike/CfgAmmo.hpp
Normal file
58
addons/pike/CfgAmmo.hpp
Normal file
@ -0,0 +1,58 @@
|
||||
class CfgAmmo {
|
||||
class FlareBase;
|
||||
class GVAR(ammo_gl): FlareBase {
|
||||
model = QPATHTOF(models\ace_pike_ammo.p3d);
|
||||
lightColor[] = {0, 0, 0, 0};
|
||||
smokeColor[] = {0, 0, 0, 0};
|
||||
timeToLive = 1;
|
||||
};
|
||||
|
||||
class M_Titan_AT;
|
||||
class GVAR(ammo_rocket): M_Titan_AT {
|
||||
irLock = 0;
|
||||
laserLock = 0;
|
||||
airLock = 0;
|
||||
manualControl = 0;
|
||||
|
||||
timeToLive = 30;
|
||||
|
||||
model = QPATHTOF(models\ace_pike_ammo.p3d);
|
||||
maxSpeed = 150;
|
||||
thrust = 30;
|
||||
thrustTime = 2;
|
||||
|
||||
hit = 100;
|
||||
indirectHit = 8;
|
||||
indirectHitRange = 6;
|
||||
|
||||
initTime = 0;
|
||||
|
||||
// Begin ACE guidance Configs
|
||||
class ace_missileguidance {
|
||||
enabled = 1;
|
||||
|
||||
minDeflection = 0.0005; // Minium flap deflection for guidance
|
||||
maxDeflection = 0.0025; // Maximum flap deflection for guidance
|
||||
incDeflection = 0.0005; // The incrmeent in which deflection adjusts.
|
||||
|
||||
canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode
|
||||
|
||||
// Guidance type for munitions
|
||||
defaultSeekerType = "SALH";
|
||||
seekerTypes[] = {"SALH"};
|
||||
|
||||
defaultSeekerLockMode = "LOAL";
|
||||
seekerLockModes[] = {"LOAL"};
|
||||
|
||||
seekerAngle = 90; // Angle in front of the missile which can be searched
|
||||
seekerAccuracy = 1; // seeker accuracy multiplier
|
||||
|
||||
seekerMinRange = 1;
|
||||
seekerMaxRange = 1000; // Range from the missile which the seeker can visually search
|
||||
|
||||
// Attack profile type selection
|
||||
defaultAttackProfile = "LIN";
|
||||
attackProfiles[] = { "LIN", "DIR", "MID", "HI" };
|
||||
};
|
||||
};
|
||||
};
|
18
addons/pike/CfgEventhandlers.hpp
Normal file
18
addons/pike/CfgEventhandlers.hpp
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
class Extended_PreStart_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preStart));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
|
||||
};
|
||||
};
|
13
addons/pike/CfgMagazines.hpp
Normal file
13
addons/pike/CfgMagazines.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
class CfgMagazines {
|
||||
class 1Rnd_HE_Grenade_shell;
|
||||
class ACE_40mm_Pike: 1Rnd_HE_Grenade_shell {
|
||||
displayName = CSTRING(magazine_displayName);
|
||||
displayNameShort = "Pike SALH";
|
||||
descriptionShort = "";
|
||||
// picture = QPATHTOF(data\inventory_ca.paa);
|
||||
ammo = QGVAR(ammo_gl);
|
||||
model = QPATHTOF(models\ace_pike_ammo.p3d);
|
||||
initSpeed = 40;
|
||||
mass = 10;
|
||||
};
|
||||
};
|
6
addons/pike/CfgWeapons.hpp
Normal file
6
addons/pike/CfgWeapons.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
class CfgWeapons {
|
||||
class GrenadeLauncher;
|
||||
class UGL_F: GrenadeLauncher {
|
||||
magazines[] += {"ACE_40mm_Pike"};
|
||||
};
|
||||
};
|
11
addons/pike/README.md
Normal file
11
addons/pike/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
ace_pike
|
||||
===========
|
||||
|
||||
Adds 40mm Pike semi-active laser seeking rocket, firable from the M320 or EGLM grenade launcher.
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [PabstMirror](http://github.com/PabstMirror)
|
1
addons/pike/XEH_PREP.hpp
Normal file
1
addons/pike/XEH_PREP.hpp
Normal file
@ -0,0 +1 @@
|
||||
PREP(handleFired);
|
5
addons/pike/XEH_postInit.sqf
Normal file
5
addons/pike/XEH_postInit.sqf
Normal file
@ -0,0 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
["ace_firedPlayer", FUNC(handleFired)] call CBA_fnc_addEventHandler;
|
7
addons/pike/XEH_preInit.sqf
Normal file
7
addons/pike/XEH_preInit.sqf
Normal file
@ -0,0 +1,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
#include "XEH_PREP.hpp"
|
||||
|
||||
ADDON = true;
|
3
addons/pike/XEH_preStart.sqf
Normal file
3
addons/pike/XEH_preStart.sqf
Normal file
@ -0,0 +1,3 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#include "XEH_PREP.hpp"
|
20
addons/pike/config.cpp
Normal file
20
addons/pike/config.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common", "ace_laser", "ace_missileguidance"};
|
||||
author = ECSTRING(common,ACETeam);
|
||||
authors[] = {"PabstMirror"};
|
||||
url = ECSTRING(main,URL);
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgAmmo.hpp"
|
||||
#include "CfgEventhandlers.hpp"
|
||||
#include "CfgMagazines.hpp"
|
||||
#include "CfgWeapons.hpp"
|
61
addons/pike/functions/fnc_handleFired.sqf
Normal file
61
addons/pike/functions/fnc_handleFired.sqf
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Handlese firing the 40mm pike grenade/rocket
|
||||
*
|
||||
* Arguments:
|
||||
* FiredEH
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_pike_fnc_handleFired
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
|
||||
TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile);
|
||||
if (_ammo != QGVAR(ammo_gl)) exitWith {};
|
||||
|
||||
[{
|
||||
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
|
||||
TRACE_7("rocket stage",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile);
|
||||
|
||||
//If null (deleted or hit water) exit:
|
||||
if (isNull _projectile) exitWith {};
|
||||
|
||||
private _posASL = getPosASL _projectile;
|
||||
private _vel = velocity _projectile;
|
||||
|
||||
systemChat format ["gl %1 %2",_vel, round vectorMagnitude _vel];
|
||||
|
||||
deleteVehicle _projectile;
|
||||
|
||||
private _rocket = QGVAR(ammo_rocket) createVehicle (getPosATL _projectile);
|
||||
|
||||
_rocket setPosASL _posASL;
|
||||
|
||||
// Set correct velocity and direction (must set velocity before changeMissileDirection)
|
||||
_rocket setVelocity _vel;
|
||||
[_rocket, vectorNormalized _vel] call EFUNC(missileguidance,changeMissileDirection);
|
||||
|
||||
|
||||
private _vel = velocity _rocket;
|
||||
systemChat format ["rocket %1 %2",_vel, round vectorMagnitude _vel];
|
||||
|
||||
// Start missile guidance
|
||||
[_unit, _weapon, _muzzle, _mode, QGVAR(ammo_rocket), _magazine, _rocket] call EFUNC(missileguidance,onFired);
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
[{
|
||||
params ["_args", "_pfID"];
|
||||
_args params [["_rocket", objNull], "_startTime"];
|
||||
if (!alive _rocket) exitWith {systemChat "done"; [_pfID] call CBA_fnc_removePerFrameHandler;};
|
||||
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLtoAGL getPosASL _rocket, 0.75, 0.75, 0, "", 1, 0.025, "TahomaB"];
|
||||
hintSilent format ["vel %1\n%2 mps\n%3dist %3\ntof %4",velocity _rocket, round vectorMagnitude velocity _rocket, _rocket distance player, time - _startTime];
|
||||
}, 0.0, [_rocket, time]] call CBA_fnc_addPerFrameHandler;
|
||||
#endif
|
||||
|
||||
}, _this, 0.1] call CBA_fnc_waitAndExecute;
|
1
addons/pike/functions/script_component.hpp
Normal file
1
addons/pike/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\pike\script_component.hpp"
|
BIN
addons/pike/models/ace_pike_ammo.p3d
Normal file
BIN
addons/pike/models/ace_pike_ammo.p3d
Normal file
Binary file not shown.
76
addons/pike/models/pike_surface.rvmat
Normal file
76
addons/pike/models/pike_surface.rvmat
Normal file
@ -0,0 +1,76 @@
|
||||
class StageTI {
|
||||
texture = "a3\data_f\default_glass_ti_ca.paa";
|
||||
};
|
||||
ambient[] = {1,1,1,1};
|
||||
diffuse[] = {1,1,1,1};
|
||||
forcedDiffuse[] = {0,0,0,1};
|
||||
emmisive[] = {0,0,0,0};
|
||||
specular[] = {0.2,0.2,0.2,1};
|
||||
specularPower = 500;
|
||||
PixelShaderID = "Super";
|
||||
VertexShaderID = "Super";
|
||||
class Stage1 {
|
||||
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1)";
|
||||
uvSource = "tex";
|
||||
class uvTransform {
|
||||
aside[] = {1,0,0};
|
||||
up[] = {0,1,0};
|
||||
dir[] = {0,0,1};
|
||||
pos[] = {0,0,0};
|
||||
};
|
||||
};
|
||||
class Stage2 {
|
||||
texture = "#(argb,8,8,3)color(0.5,0.5,0.5,0.5,DT)";
|
||||
uvSource = "tex";
|
||||
class uvTransform {
|
||||
aside[] = {1,0,0};
|
||||
up[] = {0,1,0};
|
||||
dir[] = {0,0,1};
|
||||
pos[] = {0,0,0};
|
||||
};
|
||||
};
|
||||
class Stage3 {
|
||||
texture = "#(argb,8,8,3)color(0,0,0,0,MC)";
|
||||
uvSource = "tex";
|
||||
class uvTransform {
|
||||
aside[] = {1,0,0};
|
||||
up[] = {0,1,0};
|
||||
dir[] = {0,0,1};
|
||||
pos[] = {0,0,0};
|
||||
};
|
||||
};
|
||||
class Stage4 {
|
||||
texture = "#(argb,8,8,3)color(1,1,1,1,AS)";
|
||||
uvSource = "tex";
|
||||
class uvTransform {
|
||||
aside[] = {1,0,0};
|
||||
up[] = {0,1,0};
|
||||
dir[] = {0,0,1};
|
||||
pos[] = {0,0,0};
|
||||
};
|
||||
};
|
||||
class Stage5 {
|
||||
texture = "#(argb,8,8,3)color(0,0.6,1,1,SMDI)";
|
||||
uvSource = "tex";
|
||||
class uvTransform {
|
||||
aside[] = {1,0,0};
|
||||
up[] = {0,1,0};
|
||||
dir[] = {0,0,1};
|
||||
pos[] = {0,0,0};
|
||||
};
|
||||
};
|
||||
class Stage6 {
|
||||
texture = "#(ai,32,128,1)fresnel(1.6,1.4)";
|
||||
uvSource="none";
|
||||
};
|
||||
class Stage7 {
|
||||
useWorldEnvMap = "true";
|
||||
texture = "a3\data_f\env_interier_car_ca.paa";
|
||||
uvSource = "tex";
|
||||
class uvTransform {
|
||||
aside[] = {1,0,0};
|
||||
up[] = {0,1,0};
|
||||
dir[] = {0,0,1};
|
||||
pos[] = {0,0,0};
|
||||
};
|
||||
};
|
18
addons/pike/script_component.hpp
Normal file
18
addons/pike/script_component.hpp
Normal file
@ -0,0 +1,18 @@
|
||||
#define COMPONENT pike
|
||||
#define COMPONENT_BEAUTIFIED Pike
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#define DEBUG_MODE_FULL
|
||||
#define DISABLE_COMPILE_CACHE
|
||||
#define CBA_DEBUG_SYNCHRONOUS
|
||||
#define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_PIKE
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_PIKE
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_PIKE
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
8
addons/pike/stringtable.xml
Normal file
8
addons/pike/stringtable.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="pike">
|
||||
<Key ID="STR_ACE_pike_magazine_displayName">
|
||||
<English>40mm Pike</English>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user