You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -17,8 +17,8 @@ allowing for further creative customization of various audio/visual aspects of t
17
17
18
18
## Current support and usage
19
19
20
-
FX system is currently only used to script effects for weaponsand projectiles.
21
-
It will soon be extended to further remove hardcoded effects, as well as allow for model embedding and creation of map FX.
20
+
FX system is currently only used to script effects for weapons, projectiles and entities.
21
+
It may be expanded for creation of map FX in the future.
22
22
23
23
# The innerworkings
24
24
@@ -103,12 +103,22 @@ Effects can be scheduled in various ways. To change how timing functions on an e
103
103
Setting interval to a value of `1` implies a standard, non-periodic emission. Default: `1`.
104
104
*`emittimeliness` - when enabled, makes sure a periodic emission will be able to finish its full cycle (`emitlen`) before trying to perform it.
105
105
Generally, should only be used in cases when an emitter life is known. In other cases, emitters' life may be prolonged/refreshed (e.g. for projectiles), negating the need to have `activelen` predetermined, unless desired otherwise. Default: `0`.
106
-
*`emitdelay`- postpones the emission by a given time in milliseconds. Default: `0`.
106
+
*`emitdelay`- postpones the emission by a given time in milliseconds. Default: `0`.
107
107
*`emitparent` - when enabled, automatically schedules emission to synchronize with a parent effect. Useful when a parent effect emits periodically (uses `emitinterval`).
108
108
Default: `0`.
109
109
*`emitsingle` - when enabled, prevents an effect from being prolonged/refreshed. Default: `0`.
110
110
*`emitrestart` - when enabled, resets time-driven parameters (such as interpolation or fade-in) on effect prolong/refresh. Default: `0`.
111
111
*`emitmove` - as opposed to rest being `integer` type, this one is `float`, when set above `0`, only allows emission when emitter moves at a given speed. Default: `0`.
112
+
*`emitparam` - only allows emission when internal emitter parameter (see *"Internal parameters"*) of a given index (`integer`) becomes larger than 0. Default: `-1`.
113
+
114
+
## Iteration
115
+
116
+
Effect emissions can also be repeated by iterating an effect. It allows you to create repeated patterns using a single effect instance.
117
+
118
+
*`iter` - how many times an effect should be emitted. Default: `1`.
119
+
*`iteroffset` - position vector offset between each emission. Default: `0, 0, 0`.
120
+
121
+
You can also modulate various properties by interpolating the values by the iteration. (*see "Property modifiers"*)
112
122
113
123
114
124
### Example 1: single-shot emission for 1 second
@@ -150,6 +160,61 @@ Various properties can also have modifiers applied such as interpolation or rand
150
160
**NOTE: In the supplied example a minimum interval of `2` is used, to ensure the emission is treated as periodic. Remember, value of `1` implies standard emission!**
151
161
Emission will occur randomly from 2 to 1000 milliseconds (the random value is added to the base value).
152
162
163
+
## Positioning
164
+
165
+
By default effects will be emitted from the origin position the attached entity and in its direction.
166
+
However, this can be overridden with the following properties:
167
+
168
+
The starting position of an effect is referred to as *position*, *pos* in short or *from*.
169
+
The end position of an effect is referred to as *end* or *to*.
170
+
171
+
*`reloffset` - enforces all position calculations to be done with regards to the entity's direction. Default: `1`.
172
+
*`posoffset` - offsets the starting position by a given vector. Default: `0, 0, 0`.
173
+
*`endoffset` - offsets the end position by a given vector. Default: `0, 0, 0`.
174
+
*`endfrompos` - sets the end position to be the same as the starting position, offset by a given vector. Disabled when vector is `0, 0, 0`. Default: `0, 0, 0`.
175
+
*`posfromend` - sets the starting position to be the same as the end position, offset by a given vector. Disabled when vector is `0, 0, 0`. Default: `0, 0, 0`.
176
+
*`posflip` - swaps the starting and end positions. Default: `0`.
177
+
*`endfromprev` - sets the end position as the starting position from the previous frame. Default: `0`.
178
+
*`posfromenttag` - sets the starting position to the position of an entity tag (see *"Entity positions"*). Default: `-1`.
179
+
*`endfromenttag` - sets the end position to the position of an entity tag (see *"Entity positions"*). Default: `-1`.
180
+
*`posfroment` - sets the starting position to one of the positions of an entity (see *"Entity positions"*). Default: `-1`.
181
+
*`endfroment` - sets the end position to one of the positions of an entity (see *"Entity positions"*). Default: `-1`.
182
+
183
+
### Entity positions
184
+
185
+
Player entities have a number of predefined positions, which can be used to position effects.
186
+
In addition, they also have a number of tags, which are attached to the entity's model bones, and follow the entity's animation.
187
+
188
+
### Entity position points
189
+
190
+
| Type | Value | CubeScript handle | Description |
| Origin | 0 | $FX_ENT_POS_ORIGIN | Origin position of the entity. |
193
+
| Bottom | 1 | $FX_ENT_POS_BOTTOM | Bottom position of the entity. |
194
+
| Middle | 2 | $FX_ENT_POS_MIDDLE | Middle (by height) position of the entity. |
195
+
| Top | 3 | $FX_ENT_POS_TOP | Top position of the entity. |
196
+
| Dir | 4 | $FX_ENT_POS_DIR | Origin offset by the entity's direction. |
197
+
| Muzzle | 5 | $FX_ENT_POS_MUZZLE | Gun muzzle position of the entity. |
198
+
199
+
### Entity position tags
200
+
201
+
| Type | Value | CubeScript handle |
202
+
|-----------|-------|-----------------------|
203
+
| Camera | 0 | $FX_ENT_TAG_CAMERA |
204
+
| Crown | 1 | $FX_ENT_TAG_CROWN |
205
+
| Torso | 3 | $FX_ENT_TAG_TORSO |
206
+
| Limbs | 5 | $FX_ENT_TAG_LIMBS |
207
+
| Waist | 7 | $FX_ENT_TAG_WAIST |
208
+
| Muzzle | 8 | $FX_ENT_TAG_MUZZLE |
209
+
| Origin | 9 | $FX_ENT_TAG_ORIGIN |
210
+
| Eject 1 | 10 | $FX_ENT_TAG_EJECT1 |
211
+
| Eject 2 | 11 | $FX_ENT_TAG_EJECT2 |
212
+
| Jet left | 12 | $FX_ENT_TAG_JET_LEFT |
213
+
| Jet right | 13 | $FX_ENT_TAG_JET_RIGHT |
214
+
| Jet back | 14 | $FX_ENT_TAG_JET_BACK |
215
+
| Toe left | 15 | $FX_ENT_TAG_TOE_LEFT |
216
+
| Toe right | 16 | $FX_ENT_TAG_TOE_RIGHT |
217
+
153
218
## Property modifiers
154
219
155
220
As previously mentioned, various properties can have modifiers applied. The availability of modifiers depends on the property.
@@ -172,11 +237,40 @@ Currently, there are two different modifiers available, the list may be expanded
172
237
Interpolation (lerp) modifier has the following properties (all are `integer` type):
173
238
174
239
*`lerptime` - time in milliseconds it takes for the base value to reach the target value. Used only when `lerpmode` is not set to parameter mode. Default: `1000`.
175
-
*`lerpmode` - determines interpolation mode, see table below the list for details. Default: `$FX_MOD_LERP_ACTIVE` (`0`).
176
-
*`lerpparam` - changes which parameter is used as the interpolator when `lerpmode` in parameter mode. Default: `0`.
177
-
*`lerpsquare` - when enabled, changes interpolation model to squared. Default: `0`.
*`lerpparam` - changes which internal parameter (see *"Internal parameters"*) is used as the interpolator when `lerpmode` in internal parameter mode. Default: `0`.
Certain modifiers (such as interpolation) can use parameters, which are supplied from outside to modulate the behavior of an effect.
182
276
The availability of parameters depends entirely on the context where an effect is used, therefore, parameters may share IDs if their usage context differs.
@@ -186,6 +280,7 @@ The availability of parameters depends entirely on the context where an effect i
186
280
| Weapon power | Weapon FX | 0 | $W_FX_POWER_PARAM | Cooked weapon power, `0-1`. |
187
281
| Projectile lifetime | Projectile life FX | 0 | $P_FX_LIFETIME_PARAM | Lifetime of a projectile, `0-1`, `1` being end of life. |
188
282
| Projectile bounce velocity | Projectile bounce FX | 0 | $P_FX_BOUNCE_VEL_PARAM | Bounce velocity of a projectile, `0-1`. |
283
+
| Impulse boost | Player impulse FX | 0 | <n/a> | Set to `1` on player impulse boost, is otherwise `0`. |
189
284
190
285
## Chaining effects
191
286
@@ -219,26 +314,31 @@ As mentioned, besides parenting one could define an end-of-life emission, which
219
314
220
315
These properties are available regardless of the effect type.
221
316
222
-
| Property name | Type | Min | Default | Max | Modifiers | Description |
0 commit comments