Below shows an example config to add SFX option to any prop or object. Please note, It needs to inherit the FOLDER_SFX_BASECLASS otherwise it will not work.
class Land_PREFIX_LIGHT_NAME: FOLDER_SFX_BASECLASS //INHERITING FROM BASE CONFIGS IN CONFIG.CPP
{
scope = 2;
displayName = "EDEN DISPLAY NAME";
_generalMacro = "Land_LIGHT_NAME";
author = "AUTHORS_NAME";
editorPreview = "DIRECTORY\UI\PREFIX_OBJECT_NAME.jpg";
model = "DIRECTORY\PREFIX_LIGHT_NAME.p3d";
class Reflectors
{
class Light_1 : CYT_Base_Reflectors //INHERITING FROM BASE CONFIGS IN CONFIG.CPP
{
color[] = {0.8,0.8,0.7};
intensity = 450;
innerAngle = 100;
outerAngle = 280;
drawLight = 1;
class Attenuation : Attenuation
{
start = 0;
constant = 2;
linear = 10;
quadratic = 20;
hardLimitStart = 10;
hardLimitEnd = 25;
};
};
};
aggregateReflectors[] = {{"Light_1"}};
class Attributes
{
class CYT_Obj_Light_SFX : CYT_Obj_Light_SFX //INHERITING FROM BASE CONFIGS IN CONFIG.CPP
{
defaultValue=true; // SETS THE DEFAULT VALUE FOR THE SFX TO ALWAYS BE ON
};
class CYT_Obj_Light_SFX_Percentage : CYT_Obj_Light_SFX_Percentage //INHERITING FROM BASE CONFIGS IN CONFIG.CPP
{
defaultValue=0.625; // SETS INDIVIUAL DEFAULT VALUE PROBABILITY
};
};
class EventHandlers //SWITCH DEPNDING ON TYPE OF OBJECT AND PARAMETERS NEEDED
{
//init = "_this#0 setVariable ['Common_SFX_Types', ['EFFECT_NAME']];"; // CAN SELECT ONLY ONE
init = "_this#0 setVariable ['Light_SFX_Types', ['EFFECT_NAME','EFFECT_NAME','EFFECT_NAME','EFFECT_NAME']];"; //CAN SELECT MULTIPLE
};
};
Below shows an example config for the attributes that control the SFX activation.
class CfgCytech
{
class Light_SFX
{
class Light_execute_SFX
{
class default_sfx // SFX Type
{
triggerRange = 100; // Triggers SFX if player is in range
execRange = 50; // this is added to the triggerRange and executs the SFX in this Range
synchronized = false; // Synchronized execution on all Players
repeated = false; // Repeated execution of the Effect
repeatSleep[] = {30,180}; // Time {min,max} in sec inbetween each Execution (only needed if repeated = true)
execProbability = 1; // Execution Probability each Cycle [0-1](0%-100%) (only needed if synchronized and/or repeated = true)
execServer = false; // Execution true = only on Server, false = only on Players
};
};
};
};
Once the above attributes have been met, it will then call the same SFX spawning script. Below is a list of all availible options for lights.
Single Event SFXs:
- moths
- dust
- off
- break
- breakdir
Multiple Event SFXs:
- sparks
- sparksdir
- flicker
PLEASE NOTE SOME SFX TYPES MIGHT NOT WORKING AS THEY MAY NEED CERTAIN MEMORY POINTS ON THE MODEL