]> git.xonotic.org Git - xonotic/xonotic.wiki.git/blob - Effectinfo-Scripting.md
Add troubleshooting section based on Exporting a weapon for Xonotic page
[xonotic/xonotic.wiki.git] / Effectinfo-Scripting.md
1 Reference: https://www.quakewiki.net/darkplaces-wiki/effectinfo-scripting-reference/
2
3 ### [**Effectinfo Scripting Reference**](https://www.quakewiki.net/darkplaces-wiki/effectinfo-scripting-reference/ "Effectinfo Scripting Reference")
4
5 <div>Posted on September 30th, 2012 | Last modified on August 15th, 2014</div>
6 <div>
7
8 EffectInfo is built-in scripting language to describe particle effects in DarkPlaces, it’s pretty simple and contains basic scripting functions.
9
10 Each effect can have several emitters which is defined in effectinfo.txt or maps/mapname_effectinfo.txt
11
12 <table>
13 <tr>
14 <td>
15
16 <div>
17
18 ## Contents
19
20 </div>
21 [1. General syntax](http://web.archive.org/web/20100729132930/http://dpwiki.slipgateconstruct.com/index.php?title=Effectinfo_Scripting_Reference#General_syntax)<br/>
22 [2. Console variables](http://web.archive.org/web/20100729132930/http://dpwiki.slipgateconstruct.com/index.php?title=Effectinfo_Scripting_Reference#Console_variables)<br/>
23 [3. Particle parameters](http://web.archive.org/web/20100729132930/http://dpwiki.slipgateconstruct.com/index.php?title=Effectinfo_Scripting_Reference#Particle_parameters)<br/>
24 [4. Particles leaving decals](http://web.archive.org/web/20100729132930/http://dpwiki.slipgateconstruct.com/index.php?title=Effectinfo_Scripting_Reference#Particles_leaving_decals)<br/>
25 [5. Dynamic lights](http://web.archive.org/web/20100729132930/http://dpwiki.slipgateconstruct.com/index.php?title=Effectinfo_Scripting_Reference#Dynamic_lights)<br/>
26 [6. Engine effect names](http://web.archive.org/web/20100729132930/http://dpwiki.slipgateconstruct.com/index.php?title=Effectinfo_Scripting_Reference#Engine_effect_names)<br/>
27 [7. Known bugs](http://web.archive.org/web/20100729132930/http://dpwiki.slipgateconstruct.com/index.php?title=Effectinfo_Scripting_Reference#Known_bugs)
28 </td>
29 </tr>
30 </table>
31
32 ## General syntax
33
34 ```
35 // emitter 1
36 effect EFFECT_NAME
37 parm value
38 parm2 value
39 ...
40
41 // emitter 2
42 effect EFFECT_NAME
43 parm value
44 parm2 value
45 ...
46
47 // emitter for another effect
48 effect ANOTHER_EFFECT
49 parm value
50 parm2 value
51 ...
52 ```
53
54 ## Console variables
55
56 `r_drawparticles` : toggle drawing of all particles
57
58 `r_drawparticles_drawdistance` : set a maximal distance to draw particles at
59
60 `cl_particles_size` : this will scale a size of all particles
61
62 `cl_particles_quality` : multiplier of particles count spawned by emitters, better quality = more particles (1 – min, 4 – max. quality)
63
64 `cl_particles_reloadeffects` : reloads effectinfo.txt while in the game; that eliminates a need to quit and restart DP to see updated effects
65
66 ## Particle parameters
67
68 **effect**
69
70 Defines a new emitter with effectname is belongs to, all parms after that will be applied to that emitter.
71
72 **count**
73
74 How many particles to spawn at this emitter, this setting is affected by cl_particles_quality cvar
75
76 **countabsolute**
77
78 Defines a count of particles spawned regardless of cl_particles_quality setting
79
80 Total particles count = countabsolute + count \* cl_particles_quality
81
82 **type**
83
84 Sets a generic particle type, affect appearance, blending, physics.
85
86 List of particle types:
87
88 <dl>
89 <dd>alphastatic : alpha-blended billboard</dd>
90 <dd>static : additive-blended billboard</dd>
91 <dd>spark : additive blended, stretched (based on velocity)</dd>
92 <dd>beam : a beam particle, drawn from origin to origin + velocity</dd>
93 <dd>rain : a rain particle, alpha-blended spart that will cause splash effect on impact</dd>
94 <dd>raindecal: oriented rain decal, additive-blended</dd>
95 <dd>snow: alpha blended, velocity jitters in realtime</dd>
96 <dd>bubble: alpha-blended</dd>
97 <dd>blood: inverse-modulated, leaves decal</dd>
98 <dd>smoke: alpha-blended billboard</dd>
99 <dd>decal: makes a decal on nearest surface</dd>
100 <dd>entityparticle: alpha-blended, this particle gets removed after being drawn (used on EF_BRIGHTFIELD)</dd>
101 </dl>
102
103 **blend**
104
105 Generic blend is set by type, but with this parm it cound be changed after type is defined.
106
107 List of blend types:
108
109 <dl>
110 <dd>alpha : alpha blended</dd>
111 <dd>add: additive blended</dd>
112 <dd>invmod: inverse modulation (used on blood and blood decals)</dd>
113 </dl>
114
115 **orientation**
116
117 Same as for blend, generic orientation is set by type, could be altered by this parm.
118
119 List of orientation types:
120
121 <dl>
122 <dd>billboard : always turned to viewer</dd>
123 </dl>
124
125 <dl>
126 <dd>oriented : ignores viewwer, turned to velocity</dd>
127 </dl>
128
129 <dl>
130 <dd>beam : facing viewer on 2 axises, stretched from origin to origin + velocity</dd>
131 </dl>
132
133 <dl>
134 <dd>spark : facing viewer on 2 axises, stretched (based on velocity)</dd>
135 </dl>
136
137 **color <min_color> <max_color>**
138
139 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.
140
141 **tex <min_index> <max_index>**
142
143 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.
144
145 **size <min_size> <max_size>**
146
147 Size of particle in game units, typical value is 4, randomized.
148
149 **sizeincrease**
150
151 This will make particle grow or diminish over time. 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.
152
153 **alpha <min_alpha> <max_alpha> <fade_rate>**
154
155 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.
156
157 **time <min_time> <max_time>**
158
159 Particle time-to-live in seconds, randomized.
160
161 **gravity**
162
163 Particle gravity modifier, 1 is full gravity, 0.5 is half etc., negative values are supported (particle go up).
164
165 **bounce**
166
167 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.
168
169 **airfriction**
170
171 Particle friction while moving in air, good option for smoke emitters. A value of 0 means no friction, negative values will do acceleration.
172
173 **liquidfriction**
174
175 Particle friction while moving in liquids.
176
177 **originoffset**
178
179 Offset particle spawning origin by this values. Coordspace are world, x – forward, y – right, z – up.
180
181 **velocityoffset**
182
183 Add this amount of constant velocity to particle on spawn.
184
185 **originjitter**
186
187 Like originoffset but each axis is jittered between -value/+value. Hence it is defining spherical shape of particle random spawning.
188
189 **velocityjitter**
190
191 Same as originjitter but for velocity.
192
193 **velocitymultiplier**
194
195 Multiply particle starting velocity (one that set by QC or engine, whatever calls effect) by this value. Useful with trails. Negative values are supported.
196
197 **underwater**
198
199 Sets underwater flag for particles. Particles that are underwater will be removed in air. Useful for water bubbles.
200
201 **notunderwater**
202
203 Sets notunderwater flag for particles. Particles that are notunderwater will be removed in liquid. Useful for fire particles.
204
205 **trailspacing**
206
207 This parm is only useful when effect is spawned as trail, defines a game units gap between effect invocations.
208
209 **stretchfactor**
210
211 A custom stretch factor that is used on sparks.
212
213 **rotate <startangle_min> <startangle_max> <spin_min> <spin_max>**
214
215 Used to rotate particle, first 2 parms is start angle, other two are spin velocity.
216
217 ## Particles leaving decals
218
219 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.
220
221 **staincolor <min_color> <max_color>**
222
223 A randomized color for decal particle.
224
225 **stainalpha <min_alpha> <max_alpha>**
226
227 A randomized alpha.
228
229 **stainsize <min_size> <max_size>**
230
231 A randomized size.
232
233 **staintex <min_index> <max_index>**
234
235 A randomized index into particlefont.
236
237 **stainless**
238
239 Disables decal spawning and returns all parms to it’s default values.
240
241 ## Dynamic lights
242
243 Dynamic realtime lights could be placed in particle effects (useful for explosions) with this range of parms. This parms applied just like standart ones.
244
245 **lightradius**
246
247 Radius of light in game units. Typical value is 200.
248
249 **lightradiusfade**
250
251 Radius fade rate, how many units to add/subtract per second. Once light reaches radius of 0 it gets removed.
252
253 **lighttime**
254
255 If radius fading not set, this parm can be used to define light life time.
256
257 **lightcolor**
258
259 A RGB-normalized light color, 1 1 1 is white, 0 0 1 is blue. Can exceed 1 (overbright light).
260
261 **lightshadow**
262
263 Cast shadows from light, value is 0 or 1.
264
265 **lightcubemapnum**
266
267 Sets a numbered cubefilter for light, cubemap texture is cubemaps/
268
269 ## Engine effect names
270
271 Heres a list of effect names used by engine.
272
273 ```
274 TE_GUNSHOT
275 TE_GUNSHOTQUAD
276 TE_SPIKE
277 TE_SPIKEQUAD
278 TE_SUPERSPIKE
279 TE_SUPERSPIKEQUAD
280 TE_WIZSPIKE
281 TE_KNIGHTSPIKE
282 TE_EXPLOSION
283 TE_EXPLOSIONQUAD
284 TE_TAREXPLOSION
285 TE_TELEPORT
286 TE_LAVASPLASH
287 TE_SMALLFLASH
288 TE_FLAMEJET
289 EF_FLAME
290 TE_BLOOD
291 TE_SPARK
292 TE_PLASMABURN
293 TE_TEI_G3
294 TE_TEI_SMOKE
295 TE_TEI_BIGEXPLOSION
296 TE_TEI_PLASMAHIT
297 EF_STARDUST
298 TR_ROCKET
299 TR_GRENADE
300 TR_BLOOD
301 TR_WIZSPIKE
302 TR_SLIGHTBLOOD
303 TR_KNIGHTSPIKE
304 TR_VORESPIKE
305 TR_NEHAHRASMOKE
306 TR_NEXUIZPLASMA
307 TR_GLOWTRAIL
308 SVC_PARTICLE
309 ```
310
311 ## Known bugs
312
313 ~~maps/mapname_effectinfo.txt does not add effects at the moment, but replaces the whole effects info~~\
314 The Engine now appends mapname_effectinfo.txt to effectinfo.txt. In other words you can create additional effects for your map without changing effectinfo.txt
315
316 </div>