Space Engineers

Space Engineers

Not enough ratings
Thruster FX - Framework
By Mexpex
How to use "Thruster FX - Framework" when modding SE thrusters
   
Award
Favorite
Favorited
Unfavorite
Framework
Introduction
This is a brief guide of how to use the Thruster FX framework in your own mods.
An example setup can be found here (git link[github.com]). You can use it as a base for your setup. It includes a working example block and a general config example.
When testing the example or your own mod, be sure to also add "Thruster FX - Framework" from the workshop since it dosn't add itself to local mods.

In your mods "Data" folder, add a text file and name it "DefinitionExtensions". This is required as it is in this file you add the path to where you keep your config file(s).

Configs can be made in two ways. Either put it in your block definition in you cubeblock.sbc file or put it separately in a xml file. In this example I will go with the xml.

Create a config, copy one from git or an existing config.
Add the config file to your project and add it's path to the "DefinitionExtensions.txt". The path should be relative to your mods Data folder. If it's directly in the Data folder you just add the config files name. Example: cubeblock/MyConfigFile.xml.

With this config added to your project you can now have a look at the variables


Notes
By having this setup in your mod you just have added the support for Thruster FX Framework. It's up to you if you want Thruster FX - Framework to be a required dependency or an optional feature

I hope this helps
This guide is still a work in progress so details might be missing
Config Content
General Settings
Variable Name
Description
Default value
ID
SubTypeID of the thruster block
-
hideVanillaFlame
Hides the vanilla thruster flames
false
ThrustRateGain
Affects how quickly the thrust intensity will increase when thrusting
-
ThrustRateLoss
Affects how quickly the thrust intensity will decrease when not thrusting
-
UseEmissive
Toggle the use of emissive
false
EmissiveMaterial
Emissive material used for emissive
false
EmissiveRateGain
Affects how quickly the emissive intensity will increase when thrusting
false
EmissiveRateLoss
Affects how quickly the emissive intensity will decrease when not thrusting
false
EnableAdvMaterialSetup
Enable the use of configurations of multiple emissive materials using "AdvMaterialSetup".
Empty
EmitterSetup
Contains the configuration for particles and how they are used. Is in a custom text format (see config formats).
AdvMaterialSetup
Contains the configuration for the advanced material setup. Is in a custom text format (see config formats).


Emitter Configuration
Variable Name
Description
Default value
Type
Specifies which type of particle to be used in this config.
PARTICLE | Used for normal particle systems
SPRITE | Used for SPRITE based effects that require an offset to "stay in place". Example would be a flame sprite that starts near an edge. since the particle plane scale by its center it would move into the thruster while scaling.
PARTICLE
Offset
Moves the particle origin in the forward direction of the flame dummy
false
OffsetScaling
Scales the offset value (Only affects SPRITE)
false
Size
Particle Size
AtmoOnly
Prevent the particle to trigger in atmosphere
AtmoDensityLimitMin
Set the minimum atmophere density where the particle will trigger
AtmoDensityLimitMax
Set the maximum atmophere density where the particle will trigger
AltitudeLimitMin
Set the minimum altitude where the particle will trigger
AltitudeLimitMax
Set the maximum altitude where the particle will trigger
ThrustMin
Set the minimum thrust where the particle will trigger. Example: If thrust is under 0.5 the particle will not trigger.
ThrustMax
Set the maximum thrust where the particle will trigger. Example: If thrust is over 0.5 the particle will not trigger.
VelocityScalingFrom | VelocityScalingTo
The particle velocity will be multiplied with this value. A blend between "From" -> "To" based on thrust intensity. Enables you to have fewer particles instead of one per velocity step
From: -1 (disabled)
Dummies
Particle will use the dummy set in here. If you set several dummies, each dummy will use the same emitter setup. Dummies are separated by ','
"flame"
CullingTime
Time in ticks before unused particles will be removed in order to save on performance. 1s = 60t. Try to match it to max life of an emitter in your particle system.Particel Life + Life variance.
90

Advanced Emissive Configuration
Variable Name
Description
Default value
MaterialName
Material Name
heatup
EmissiveIntensity
Emissive Intensity
1.0
ColorOverride
Enable override color
false
EmissiveColor
Color used to override the emissive color
[0,1,0,0]
HeatIntensityStart
Start of this emissive setting relative to heat intensity
0.0
HeatIntensityEnd
End of this emissive setting relative to heat intensity
1.0
EmissiveMode
Define how the emissive will work.
Normal = aterial color or override color * intensity
Toggle = Material color or override color, always at max value;
Remapped = As normal but intensity is mapped as 0-1 within HeatIntensityStart/End ;
normal

Setup Text Format
Both "Emitter Configuration" and "Advanced Emissive Configuration" uses special formating to parse the config.
Symbol
Description
=
Used to separate sections in the configuration.
;
Used to separate variables within a section.

Format example of of a configuration with two sections:
Name: BlockMan; Size : 0.6; = Name: CylinderDude; Size : 0.0
Tips
Particles and Emitters
When creating your particles system you should try to use as few emitters as possible. Each emitter in view counts towards the hard coded limit, I think its ~1000 emitters in view.
Example, when your thuster is thrusting and you have a flame particle with 2 emitters and a smoke particle with 3 emitters, that will be 5 emitters per thruster. It will add up quickly.

More tips coming soon(tm)
1 Comments
xXShadowNinjaXx 17 Nov, 2023 @ 1:26pm 
hey, is there a video on how to do this? I'm a bit dumb.