User Tools

Site Tools


more_dts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
more_dts [2021/12/06 10:50] – [Selection Attach] hnegmore_dts [2021/12/06 12:08] (current) – ["Importing" Parameters] hneg
Line 177: Line 177:
 <wrap important>__Pressing left mouse button attaches the emitter to that position on the object and it will stay on that position in-game.__</wrap> <wrap important>__Pressing left mouse button attaches the emitter to that position on the object and it will stay on that position in-game.__</wrap>
 This works also inside buildings so you can attach emitters to building inside ceiling, walls etc. This works also inside buildings so you can attach emitters to building inside ceiling, walls etc.
-<WRAP important>NOTE that the mouse cursor moves in 2D and the scene you’re watching is in 3D so even though it might appear to you that the cursor is over the object it might not be for the ray-casting” that finds the object surface. So it can be a bit frustrating at times especially if you get into macro details.</WRAP>+<WRAP important>NOTE that the mouse cursor moves in 2D and the scene you’re watching is in 3D so even though it might appear to you that the cursor is over the object it might not be for the "ray-castingthat finds the object surface. So it can be a bit frustrating at times especially if you get into macro details.</WRAP>
 <WRAP important>Even though the Global attach can be used with terrain objects it’s a bit moot given the fact that you can already have the emitter/emitter sets follow object surfaces while dragging them with Surface Snapping on.</WRAP> <WRAP important>Even though the Global attach can be used with terrain objects it’s a bit moot given the fact that you can already have the emitter/emitter sets follow object surfaces while dragging them with Surface Snapping on.</WRAP>
 +
 +==== SHIFT + ALT + A "method" ====
 +This keybind attaches the emitters dragged over an Eden entity with the Eden //Surface snapping// and the tools //Surface Snapping slavery// **//on//** (this 'slavery' is **//on//** by default). Works only on Eden entities.
 +
 +This is very similar to the **//Global attach//** mode, the key differences are that this is of course done via dragging the emitters to the desired spot on the entity instead of the emitters following the camera aim, and unlike with **//Global attach//** this works on the outside surfaces of the entity only.
 +
 +So, to reiterate: drag some emitter onto an Eden entity and press ``SHIFT + ALT + A`` and the emitter will be attached to that spot on the entity.
 +
 +
 +==== Attach Finesse ====
 +Emitters attached to an entity with any of the attach methods, except Selection Attach, can have their positioning fine-tuned in two ways:
 +  - Adjusting the values in the Position field. Note that the values are in model space.
 +  - Adjusting the emitter's position with the Translation Widget; activate the widget, select the emitter to adjust, press and hold down ``CTRL`` on your keyboard → the emitter gets a green "move reticle" indicating it can be move with the widget:
 +{{  :move_ret.png  |}}
 ===== Trigger Sync ===== ===== Trigger Sync =====
 +Like already touched on in the various examples this allows for a control over when emitter emits via a trigger synced to the emitter.
 +<WRAP important>NOTE that the normal Eden Sync does NOT work with this, you have to use the tool specific sync that can only be achieved with the keybind ``ALT + S``</WRAP>
  
 +The sync works so that when synced to a trigger the emitter will not start emitting in-game until the trigger is activated, and if the trigger is set to //Repeatable// emitter will also stop emitting once the trigger deactivates.
 +
 +To sync an emitter to a trigger: select the emitter/emitter set, hover over the trigger (so that it’s highlighted, the color changes darker) and press ``SHIFT + ALT + S``. You can see the trigger name change in the entity list, with single emitter it says //activator_*emitter name*// and with more emitters or emitter sets the name will include parts of the names of all synced emitters:
 +{{  :att_xmpl_005_002.png  |}}
 +<WRAP important>NOTE that you can only sync one trigger to the emitter. You can however sync several emitters to one trigger.</WRAP>
 +To de-sync emitter from the trigger: select emitter, hover mouse cursor over empty area and press ``SHIFT + ALT + S`` (or delete the blue "sync line").
 ===== Importing BI Fire/Smoke Modules ===== ===== Importing BI Fire/Smoke Modules =====
 +This is done by pressing the **//Import Modules//** button that can be found under the [[ped_ui#special|Special leaf]] of the [[ped|Particle Editor section]], or automatically when you load a scenario that has these modules present into Eden.
  
 +What it does it imports any BI fire or smoke effect modules present in the scenario into the tool.
 +<WRAP important>The import process removes the modules and replaces them with the emitters with the parameters the modules were using.</WRAP>
 +If the module has a name the name will be adopted for the created emitter, if not the emitter will get a default //moduleSmoke_emitter_X/ moduleSmoke_emitter_X// name.
 +
 +When loading a scenario with the modules into Eden the tool will give you a prompt asking if you wish to import the modules:
 +{{:xmpl_007_001.png|}}
 +If you check the //Don't show this message again// box this prompt will not be shown again (unless you go to the [[ped_ui#prefs|Prefs Leaf]] and press the **//OK pop-ups//** button).
 ===== Die Out ===== ===== Die Out =====
 +This can be found under the [[ped_ui#special|Special leaf]] in [[ped|Particle Editor section]] and in the [[led_ui#light_params|Params leaf]] of the [[led|Light editor section]].
  
 +As explained in the examples this is timer in seconds after which the selected emitter/emitter set will be deleted.
 +The timer starts from the moment the emitter starts to emit in-game.
 +<WRAP important>NOTE that the emitter will not die out gradually, it will be deleted immediately when the time is up.
 +
 +NOTE that this will start a looping script for the emitter, and in an emitter set for each individual emitter.</WRAP>
 ===== Follow objectHide ===== ===== Follow objectHide =====
 +This can be found under the [[ped_ui#special|Special leaf]] in [[ped|Particle Editor section]] and in the [[led_ui#light_params|Params leaf]] of the [[led|Light editor section]].
  
-===== Diagnostics =====+Does what it says on the tin, makes the selected emitter/emitter set hide/show depending on the //hideObject// status of the object it is attached to (to confuse, the name of this functionality is derived from the scripting command [[url|isObjectHidden]], not [[url|hideObject]]).
  
 +Meaning if the object is hidden with ??obj hideObject true?? in-game the emitter will also "hide", as in stop emitting. And when the object is shown again with ??obj hideObject false?? the emitter will also show up and start emitting again. This should make this dynamic simulation friendly.
 +<WRAP alert>This is optional for a reason: __this will spawn a looping script for each object it is used on__, single emitters and emitter sets act alike, one script spawned for the object they’re attached to.
 +Ie. if you have 50 emitters attached to one object there’s still only one spawned script. But still optional as it might raise a performance concern if forced on each object by default, if you have 50 objects with attached emitters it would mean 50 scripts...
 +The loop is "sleepy" so it doesn’t run on every frame or anything, each iteration is paused for a random time between 0.3 and 1 second.</WRAP>
 +<WRAP important>NOTE that due to the pause in the loop the emitter will not react immediately to the object hide, there’s a small delay.
 +
 +Why a looping script? Because there is no eventhandler to detect if object is hidden or not.</WRAP>
 +<WRAP important>NOTE: does nothing if the emitter/emitter set is not attached to anything.</WRAP>
 +===== Diagnostics =====
 +When running the [[url|diagnostic.exe]] of the game the particle related diagnostic switches are available in the [[ped_ui#special|Special leaf]]:
 +  * **//Particles//**:\\ Shows the diagnostic data of the particles in the scene; counts and effect class names. This is a tad sucky because emitters inserted with this tool get their effect name from several scriptnames for some reason so the names block the count data..
 +  * **//Particle names//**:\\ Shows a name attached to each particle emitted by the emitters in the scene
 ===== Data Validation ===== ===== Data Validation =====
 +The parameter fields on the tool UI all except the menus have a data validation system "built" into them. Earlier in this manual when the different parameters were explained there was a Datatype is number type of things mentioned. Those refer to this validation as the parameter fields only accept certain type of data; number, string or array.
  
 +When you insert some value into a parameter field the field and the data in it will turn briefly to yellow which indicates the data is being validated:
 +{{:valid_001.png|}}
 +Once it validates it turns back to white.
 +<WRAP important>NOTE: With arrays the data may stay yellow until you finish filling up the array.</WRAP>
 +If it doesn’t validate it turns red:
 +{{:valid_002.png|}}
 +Also a notification is shown on the top of the screen which can vary: usually you will get "Illegal character in data!" if using string where number should be used and so on.
 +When using some global variable that doesn't exist (like some entity name) you will get "Wrong data type".
 +
 +The param field stays red for annoyingly long time to remind you what you just did and then turns back to white and fills the field with either its default data or last successfully validated data.
 +
 +Some faulty data is so faulty that the game can't continue with it and a visible scripting error is shown and the validation for that field can break down (stays yellow or red). That I can't do anything about because there is no way to detect scripting errors, so you just have to be careful..
 +<WRAP important>NOTE: You can turn the data validation off in the [[ped_ui#prefs|Prefs leaf]], at your own possible peril.</WRAP>
 ===== "Importing" Parameters ===== ===== "Importing" Parameters =====
 +As mentioned in the Export/Import leaf explanations it was briefly mentioned that you can "paste" parameters "into" an emitter.
 +
 +Meaning that you can paste emitter parameters into the "export fields" and press **//Paste params//** button to "inject" the parameters into the selected emitter.
 +<WRAP important>NOTE that there are some limitations to this though, for example if the parameters you are going to pass include references to an object, be it as the "attachedto" parameter or via some calculations on direction or whatever __**will not work**__.</WRAP>
 +
 +Obviously each parameter "type" has to be pasted into the correct field, self-explanatory but for particles
 +  * parameters for [[https://community.bistudio.com/wiki/setParticleParams|setParticleParams]] go into **//Particle Params//** field
 +  * parameters for [[https://community.bistudio.com/wiki/setParticleRandom|setParticleRandom]] go into **//Particle//** Random field
 +  * parameters for [[https://community.bistudio.com/wiki/setParticleCircle|setParticleCircle]] go into **//Particle Circle//** field
 +  * parameters for [[https://community.bistudio.com/wiki/setParticleFire|setParticleFire]] go into **//Particle Fire//** field
 +  * parameter for [[https://community.bistudio.com/wiki/setDropInterval|setDropInterval]] go into **//Drop Interval//** field
 +
 +And for lights
 +  * parameters for [[https://community.bistudio.com/wiki/setLightColor|setLightColor]] go into **//Light Color//** field
 +  * parameters for [[https://community.bistudio.com/wiki/setLightAmbient|setLightAmbient]] go into **//Light Ambient//** field
 +  * parameters for [[https://community.bistudio.com/wiki/setLightIntensity|setLightIntensity]] go into **//Light Intensity//** field
 +  * parameter for [[https://community.bistudio.com/wiki/setLightFlare|setLightFlare]] go into **//Use Flare//** field
 +  * parameter for [[https://community.bistudio.com/wiki/setLightFlareSize|setLightFlareSize]] go into **//Flare Size//** field
 +  * parameter for [[https://community.bistudio.com/wiki/setLightFlareMaxDistance|setLightFlareMaxDistance]] go into **//Flare Max Dist.//** Field
 +  * parameter for [[https://community.bistudio.com/wiki/setLightDayLight|setLightDaylight]] go into **//Daylight//** field
 +  * parameters for [[https://community.bistudio.com/wiki/setLightAttenuation|setLightAttenuation]] go into **//Attenuation//** field
 +  * parameter for [[https://community.bistudio.com/wiki/setLightIR|setLightIR]] go into **//isIR//** field
 +  * parameters for [[https://community.bistudio.com/wiki/setLightConePars|setLightConePars]] go into **//Dir Params//** field
 +  * parameters for [[https://community.bistudio.com/wiki/setLightVolumeShape|setLightVolumeShape]] go into **//Shape Params//** field
 +
 +This works the same for both particle and light emitters. Let’s say you have something like this in your script:
 +<code>_p setParticleParams [
 + ["\A3\data_f\ParticleEffects\Universal\Universal_02", 8, 0, 1, 0],
 + "",
 + "Billboard",
 + 1,
 + 0.5,
 + [0, 0, 0],
 + [0, 0, 0],
 + 1,
 + 1.23,
 + 1,
 + 0.2,
 + [0.6, 1.8, 2.5],
 + [[0.5, 0.5, 0.5, 0.14],[0.6, 0.6, 0.6, 0.06],[0.7, 0.7, 0.7, 0.02],[0.8, 0.8, 0.8, 0.006],[0.9, 0.9, 0.9, 0.001]],
 + [5],
 + 0.1,
 + 0.1,
 + "",
 + "",
 + "",
 + 0,
 + false,
 + 0,
 + [[0, 0, 0, 0]]
 +];
 +
 +_p setParticleRandom [
 + 0.2,
 + [0.08, 0.08, 0.08],
 + [0.3, 0.3, 0.3],
 + 20,
 + 0.15,
 + [0, 0, 0, 0],
 + 0,
 + 0,
 + 1,
 + 0
 +];
 +
 +_p setDropInterval 0.0035;</code>
 +
 +To "import" that place a single particle emitter, select it and go to the [[ped_ui#export_import|Export/import leaf]].
 +There is already data because the placed emitter by default has some parameters. So wipe those off first (press the **//Clear//** button).
 +<WRAP important>NOTE: Using wrong parameters in wrong fields causes errors on "import". Only paste the parameters, nothing else.</WRAP>
 +Then copy paste the parameters only, as in the value after the scripting command (array or number), on their respective fields on the tool and once done press the **//Paste Params//** button. The "missing" parameters get automatically populated with the default values and the emitter starts emitting the effect. Including the ??;?? after the value is not an error so no need to worry about that.
 +In case of this example the "imported" effect is a smoke (values are from //ArtilleryShell1// class), you should see this kind of result:
 +{{:importpars.png|}}
 +
 +It’s exactly the same method for lights, with the only exception of the export/import leaf looking a bit different.
 +<WRAP important>NOTE: the tool uses intensity as lights brightness value as setLightBrightness is outdated command, so if you use setLightBrightness in your "imported" script you have two options:
 +  - Change setLightBrightness into setLightIntensity and multiply the value with 3000 (brightness x 3000 = intensity)
 +  - just paste the brightness value into the Intensity field and hold down ``CTRL`` while pressing the **//Import//** button and the tool will do that conversion
 +</WRAP>
more_dts.1638787838.txt.gz · Last modified: 2021/12/06 10:50 by hneg