User Tools

Site Tools


4rpl:commands:setbeamstart

Index
Beams

SetBeamStart

SetBeamStart(<-beamUID <-start)

Description

Set a beam's vector starting position in 3D space. For an unattached beam, the starting coordinates are in world space. This means that 0,0,0 is in the lower left of the map. The startY coordinate is the height above the terrain and startX is along the right/left direction of the map and startZ is the forward/back direction. For a beam that is attached to a unit, the start position is relative to the unit. This means that 0,0,0 is at the origin of the unit it is attached to (and will remain there as the unit moves).

Examples

<code 4rpl>
once
   GetUnitPosition(self) ->unitPos
   #Fire a beam to extends off screen but is at the same height as the unit
   #We will attach the beam to ourselves, so that the start point is relative to our unit
   3 ->brightness
   4 ->width
   CreateBeam("orange" <-brightness <-width) ->beam
   AttachBeam(<-beam self "")
   SetBeamStart(<-beam V3(0 0 0))
   SetBeamEnd(<-beam V3(10000 0 10000))
endonce
 
SetBeamStart(<-beam V3(0 5 0)) #Move the start of the beam up higher on the unit

Index

4rpl/commands/setbeamstart.txt · Last modified: 2021/04/15 12:29 by Karsten75