Editing Darkplaces effectinfo reference

Jump to: navigation, search

Warning: You are not logged in.

Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
{{TOCRIGHT}}
 
 
EffectInfo is built-in scripting language to describe particle effects in DarkPlaces, it's pretty simple and contains basic scripting functions.
 
EffectInfo is built-in scripting language to describe particle effects in DarkPlaces, it's pretty simple and contains basic scripting functions.
  
 
Each effect can have several emitters which is defined in effectinfo.txt or maps/''mapname''_effectinfo.txt. Where mapname is a name of the map currently loaded (without path and extension).
 
Each effect can have several emitters which is defined in effectinfo.txt or maps/''mapname''_effectinfo.txt. Where mapname is a name of the map currently loaded (without path and extension).
  
==General syntax==
+
== General syntax ==
  
 
   // emitter 1
 
   // emitter 1
Line 24: Line 23:
 
   ...
 
   ...
  
==Particle parameters==
+
== Console variables ==
  
'''effect <name>'''
+
r_drawparticles : toggle drawing of all particles
 +
 
 +
r_drawparticles_drawdistance : set a maximal distance to draw particles at
 +
 
 +
cl_particles_size : this will scale a size of all particles
 +
 
 +
cl_particles_quality : multiplier of particles count spawned by emitters, better quality = more particles (1 - min, 4 - max. quality)
 +
 
 +
cl_particles_reloadeffects : reloads effectinfo.txt while in the game; that eliminates a need to quit and restart DP to see updated effects
 +
 
 +
== Particle parameters ==
 +
 
 +
''' effect <name>'''
  
 
&nbsp;&nbsp;&nbsp;Defines a new emitter with effectname is belongs to, all parms after that will be applied to that emitter.
 
&nbsp;&nbsp;&nbsp;Defines a new emitter with effectname is belongs to, all parms after that will be applied to that emitter.
  
'''count <count>'''
+
''' count <count>'''
  
 
&nbsp;&nbsp;&nbsp;How many particles to spawn at this emitter, this setting is affected by cl_particles_quality cvar
 
&nbsp;&nbsp;&nbsp;How many particles to spawn at this emitter, this setting is affected by cl_particles_quality cvar
  
'''countabsolute <count>'''
+
''' countabsolute <count>'''
  
 
&nbsp;&nbsp;&nbsp;Defines a count of particles spawned regardless of cl_particles_quality setting
 
&nbsp;&nbsp;&nbsp;Defines a count of particles spawned regardless of cl_particles_quality setting
Line 40: Line 51:
 
&nbsp;&nbsp;&nbsp;Total particles count = countabsolute + count * cl_particles_quality  
 
&nbsp;&nbsp;&nbsp;Total particles count = countabsolute + count * cl_particles_quality  
  
'''type <type>'''
+
''' type <type>'''
  
 
&nbsp;&nbsp;&nbsp;Sets a generic particle type, affect appearance, blending, physics.
 
&nbsp;&nbsp;&nbsp;Sets a generic particle type, affect appearance, blending, physics.
Line 46: Line 57:
 
&nbsp;&nbsp;&nbsp;List of particle types:
 
&nbsp;&nbsp;&nbsp;List of particle types:
  
:alphastatic : alpha-blended billboard
+
: alphastatic : alpha-blended billboard
:static : additive-blended billboard
+
: static : additive-blended billboard
:spark : additive blended, stretched (based on velocity)
+
: spark : additive blended, stretched (based on velocity)
:beam : a beam particle, drawn from origin to origin + velocity
+
: beam : a beam particle, drawn from origin to origin + velocity
:rain : a rain particle, alpha-blended spart that will cause splash effect on impact
+
: rain : a rain particle, alpha-blended spart that will cause splash effect on impact
:raindecal: oriented rain decal, additive-blended
+
: raindecal: oriented rain decal, additive-blended
:snow: alpha blended, velocity jitters in realtime
+
: snow: alpha blended, velocity jitters in realtime
:bubble: alpha-blended
+
: bubble: alpha-blended
:blood: inverse-modulated, leaves decal
+
: blood: inverse-modulated, leaves decal
:smoke: alpha-blended billboard
+
: smoke: alpha-blended billboard
:decal: makes a decal on nearest surface
+
: decal: makes a decal on nearest surface
:entityparticle: alpha-blended, this particle gets removed after being drawn (used on EF_BRIGHTFIELD)
+
: entityparticle: alpha-blended, this particle gets removed after being drawn (used on EF_BRIGHTFIELD)
  
'''blend <blendtype>'''
+
''' blend <blendtype>'''
  
 
&nbsp;&nbsp;&nbsp;Generic blend is set by type, but with this parm it cound be changed after type is defined.
 
&nbsp;&nbsp;&nbsp;Generic blend is set by type, but with this parm it cound be changed after type is defined.
Line 69: Line 80:
 
: invmod: inverse modulation (used on blood and blood decals)
 
: invmod: inverse modulation (used on blood and blood decals)
  
'''orientation <orientationtype>'''
+
''' orientation <orientationtype>'''
  
 
&nbsp;&nbsp;&nbsp;Same as for blend, generic orientation is set by type, could be altered by this parm.
 
&nbsp;&nbsp;&nbsp;Same as for blend, generic orientation is set by type, could be altered by this parm.
Line 75: Line 86:
 
&nbsp;&nbsp;&nbsp;List of orientation types:
 
&nbsp;&nbsp;&nbsp;List of orientation types:
  
:billboard : always turned to viewer
+
: billboard : always turned to viewer
  
:oriented : ignores viewwer, turned to velocity
+
: oriented : ignores viewwer, turned to velocity
  
:beam : facing viewer on 2 axises, stretched from origin to origin + velocity
+
: beam : facing viewer on 2 axises, stretched from origin to origin + velocity
  
:spark : facing viewer on 2 axises, stretched (based on velocity)
+
: spark : facing viewer on 2 axises, stretched (based on velocity)
  
'''color <min_color> <max_color>'''
+
''' color <min_color> <max_color>'''
  
 
&nbsp;&nbsp;&nbsp;Sets a color for particles. On each particle spawn, it's color is linearly randomized betwen two given colors. Color should be defined as HEX 0xRRGGBB, like 0xFFFFFF is white, and 0xFF0000 is red.
 
&nbsp;&nbsp;&nbsp;Sets a color for particles. On each particle spawn, it's color is linearly randomized betwen two given colors. Color should be defined as HEX 0xRRGGBB, like 0xFFFFFF is white, and 0xFF0000 is red.
  
'''tex <min_index> <max_index>'''
+
''' tex <min_index> <max_index>'''
  
 
&nbsp;&nbsp;&nbsp;Sets a index of particle from particlefont. Indexes are counted from left to right, from up to down, last index is 63, first is 0. Randomized linearly on each particle spawn.
 
&nbsp;&nbsp;&nbsp;Sets a index of particle from particlefont. Indexes are counted from left to right, from up to down, last index is 63, first is 0. Randomized linearly on each particle spawn.
  
'''size <min_size> <max_size>'''
+
''' size <min_size> <max_size>'''
  
 
&nbsp;&nbsp;&nbsp;Size of particle in game units, typical value is 4, randomized.
 
&nbsp;&nbsp;&nbsp;Size of particle in game units, typical value is 4, randomized.
  
'''sizeincrease <rate>'''
+
''' sizeincrease <rate>'''
  
 
&nbsp;&nbsp;&nbsp;This will make particle grow or diminish over time. <rate> is to how much utits to add or subtract per second. Note that while diminishing particle, engine will not check if particle will go to negative size, it will just invert it.
 
&nbsp;&nbsp;&nbsp;This will make particle grow or diminish over time. <rate> is to how much utits to add or subtract per second. Note that while diminishing particle, engine will not check if particle will go to negative size, it will just invert it.
  
'''alpha <min_alpha> <max_alpha> <fade_rate>'''
+
''' alpha <min_alpha> <max_alpha> <fade_rate>'''
  
 
&nbsp;&nbsp;&nbsp;Opacity of particles, 256 is opaque, 0 is transparent. Randomized. Could be more that 256 (to simulate fade delay). Fade rate is how huch alpha to throw away per second, once particle gets alpha 0 (full transparence), it gets removed.
 
&nbsp;&nbsp;&nbsp;Opacity of particles, 256 is opaque, 0 is transparent. Randomized. Could be more that 256 (to simulate fade delay). Fade rate is how huch alpha to throw away per second, once particle gets alpha 0 (full transparence), it gets removed.
  
'''time <min_time> <max_time>'''
+
''' time <min_time> <max_time>'''
  
 
&nbsp;&nbsp;&nbsp;Particle time-to-live in seconds, randomized.
 
&nbsp;&nbsp;&nbsp;Particle time-to-live in seconds, randomized.
  
'''gravity <value>'''
+
''' gravity <value>'''
  
 
&nbsp;&nbsp;&nbsp;Particle gravity modifier, 1 is full gravity, 0.5 is half etc., negative values are supported (particle go up).
 
&nbsp;&nbsp;&nbsp;Particle gravity modifier, 1 is full gravity, 0.5 is half etc., negative values are supported (particle go up).
  
'''bounce <value>'''
+
''' bounce <value>'''
  
 
&nbsp;&nbsp;&nbsp;Particle bounce-of-walls factor, 1 - bounce with full speed, 0.5 bounce with half speed. A value of -1 means particle will be removed on impact. Not that particle physics considered slow and spawning lots of bouncing particles is not recommended.
 
&nbsp;&nbsp;&nbsp;Particle bounce-of-walls factor, 1 - bounce with full speed, 0.5 bounce with half speed. A value of -1 means particle will be removed on impact. Not that particle physics considered slow and spawning lots of bouncing particles is not recommended.
  
'''airfriction <value>'''
+
''' airfriction <value>'''
  
 
&nbsp;&nbsp;&nbsp;Particle friction while moving in air, good option for smoke emitters. A value of 0 means no friction, negative values will do acceleration.  
 
&nbsp;&nbsp;&nbsp;Particle friction while moving in air, good option for smoke emitters. A value of 0 means no friction, negative values will do acceleration.  
  
'''liquidfriction <value>'''
+
''' liquidfriction <value>'''
  
 
&nbsp;&nbsp;&nbsp;Particle friction while moving in liquids.
 
&nbsp;&nbsp;&nbsp;Particle friction while moving in liquids.
  
'''originoffset <x> <y> <z>'''
+
''' originoffset <x> <y> <z>'''
  
 
&nbsp;&nbsp;&nbsp;Offset particle spawning origin by this values. Coordspace are world, x - forward, y - right, z - up.
 
&nbsp;&nbsp;&nbsp;Offset particle spawning origin by this values. Coordspace are world, x - forward, y - right, z - up.
  
'''velocityoffset <x> <y> <z>'''
+
''' velocityoffset <x> <y> <z>'''
  
 
&nbsp;&nbsp;&nbsp;Add this amount of constant velocity to particle on spawn.
 
&nbsp;&nbsp;&nbsp;Add this amount of constant velocity to particle on spawn.
  
'''originjitter <x> <y> <z>'''
+
''' originjitter <x> <y> <z>'''
  
 
&nbsp;&nbsp;&nbsp;Like originoffset but each axis is jittered between -value/+value. Hence it is defining spherical shape of particle random spawning.
 
&nbsp;&nbsp;&nbsp;Like originoffset but each axis is jittered between -value/+value. Hence it is defining spherical shape of particle random spawning.
  
'''velocityjitter <x> <y> <z>'''
+
''' velocityjitter <x> <y> <z>'''
  
 
&nbsp;&nbsp;&nbsp;Same as originjitter but for velocity.
 
&nbsp;&nbsp;&nbsp;Same as originjitter but for velocity.
  
'''velocitymultiplier <x>'''
+
''' velocitymultiplier <x>'''
  
 
&nbsp;&nbsp;&nbsp;Multiply particle starting velocity (one that set by QC or engine, whatever calls effect) by this value. Useful with trails. Negative values are supported.
 
&nbsp;&nbsp;&nbsp;Multiply particle starting velocity (one that set by QC or engine, whatever calls effect) by this value. Useful with trails. Negative values are supported.
  
'''underwater  '''
+
''' underwater  '''
  
 
&nbsp;&nbsp;&nbsp;Sets underwater flag for particles. Particles that are underwater will be removed in air. Useful for water bubbles.
 
&nbsp;&nbsp;&nbsp;Sets underwater flag for particles. Particles that are underwater will be removed in air. Useful for water bubbles.
  
'''notunderwater'''
+
''' notunderwater'''
  
 
&nbsp;&nbsp;&nbsp;Sets notunderwater flag for particles. Particles that are notunderwater will be removed in liquid. Useful for fire particles.
 
&nbsp;&nbsp;&nbsp;Sets notunderwater flag for particles. Particles that are notunderwater will be removed in liquid. Useful for fire particles.
  
'''trailspacing <x>'''
+
''' trailspacing <x>'''
  
 
&nbsp;&nbsp;&nbsp;This parm is only useful when effect is spawned as trail, defines a game units gap between effect invocations.
 
&nbsp;&nbsp;&nbsp;This parm is only useful when effect is spawned as trail, defines a game units gap between effect invocations.
  
'''stretchfactor <x>'''
+
''' stretchfactor <x>'''
  
 
&nbsp;&nbsp;&nbsp;A custom stretch factor that is used on sparks.  
 
&nbsp;&nbsp;&nbsp;A custom stretch factor that is used on sparks.  
  
'''rotate <startangle_min> <startangle_max> <spin_min> <spin_max>'''
+
''' rotate <startangle_min> <startangle_max> <spin_min> <spin_max>'''
  
 
&nbsp;&nbsp;&nbsp;Used to rotate particle, first 2 parms is start angle, other two are spin velocity.
 
&nbsp;&nbsp;&nbsp;Used to rotate particle, first 2 parms is start angle, other two are spin velocity.
  
==Particles leaving decals==
+
== Particles leaving decals ==
 
Particles can leave decals once hit something. For this behavior a special set of parms should be used. This section is unfinished, futher explanation is required.
 
Particles can leave decals once hit something. For this behavior a special set of parms should be used. This section is unfinished, futher explanation is required.
  
'''staincolor <min_color> <max_color>'''
+
''' staincolor <min_color> <max_color>'''
  
 
&nbsp;&nbsp;&nbsp;A randomized color for decal particle.
 
&nbsp;&nbsp;&nbsp;A randomized color for decal particle.
  
'''stainalpha <min_alpha> <max_alpha>'''
+
''' stainalpha <min_alpha> <max_alpha>'''
  
 
&nbsp;&nbsp;&nbsp;A randomized alpha.
 
&nbsp;&nbsp;&nbsp;A randomized alpha.
  
'''stainsize <min_size> <max_size>'''
+
''' stainsize <min_size> <max_size>'''
  
 
&nbsp;&nbsp;&nbsp;A randomized size.
 
&nbsp;&nbsp;&nbsp;A randomized size.
  
'''staintex <min_index> <max_index>'''
+
''' staintex <min_index> <max_index>'''
  
 
&nbsp;&nbsp;&nbsp;A randomized index into particlefont.
 
&nbsp;&nbsp;&nbsp;A randomized index into particlefont.
  
'''stainless'''
+
''' stainless'''
  
 
&nbsp;&nbsp;&nbsp;Disables decal spawning and returns all parms to it's default values.
 
&nbsp;&nbsp;&nbsp;Disables decal spawning and returns all parms to it's default values.
  
==Dynamic lights==
+
== Dynamic lights ==
 
Dynamic realtime lights could be placed in particle effects (useful for explosions) with this range of parms. This parms applied just like standart ones.
 
Dynamic realtime lights could be placed in particle effects (useful for explosions) with this range of parms. This parms applied just like standart ones.
  
Line 213: Line 224:
 
&nbsp;&nbsp;&nbsp;Sets a numbered cubefilter for light, cubemap texture is cubemaps/<value>
 
&nbsp;&nbsp;&nbsp;Sets a numbered cubefilter for light, cubemap texture is cubemaps/<value>
  
==Engine effect name ==
+
== Engine effect names ==
 
Heres a list of effect names used by engine.
 
Heres a list of effect names used by engine.
  
Line 251: Line 262:
 
: TR_GLOWTRAIL
 
: TR_GLOWTRAIL
 
: SVC_PARTICLE
 
: SVC_PARTICLE
 
==Console variables==
 
{{cvar|r_drawparticles|toggle drawing of all particles}}
 
{{cvar|r_drawparticles_drawdistance|set a maximal distance to draw particles at}}
 
{{cvar|cl_particles_size|this will scale a size of all particles}}
 
{{cvar|cl_particles_quality|multiplier of particles count spawned by emitters, better quality <nowiki>= more particles (1 - min, 4 - max. quality)</nowiki>}}
 
{{cvar|cl_particles_reloadeffects|reloads effectinfo.txt while in the game; that eliminates a need to quit and restart DP to see updated effects}}
 
  
 
[[Category:Darkplaces engine]]
 
[[Category:Darkplaces engine]]
{{finished}}
 

Please note that all contributions to Blood Wiki are considered to be released under the Creative Commons Attribution Share Alike (see BloodWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)

Templates used on this page:

This page is a member of 1 hidden category:

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox