ace_map: More realistic flashlight glow + minor fix (#3824)

* -Converted flashlight glow object to chemlight type (emits light without sprite)
-Fixed issue where glow object was being deleted without being first detached

* Cleanup of temp classes.

* Spaces before and after =

* Moved effects into Effects.hpp.
This commit is contained in:
voiperr 2016-05-27 10:16:15 -07:00 committed by jonpas
parent 9cccacd74d
commit 52ea640c4b
6 changed files with 126 additions and 43 deletions

View File

@ -1,48 +1,54 @@
class CfgAmmo {
class FlareCore;
class Chemlight_base;
class FlareBase: FlareCore {};
class F_20mm_White: FlareBase {};
class ACE_FlashlightProxy_White: F_20mm_White {
class ACE_FlashlightProxy_White: Chemlight_base {
model = "\A3\Weapons_f\empty";
effectFlare = "FlareShell";
effectsSmoke = "ACE_FlashlightEffect_White";
explosionTime = 0.01;
timeToLive = 1e10;
triggerTime = 0;
intensity = 0.5;
flareSize = 1;
timeToLive = 10e10;
lightColor[] = {1,1,1,1};
grenadeBurningSound[] = {};
grenadeFireSound[] = {};
soundTrigger[] = {};
SmokeShellSoundHit1[] = {};
SmokeShellSoundHit2[] = {};
SmokeShellSoundHit3[] = {};
SmokeShellSoundLoop1[] = {};
SmokeShellSoundLoop2[] = {};
soundImpactHard1[] = {"",1,1};
soundImpactHard2[] = {"",1,1};
soundImpactHard3[] = {"",1,1};
soundImpactHard4[] = {"",1,1};
soundImpactHard5[] = {"",1,1};
soundImpactHard6[] = {"",1,1};
soundImpactHard7[] = {"",1,1};
soundImpactIron1[] = {"",1,1};
soundImpactIron2[] = {"",1,1};
soundImpactIron3[] = {"",1,1};
soundImpactIron4[] = {"",1,1};
soundImpactIron5[] = {"",1,1};
soundImpactSoft1[] = {"",1,1};
soundImpactSoft2[] = {"",1,1};
soundImpactSoft3[] = {"",1,1};
soundImpactSoft4[] = {"",1,1};
soundImpactSoft5[] = {"",1,1};
soundImpactSoft6[] = {"",1,1};
soundImpactSoft7[] = {"",1,1};
soundImpactWater1[] = {"",1,1};
soundImpactWater2[] = {"",1,1};
soundImpactWater3[] = {"",1,1};
soundImpactWoodExt1[] = {"",1,1};
soundImpactWoodExt2[] = {"",1,1};
soundImpactWoodExt3[] = {"",1,1};
soundImpactWoodExt4[] = {"",1,1};
};
class ACE_FlashlightProxy_Red: ACE_FlashlightProxy_White {
intensity = 1;
lightColor[] = {1,0,0,1};
};
class ACE_FlashlightProxy_Green: ACE_FlashlightProxy_White {
intensity = 1;
lightColor[] = {0,1,0,1};
effectsSmoke = "ACE_FlashlightEffect_Red";
};
class ACE_FlashlightProxy_Blue: ACE_FlashlightProxy_White {
intensity = 1.5;
lightColor[] = {0.25,0.25,1,1};
effectsSmoke = "ACE_FlashlightEffect_Blue";
};
class ACE_FlashlightProxy_Green: ACE_FlashlightProxy_White {
effectsSmoke = "ACE_FlashlightEffect_Green";
};
class ACE_FlashlightProxy_Yellow: ACE_FlashlightProxy_White {
intensity = 1;
lightColor[] = {1,1,0.5,1};
effectsSmoke = "ACE_FlashlightEffect_Yellow";
};
};

35
addons/map/CfgLights.hpp Normal file
View File

@ -0,0 +1,35 @@
class CfgLights {
class Chemlight_Blue;
class ACE_FlashlightLight_White: Chemlight_Blue {
brightness = 100;
color[] = {1,1,1,1};
diffuse[] = {1,1,1};
intensity = 100;
position[] = {0,0,0};
class Attenuation {
constant = 0;
linear = 0;
quadratic = 10000;
start = 0.075;
};
};
class ACE_FlashlightLight_Red: ACE_FlashlightLight_White {
diffuse[] = {1,0,0};
};
class ACE_FlashlightLight_Blue: ACE_FlashlightLight_White {
diffuse[] = {0.25,0.25,1};
};
class ACE_FlashlightLight_Green: ACE_FlashlightLight_White {
diffuse[] = {0,1,0};
};
class ACE_FlashlightLight_Yellow: ACE_FlashlightLight_White {
diffuse[] = {1,1,0.4};
};
};

36
addons/map/Effects.hpp Normal file
View File

@ -0,0 +1,36 @@
// "Smoke" effect classes for global flashlight glow
class ACE_FlashlightEffect_White {
class Light1 {
simulation = "light";
type = "ACE_FlashlightLight_White";
};
};
class ACE_FlashlightEffect_Red {
class Light1 {
simulation = "light";
type = "ACE_FlashlightLight_Red";
};
};
class ACE_FlashlightEffect_Blue {
class Light1 {
simulation = "light";
type = "ACE_FlashlightLight_Blue";
};
};
class ACE_FlashlightEffect_Green {
class Light1 {
simulation = "light";
type = "ACE_FlashlightLight_Green";
};
};
class ACE_FlashlightEffect_Yellow {
class Light1 {
simulation = "light";
type = "ACE_FlashlightLight_Yellow";
};
};

View File

@ -9,6 +9,7 @@ if (isServer) then {
{
if (_x isKindOf "ACE_FlashlightProxy_White") then {
// ACE_LOGINFO_2("Deleting leftover light [%1:%2] from DC player [%3]", _x, typeOf _x, _disconnectedPlayer);
detach _x;
deleteVehicle _x;
};
} forEach attachedObjects _disconnectedPlayer;

View File

@ -29,6 +29,8 @@ class RscEdit;
#include "CfgVehicles.hpp"
#include "CfgAmmo.hpp"
#include "CfgSounds.hpp"
#include "CfgLights.hpp"
#include "Effects.hpp"
class RscMapControl {
maxSatelliteAlpha = 0.5;

View File

@ -20,7 +20,10 @@ private ["_light", "_color", "_class"];
params ["_flashlight"];
_light = GVAR(glow);
if (!isNull _light) then {deleteVehicle _light};
if (!isNull _light) then {
detach _light;
deleteVehicle _light;
};
if (_flashlight != "") then {
_color = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour");
@ -28,7 +31,7 @@ if (_flashlight != "") then {
_class = format["ACE_FlashlightProxy_%1", _color];
_light = _class createVehicle [0,0,0];
_light attachTo [ACE_player, [0,0.5,-0.1], "head"];
_light attachTo [ACE_player, [0,0.1,-0.05], "neck"];
} else {
_light = objNull;
};