Merge pull request #3940 from acemod/particles

Custom smoke particles
This commit is contained in:
Glowbal 2016-07-12 13:36:36 +02:00 committed by GitHub
commit 02fea363b6
9 changed files with 341 additions and 0 deletions

View File

@ -0,0 +1 @@
z\ace\addons\particles

View File

@ -0,0 +1,75 @@
class CfgAmmo {
class GrenadeHand;
// - Smoke hand grenades --------------------------------------------------
class SmokeShell: GrenadeHand {
smokeColor[] = {1, 1, 1, 1};
timeToLive = 90;
};
class SmokeShellRed: SmokeShell {
smokeColor[] = SMOKE_COLOR_RED;
timeToLive = 60;
};
class SmokeShellGreen: SmokeShell {
smokeColor[] = SMOKE_COLOR_GREEN;
timeToLive = 60;
};
class SmokeShellYellow: SmokeShell {
smokeColor[] = SMOKE_COLOR_YELLOW;
timeToLive = 60;
};
class SmokeShellPurple: SmokeShell {
smokeColor[] = SMOKE_COLOR_PURPLE;
timeToLive = 60;
};
class SmokeShellBlue: SmokeShell {
smokeColor[] = SMOKE_COLOR_BLUE;
timeToLive = 60;
};
class SmokeShellOrange: SmokeShell {
smokeColor[] = SMOKE_COLOR_ORANGE;
timeToLive = 60;
};
// - 40mm smoke grenades --------------------------------------------------
class G_40mm_Smoke: SmokeShell {
smokeColor[] = {1, 1, 1, 1};
timeToLive = 40;
};
class G_40mm_SmokeRed: G_40mm_Smoke {
smokeColor[] = SMOKE_COLOR_RED;
timeToLive = 40;
};
class G_40mm_SmokeGreen: G_40mm_Smoke {
smokeColor[] = SMOKE_COLOR_GREEN;
timeToLive = 40;
};
class G_40mm_SmokeYellow: G_40mm_Smoke {
smokeColor[] = SMOKE_COLOR_YELLOW;
timeToLive = 40;
};
class G_40mm_SmokePurple: G_40mm_Smoke {
smokeColor[] = SMOKE_COLOR_PURPLE;
timeToLive = 40;
};
class G_40mm_SmokeBlue: G_40mm_Smoke {
smokeColor[] = SMOKE_COLOR_BLUE;
timeToLive = 40;
};
class G_40mm_SmokeOrange: G_40mm_Smoke {
smokeColor[] = SMOKE_COLOR_ORANGE;
timeToLive = 40;
};
// - Artillery smoke submunition ------------------------------------------
class SmokeShellArty: SmokeShell {
explosionTime = 0;
effectsSmoke = "ACE_ArtillerySmoke";
};
// - 120mm/155mm artillery smoke ------------------------------------------
class SubmunitionBase;
class Smoke_120mm_AMOS_White: SubmunitionBase {
submunitionConeAngle = 10;
};
};

View File

@ -0,0 +1,117 @@
class CfgCloudlets {
class Default;
// - Smoke hand grenades --------------------------------------------------
class ACE_SmokeBaseLarge: Default {
colorCoef[] = {"colorR", "colorG", "colorB", "colorA"};
sizeCoef = 1;
position[] = {0, 0, 0};
interval = 0.05;
circleRadius = 0;
circleVelocity[] = {0, 0, 0};
particleShape = QUOTE(PATHTOF(data\smoke.p3d));
particleFSNtieth = 1;
particleFSIndex = 0;
particleFSFrameCount = 1;
particleFSLoop = 0;
angleVar = 0.1;
animationName = "";
particleType = "Billboard";
timerPeriod = 1;
lifeTime = 30;
lifeTimeVar = 1;
animationSpeed[] = {1};
animationSpeedCoef = 1;
randomDirectionPeriod = 1;
randomDirectionPeriodVar = 0;
randomDirectionIntensity = 0.08;
randomDirectionIntensityVar = 0;
destroyOnWaterSurface = 1;
destroyOnWaterSurfaceOffset = -8;
positionVar[] = {0, 0, 0};
colorVar[] = {0, 0, 0, 0};
color[] = {
{0.5, 0.5, 0.5, 1},
{0.5, 0.5, 0.5, 0.7},
{0.5, 0.5, 0.5, 0.5},
{0.5, 0.5, 0.5, 0.5},
{0.5, 0.5, 0.5, 0.1},
{0.5, 0.5, 0.5, 0}
};
size[] = {0.05, 4, 12, 16};
sizeVar = 0.5;
weight = 1.275;
moveVelocity[] = {0, 0, 0};
moveVelocityVar[] = {0.1, 0.1, 0.1};
rotationVelocity = 0;
rotationVelocityVar = 20;
volume = 1;
rubbing = 0.1;
onTimerScript = "";
beforeDestroyScript = "";
blockAIVisibility = 1;
};
class ACE_SmokeBaseMedium: ACE_SmokeBaseLarge {
destroyOnWaterSurfaceOffset = -6;
size[] = {0.05, 3, 9, 12};
};
class ACE_SmokeBaseSmall: ACE_SmokeBaseLarge {
destroyOnWaterSurfaceOffset = -4;
size[] = {0.05, 2, 6, 8};
};
// - 40mm smoke grenades --------------------------------------------------
class ACE_SmokeBase40mm: ACE_SmokeBaseLarge {
destroyOnWaterSurfaceOffset = -5;
lifeTime = 15;
size[] = {0.05, 2.5, 7.5, 10};
};
// - Artillery smoke submunition ------------------------------------------
class ACE_SmokeBaseArtilleryLarge: ACE_SmokeBaseLarge {
lifeTime = 45;
};
class ACE_SmokeBaseArtillerySmall: ACE_SmokeBaseSmall {
lifeTime = 45;
};
// - Smoke on water surface -----------------------------------------------
class ACE_SmokeAfterWaterWhite: ACE_SmokeBaseLarge {
interval = 0.05;
destroyOnWaterSurfaceOffset = -3;
size[] = {0.05, 2, 6};
sizeVar = 1;
lifeTime = 10;
color[] = {
{0.5, 0.5, 0.5, 0.1},
{0.5, 0.5, 0.5, 0}
};
moveVelocityVar[] = {0, 0, 0};
colorCoef[] = {1, 1, 1, 1};
};
class ACE_SmokeAfterWaterRed: ACE_SmokeAfterWaterWhite {
colorCoef[] = SMOKE_COLOR_RED;
};
class ACE_SmokeAfterWaterGreen: ACE_SmokeAfterWaterWhite {
colorCoef[] = SMOKE_COLOR_GREEN;
};
class ACE_SmokeAfterWaterYellow: ACE_SmokeAfterWaterWhite {
colorCoef[] = SMOKE_COLOR_YELLOW;
};
class ACE_SmokeAfterWaterPurple: ACE_SmokeAfterWaterWhite {
colorCoef[] = SMOKE_COLOR_PURPLE;
};
class ACE_SmokeAfterWaterBlue: ACE_SmokeAfterWaterWhite {
colorCoef[] = SMOKE_COLOR_BLUE;
};
class ACE_SmokeAfterWaterOrange: ACE_SmokeAfterWaterWhite {
colorCoef[] = SMOKE_COLOR_ORANGE;
};
CLOUDLET_UNDERWATER(White);
CLOUDLET_UNDERWATER(Red);
CLOUDLET_UNDERWATER(Green);
CLOUDLET_UNDERWATER(Yellow);
CLOUDLET_UNDERWATER(Purple);
CLOUDLET_UNDERWATER(Orange);
CLOUDLET_UNDERWATER(Blue);
};

View File

@ -0,0 +1,63 @@
// - Smoke hand grenades ------------------------------------------------------
class SmokeShellWhiteEffect {
class SmokeShell {
type = "ACE_SmokeBaseLarge";
};
class SmokeShell2 {
type = "ACE_SmokeBaseSmall";
};
};
EFFECT_HANDGRENADE(Red);
EFFECT_HANDGRENADE(Green);
EFFECT_HANDGRENADE(Yellow);
EFFECT_HANDGRENADE(Purple);
EFFECT_HANDGRENADE(Orange);
EFFECT_HANDGRENADE(Blue);
// - 40mm smoke grenades ------------------------------------------------------
class ACE_40mmSmokeShellWhiteEffect: SmokeShellWhiteEffect {
class SmokeShell: SmokeShell {
type = "ACE_SmokeBase40mm";
};
};
EFFECT_40MM(Red);
EFFECT_40MM(Green);
EFFECT_40MM(Yellow);
EFFECT_40MM(Purple);
EFFECT_40MM(Orange);
EFFECT_40MM(Blue);
// - 120mm/155mm artillery smoke ----------------------------------------------
class ACE_ArtillerySmoke {
class SmokeShell {
type = "ACE_SmokeBaseArtilleryLarge";
simulation = "particles";
position[] = {0, 0, 0};
intensity = 1;
interval = 1;
};
class SmokeShell2 {
type = "ACE_SmokeBaseArtillerySmall";
simulation = "particles";
position[] = {0, 0, 0};
intensity = 1;
interval = 1;
};
};
// - Smoke on water surface ---------------------------------------------------
class ACE_SmokeAfterWaterWhite {
class SmokeAfterWater {
type = "ACE_SmokeAfterWaterWhite";
simulation = "particles";
position[] = {0, 0, 0};
intensity = 1;
interval = 1;
};
};
EFFECT_AFTER_WATER(Red);
EFFECT_AFTER_WATER(Green);
EFFECT_AFTER_WATER(Yellow);
EFFECT_AFTER_WATER(Purple);
EFFECT_AFTER_WATER(Orange);
EFFECT_AFTER_WATER(Blue);

View File

@ -0,0 +1,10 @@
ace_particles
==========
Changes smoke particles from smoke hand grenades, 40mm grenades and artillery shells to be more realistic and useful.
## Maintainers
The people responsible for merging changes to this component or answering potential questions.
- [BaerMitUmlaut](https://github.com/BaerMitUmlaut)

View File

@ -0,0 +1,18 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author = ECSTRING(common,ACETeam);
authors[] = {"BaerMitUmlaut"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};
#include "CfgAmmo.hpp"
#include "CfgCloudlets.hpp"
#include "Effects.hpp"

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,57 @@
#define COMPONENT particles
#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_PARTICLES
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_PARTICLES
#define DEBUG_SETTINGS DEBUG_SETTINGS_PARTICLES
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define SMOKE_COLOR_RED {0.9528, 0.0438, 0.0410, 0.8}
#define SMOKE_COLOR_GREEN {0.0328, 0.1626, 0.1023, 0.8}
#define SMOKE_COLOR_YELLOW {0.9610, 0.4505, 0.0109, 0.8}
#define SMOKE_COLOR_PURPLE {0.4622, 0.0578, 0.3154, 0.8}
#define SMOKE_COLOR_BLUE {0.0355, 0.1863, 1.0000, 0.8}
#define SMOKE_COLOR_ORANGE {0.9132, 0.1763, 0.0070, 0.8}
#define EFFECT_HANDGRENADE(color) class SmokeShell##color##Effect: SmokeShellWhiteEffect { \
class SmokeShell: SmokeShell { \
type = "ACE_SmokeBaseMedium"; \
}; \
}
#define EFFECT_40MM(color) class ACE_40mmSmokeShell##color##Effect: ACE_40mmSmokeShellWhiteEffect { \
class SmokeShellUW { \
simulation = "particles"; \
type = QUOTE(SmokeShell##color##UW); \
position[] = {0, 0, 0}; \
intensity = 1; \
interval = 1; \
}; \
class SmokeShell2UW { \
simulation = "particles"; \
type = QUOTE(SmokeShell##color##2UW); \
position[] = {0, 0, 0}; \
intensity = 1; \
interval = 1; \
}; \
}
#define MERGE(var1,var2) var1##var2
#define EFFECT_AFTER_WATER(color) class ACE_SmokeAfterWater##color##: ACE_SmokeAfterWaterWhite { \
class SmokeAfterWater: SmokeAfterWater { \
type = QUOTE(MERGE(ACE_SmokeAfterWater,color)); \
}; \
}
#define CLOUDLET_UNDERWATER(color) class SmokeShell##color##UW; \
class SmokeShell##color##2UW: SmokeShell##color##UW { \
postEffects = QUOTE(MERGE(ACE_SmokeAfterWater,color)); \
}