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 11:16] – [Diagnostics] hnegmore_dts [2021/12/06 12:08] (current) – ["Importing" Parameters] hneg
Line 236: Line 236:
 ===== Diagnostics ===== ===== Diagnostics =====
 When running the [[url|diagnostic.exe]] of the game the particle related diagnostic switches are available in the [[ped_ui#special|Special leaf]]: 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.. +  * **//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+  * **//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.1638789385.txt.gz · Last modified: 2021/12/06 11:16 by hneg