User Tools

Site Tools


4rpl:commands:setbeamend

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
4rpl:commands:setbeamend [2021/04/15 09:06] Karsten754rpl:commands:setbeamend [2022/05/25 18:23] (current) – [Description] Continuous beams in motion. Vertu
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
-<=[[4rpl:start| Index]] \\ +<=[[4rpl:start| Index]]  \\ 
-<-[[4rpl:start#beams| Beams]]+<=[[4rpl:start#beams| Beams]] 
  
  
Line 12: Line 13:
 For a beam that is attached to a unit, the end position REMAINS IN WORLD COORDINATES unless the beam has been set to SetBeamForceLocalEnd. For a beam that is attached to a unit, the end position REMAINS IN WORLD COORDINATES unless the beam has been set to SetBeamForceLocalEnd.
  
 +**Important note:** If you are planning to create a continuous beam on a unit that will be moving while firing, do not attach the beam to the unit. An attached beam will be unable to maintain the correct visual orientation and length. An unattached beam so long as its' start location is updated will retain a correct visual orientation.
 ===== Examples ===== ===== Examples =====
 <code 4rpl> <code 4rpl>
Line 17: Line 19:
    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 
-   CreateBeam("orange" 3 1  V3(0 1 0)  V3(10000 <-unitPos.Y 10000)) ->beam +   3 ->brightness 
-   AttachBeam(<-beam self)+   4 ->width 
 +   CreateBeam("orange" <-brightness <-width) ->beam 
 +   AttachBeam(<-beam self ""
 +   SetBeamStart(<-beam V3(0 0 0)) 
 +   SetBeamEnd(<-beam V3(10000 0 10000))
 endonce endonce
  
 SetBeamEnd(<-beam V3(100 <-unitPos.Y 100)) #Move the end of the beam to point at 100,unitY,100 on the map. SetBeamEnd(<-beam V3(100 <-unitPos.Y 100)) #Move the end of the beam to point at 100,unitY,100 on the map.
-endif 
- 
  
 </code> </code>
 <=[[4rpl:start| Index]] <=[[4rpl:start| Index]]
  
4rpl/commands/setbeamend.1618491999.txt.gz · Last modified: 2021/04/15 09:06 by Karsten75