====== In-game Functions ====== As the tool only does things in Eden only but you need to "gain access" to the emitters while your scenario is running, like deleting or otherwise manipulating the emitters or their parameters, you need to rely on some functions that need to be copy/pasted into your scenario folder and stuff added into your description.ext file, exactly as is. ===== Set Up ===== Where the functions are located depends on your download method: * if your downloaded the 7z package "manually" the functions can be found in that package, folder is called //HNEG_emed_scenario_functions// * if you downloaded from Steam you will find the //HNEG_emed_scenario_functions// folder in the installation location, which you can access with the game launcher the easiest, in the doc folder where this file also resides. The folder HNEG_emed_scenario_functions has to be copied into your scenario exactly directory __**as is**__. So your scenario directory would look something like this: {{ :dir.png |}} Once the folder is copy/pasted in to the scenario directory the easiest way you can gain access to the functions by defining them in the [[url|description.ext CfgFunctions]]. There are two ways to do this depending if you already have //CfgFunctions// in your description.ext or not. If you **DO NOT** have //CfgFunctions// defined you can copy/paste the following into your description.ext: class CfgFunctions { #include "HNEG_emed_scenario_functions\HNEG_emed_scenario_functions.hpp" }; If you **DO** have //CfgFunctions// already defined, just copy/paste the following "into" it: #include "HNEG_emed_scenario_functions\HNEG_emed_scenario_functions.hpp" ===== Function List ===== Each function needs the prefix //HNEG_fnc_// when called, as in for example ??call HNEG_fnc_allEmitters?? ==== allEmitters ==== Returns all the emitters in the scenario inserted via this tool. NOTE that this is heavy on performance. Arguments: * none Returns: * Array of #particleSources and/or #lightpoints Usage: call HNEG_fnc_allEmitters ==== allEmittersNames ==== Returns the names of all the emitters inserted via this tool. NOTE that this is heavy on performance. Arguments: * none Returns: * Array of STRINGS Usage: call HNEG_fnc_allEmittersNames ==== attachEmitter ==== Attaches emitter inserted via this tool to some object. Optional position offset or selection, or [selection, pos offset] can be passed. Arguments: * OBJECT (emitter) or STRING (emitter name), object to attach to (OBJECT), offset (ARRAY) or model selection (STRING) or model selection with position offset ([STRING, ARRAY]) Returns: * nothing Usage: //attach the emitter to the object center/rotation center in model space [_emtr1, _helo] call HNEG_fnc_attachEmitter; //attach the emitter to the object center/rotation center in model space ["particle_emitter_6", _helo] call HNEG_fnc_attachEmitter; //attach the emitter to the object center/rotation center model space, with position offset ["particle_emitter_6", _helo, [0, 0, -5]] call HNEG_fnc_attachEmitter; //attach the emitter to the object model selection "head" ["particle_emitter_6", _man1, "head"] call HNEG_fnc_attachEmitter; //attaches the emitter to the object model selection "head" with position offset (from the selection) ["particle_emitter_6", _man1, ["head", [0, 0.3, 0.4]]] call HNEG_fnc_attachEmitter; ==== attachEmitterSet ==== Same as above but for emitter sets, only difference is that accepts emitter set object array as input. Arguments: * OBJECT (emitter) or STRING (emitter name) or ARRAY of objects (emitter set), object to attach to (OBJECT), offset (ARRAY) or model selection (STRING) or model selection with position offset ([STRING, ARRAY]) Returns: * nothing Usage: //attach the emitter set the given emitter belongs to the object center/rotation center in model space [_emtr1, _helo] call HNEG_fnc_attachEmitter; //attach the given emitter set to the object model selection "head" with position offset (from the selection) ["particle_emitter_6", _man1, ["head", [0, 0.3, 0.4]]] call HNEG_fnc_attachEmitterSet; ==== deleteEmitter ==== Deletes given emitter by name or by the object name it's attached to. __If the emitter is part of an emitter set the whole set will be deleted__. Arguments: * OBJECT (any object) or STRING (emitter name) Returns: * nothing Usage: "particle_emitter_6" call HNEG_fnc_deleteEmitter; //deletes emitter with the name "particle_emitter_6" e_car1 call HNEG_fnc_deleteEmitter; //deletes emitter(s) attached to an object named e_car1 ==== deleteAllEmitters ==== Deletes all emitters inserted by Emitter 3Ditor in the scenario. Arguments: * none Returns: * nothing Usage: call HNEG_fnc_deleteAllEmitters; //deletes all emitters ==== detachEmitter ==== Detaches given emitter if attached to some entity. Arguments: * OBJECT (emitter) or STRING (emitter name) Returns: * nothing Usage: _emtr1 call HNEG_fnc_detachEmitter; "particle_emitter_6" call HNEG_fnc_detachemitter; ==== detachEmitterSet ==== Same as above but for detaching whole emitter sets. Only difference is that accepts emitter set object array as input. Arguments: * OBJECT (emitter) or STRING (emitter name) or ARRAY of objects (emitter set) Returns: * nothing Usage: _emtr1 call HNEG_fnc_detachEmitterSet; "particle_emitter_6" call HNEG_fnc_detachemitterSet; _emtrSet1 call HNEG_fnc_detachEmitterSet; ==== findEmitter ==== Find an emitter by name. Arguments: * emitter name (STRING) Returns: * #particleSource, #lightpoint or #lightreflector (OBJECT), objNull if no emitter is found Usage: "poop_schute" call HNEG_fnc_findEmitter ==== getAllEmitterParams ==== TODO: IR and direction stuff Returns all the parameters for given emitter. Arguments: * particle name (STRING) or #particleSource / #lightpoint / #lightreflector (OBJECT) Returns (depending on emitter type): ** all particle params (ARRAY) in format:\\ .. [ (ARRAY), (ARRAY), (ARRAY), (ARRAY), (NUMBER) ] ** all light params (ARRAY) in format:\\ .. [ (ARRAY), (ARRAY), (NUMBER), (BOOL), (NUMBER), (NUMBER), (BOOL), (ARRAY) ] * if no params are found returns empty array [] Usage: _emtr1 call HNEG_fnc_getAllEmitterParams; "effing_awesome_particle" call HNEG_fnc_getAllEmitterParams; ==== getEmitterSet ==== Returns the whole emitter set if given emitter belongs to one. NOTE that this is quite heavy on performance. Arguments: * #particlesource / #lightpoint / #lightreflector (OBJECT) or emitter name (STRING) Returns: * ARRAY of emitters (OBJECTS), empty array if emitter does not belong to a set Usage: _emtr1 call HNEG_fnc_getEmitterSet; "some_emitter" call HNEG_fnc_getEmitterSet; ==== getEmitterSetTypes ==== Returns the emitter types for the whole emitter set if given emitter belongs to one. NOTE that this is quite heavy on performance. Arguments: * #particlesource / #lightpoint / #lightreflector (OBJECT) or emitter name (STRING) Returns: * ARRAY of emitter types (STRINGS), empty array if emitter does not belong to a set Usage: _emtr1 call HNEG_fnc_getEmitterSetTypes; "some_emitter" call HNEG_fnc_getEmitterSetTypes; ==== getLightAttenuation ==== Returns the attenuation data of the given light emitter, used with setLightAttenuation Arguments: * #lightpoint / #lightreflector (OBJECT) or light emitter name (STRING) Returns: * ARRAY of light attenuation values Usage: _light1 call HNEG_fnc_getLightAttenuation; "pink_light" call HNEG_fnc_getLightAttenuation; ==== getLightColor ==== Returns the color data of the given light emitter, used with setLightColor Arguments: * #lightpoint / #lightreflector (OBJECT) or light emitter name (STRING) Returns: * ARRAY of color data (RGB) Usage: _light1 call HNEG_fnc_getLightColor; "pink_light" call HNEG_fnc_getLightColor; ==== getLightDayLight ==== Returns the dayLight boolean value (true/false) of the given light emitter, used with setLightDayLight Arguments: * #lightpoint / #lightreflector (OBJECT) or light emitter name (STRING) Returns: * BOOLEAN Usage: _light1 call HNEG_fnc_getLightDayLight; "pink_light" call HNEG_fnc_getLightDayLight; ==== getLightEmissiveColor ==== Returns the emissive color data of the given light emitter, used with setLightEmissiveColor Arguments: * #lightpoint / #lightreflector (OBJECT) or light emitter name (STRING) Returns: * ARRAY of emissive color data (RGB) Usage: _light1 call HNEG_fnc_getLightEmissiveColor; "pink_light" call HNEG_fnc_getLightEmissiveColor; ==== getLightFlareMaxDistance ==== Returns the flareMaxDistance value of the given light emitter, used with setLightFlareMaxDistance Arguments: * #lightpoint / #lightreflector (OBJECT) or light emitter name (STRING) Returns: * NUMBER Usage: _light1 call HNEG_fnc_getLightFlareMaxDistance; "pink_light" call HNEG_fnc_getLightFlareMaxDistance; ==== getLightFlareSize ==== Returns the flareSize value of the given light emitter, used with setLightFlareSize Arguments: * #lightpoint / #lightreflector (OBJECT) or light emitter name (STRING) Returns: * NUMBER Usage: _light1 call HNEG_fnc_getLightFlareSize; "pink_light" call HNEG_fnc_getLightFlareSize; ==== getLightIntensity ==== Returns the Intensity value of the given light emitter, used with setLightIntensity Arguments: * #lightpoint / #lightreflector (OBJECT) or light emitter name (STRING) Returns: * NUMBER Usage: _light1 call HNEG_fnc_getLightIntensity; "pink_light" call HNEG_fnc_getLightIntensity; ==== getLightUseFlare ==== Returns the useFlare value (true/false) of the given light emitter, used with setLightUseFlare Arguments: * #lightpoint / #lightreflector (OBJECT) or light emitter name (STRING) Returns: * BOOLEAN Usage: _light1 call HNEG_fnc_getLightUseFlare; "pink_light" call HNEG_fnc_getLightUseFlare; ==== getParticleCircle ==== Returns the given #particlesource particleCircle, used with setParticleCircle Arguments: * particle name (STRING) or #particleSource (OBJECT) Returns: * particle circle (ARRAY) Usage: _flame1 call HNEGfnc_getParticleCircle; "my_awesome_flameo" call HNEG_fnc_getParticleCircle; ==== getParticleFire ==== Returns the given emitter particle fire (fire damage), used with setParticleFire Arguments: * particle name (STRING) or #particleSource (OBJECT) Returns: * particle fire (ARRAY) Usage: _flame1 call HNEG_fnc_getParticleFire; "my_awesome_flameo" call HNEG_fnc_getParticleFire; ==== getParticleInterval ==== Returns the given emitter particle drop interval, used with setDropInterval Arguments: * particle name (STRING) or #particleSource (OBJECT) Returns: * drop interval (NUMBER) Usage: _flame call HNEG_fnc_getParticleInterval; "my_awesome_flameo" call HNEG_fnc_getParticleInterval; ==== getParticleParams ==== Returns the given emitter particle params, used with setParticleParams Arguments: * particle name (STRING) or #particleSource (OBJECT) Returns: * particle params (ARRAY) Usage: _flame call HNEG_fnc_getParticleParams; "my_awesome_flameo" call HNEG_fnc_getParticleParams; ==== getParticleRandom ==== Returns the given #particlesource random params, used with setParticleRandom Arguments: * particle name (STRING) or #particleSource (OBJECT) Returns: * particle random (ARRAY) Usage: _flame1 call HNEG_fnc_getParticleRandom; "my_awesome_flameo" call HNEG_fnc_getParticleRandom; ===== Examples ===== TODO