User Tools

Site Tools


4rpl:commands:createmist

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
4rpl:commands:createmist [2024/02/03 18:00] – Copy and paste table setup provided. Vertu4rpl:commands:createmist [2024/02/03 18:05] (current) – Fixed strange note wording and provided advanced example plus copy and paste preset. Vertu
Line 19: Line 19:
 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. 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. You won'be hitting that anytime soon normallyEither long-duration or something of spontaneous creation of multiple mists every frame is possible to hit it+: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 50: Line 51:
 #Since "direction" represents a vertical axis (in this case "up"), the ring will expand horizontally around said axis #Since "direction" represents a vertical axis (in this case "up"), the ring will expand horizontally around said axis
 #By swapping the "startradius" and "endradius" values, the ring will instead collapse inward #By swapping the "startradius" and "endradius" values, the ring will instead collapse inward
 +</code>
 +
 +<code 4rpl>
 +if(GetUnitUpdateCount 5 % eq0) #Ensure we don't make uneccessary mist.
 + CreateMist(GetUnitPosition(self) <-initData)
 +endif
 +
 +:Once
 + Table("color" V3(1 0.8 0.8)
 +    "color2" V3(0.2 0 0)
 +    "birthtime" 40
 +    "fadetime" 20
 +    "direction" V3(1 5 1.5)
 +    "startradius" 0.5
 +    "endradius" 1) ->initData
 </code> </code>
  
 ==== Copy and paste preset: ==== ==== Copy and paste preset: ====
 <code 4rpl> <code 4rpl>
-Table( +Table("color" V3(1 0.8 0.8)
- "color" V3(1 0.8 0.8)+
     "color2" V3(0.2 0 0)     "color2" V3(0.2 0 0)
     "birthtime" 40     "birthtime" 40
4rpl/commands/createmist.txt · Last modified: 2024/02/03 18:05 by Vertu