This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 4rpl:commands:createmist [2021/02/08 15:49] – Regallion | 4rpl:commands:createmist [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ~~NOTOC~~ | ~~NOTOC~~ | ||
| - | < | + | < |
| + | <= [[4rpl: | ||
| ====== CreateMist ====== | ====== CreateMist ====== | ||
| - | CreateMist(< | + | CreateMist(< |
| ===== Description ===== | ===== Description ===== | ||
| - | Creates a mist at the specifid | + | Creates a mist at the specified |
| The possible values in initTable are:\\ | The possible values in initTable are:\\ | ||
| * " | * " | ||
| * " | * " | ||
| - | * "birthTime" : The amount of time, in frames, that the mist will not fade. The mist's total lifetime is birthTime+fadeTime. | + | * "birthtime" : The amount of time, in frames, that the mist will not fade. The mist's total lifetime is birthtime+fadetime. |
| - | * "fadeTime" : The amount of time, in frames, that the mist fades out. The mist's total lifetime is birthTime+fadeTime. | + | * "fadetime" : The amount of time, in frames, that the mist fades out. The mist's total lifetime is birthtime+fadetime. |
| * " | * " | ||
| * " | * " | ||
| * " | * " | ||
| + | |||
| + | Each value in the color and color2 vectors is a floating point number where 1 is full brightness and 0 is minimal brightness. Values over 1 make the mist glow. | ||
| + | |||
| + | :NOTE: There is a hidden hard cap for the amount of mist that can exist. When reached, no additional mist will be created.\\ | ||
| + | Avoid calling this API every frame to avoid reaching this cap. Every 5 frames is far more reasonable. | ||
| ===== Examples ===== | ===== Examples ===== | ||
| <code 4rpl> | <code 4rpl> | ||
| Line 27: | Line 33: | ||
| endif | endif | ||
| CreateMist(V3(10 1 10 ) < | CreateMist(V3(10 1 10 ) < | ||
| + | </ | ||
| + | |||
| + | <code 4rpl> | ||
| + | once | ||
| + | | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | do(50 0) | ||
| + | CreateMist(V3(10 1 10 ) < | ||
| + | loop | ||
| + | endonce | ||
| + | |||
| + | #This creates a ring-shaped burst of mist particles near the bottom-left corner of the map | ||
| + | #Since " | ||
| + | #By swapping the " | ||
| + | </ | ||
| + | |||
| + | <code 4rpl> | ||
| + | if(GetUnitUpdateCount 5 % eq0) #Ensure we don't make uneccessary mist. | ||
| + | CreateMist(GetUnitPosition(self) < | ||
| + | endif | ||
| + | |||
| + | :Once | ||
| + | Table(" | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | </ | ||
| + | |||
| + | ==== Copy and paste preset: ==== | ||
| + | <code 4rpl> | ||
| + | Table(" | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| </ | </ | ||
| < | < | ||