User Tools

Site Tools


4rpl:commands:createbeam

Differences

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

Link to this comparison view

Next revision
Previous revision
4rpl:commands:createbeam [2021/01/08 11:01] – external edit 127.0.0.14rpl:commands:createbeam [2024/01/09 01:16] (current) – [Description] Elaborated beam visibility. Vertu
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
-<=[[4rpl:start| Index]]+<=[[4rpl:start| Index]] \\ 
 +<=[[4rpl:start#beams| Beams]] 
  
 ====== CreateBeam ====== ====== CreateBeam ======
Line 17: Line 19:
   * 'width' is a float ranging from 0 up. The width is the thickness of the beam. Beams are flat geometry so keep the beam width relatively small (1-10 typically).   * 'width' is a float ranging from 0 up. The width is the thickness of the beam. Beams are flat geometry so keep the beam width relatively small (1-10 typically).
  
 +**<fs medium>__Important note:__</fs>** If you are planning to create a continuous beam on a unit that will be moving while firing or the end of the beam is meant to track something that moves, do not attach the beam to the unit. An attached beam will be unable to maintain the correct visual orientation and length in such situations. An unattached beam so long as its' start and end location is updated will retain a correct and accurate visual orientation and will give much better results.\\
 +Attached beams are best for simple units such as a unit that fires a beam at Creeper. The targeted Creeper location does not move and if the unit does not move while the beam is visible than it is safe to attach the beam to the unit and no unwanted visual errors will occur.
 +
 +:NOTE: Beams become invisible at long distances when they are a size lower than 0.5 so if you want the beam to always be visible, keep the width at a minimum of 0.5. The smaller the beam, the closer the camera must be for it to be visible.\\
 +This can also be useful when using a large number of beams such as targeting lasers to ensure the player's screen is not flooded with beams when zoomed out. If you want a beam to be moderately visible, 0.35 is a great width.
 ===== Examples ===== ===== Examples =====
 <code 4rpl> <code 4rpl>
Line 22: Line 29:
    GetUnitPosition(self) ->unitPos    GetUnitPosition(self) ->unitPos
    #Fire a beam to extends off screen but is at the same height as the unit    #Fire a beam to extends off screen but is at the same height as the unit
-   #We will attach the beam to ourselfs, so that the start point is relative to our unit+   #We will attach the beam to ourselves, so that the start point is relative to our unit
    3 ->brightness    3 ->brightness
    4 ->width    4 ->width
Line 28: Line 35:
    AttachBeam(<-beam self "")    AttachBeam(<-beam self "")
    SetBeamStart(<-beam V3(0 0 0))    SetBeamStart(<-beam V3(0 0 0))
-   SetBeamEnd(<-beam V3(10 20))+   SetBeamEnd(<-beam V3(10000 10000))
 endonce endonce
 </code> </code>
 <=[[4rpl:start| Index]] <=[[4rpl:start| Index]]
  
4rpl/commands/createbeam.1610121708.txt.gz · Last modified: 2021/01/08 11:01 by 127.0.0.1