This is an old revision of the document!
⇐ Index
CreateBeam(<-color <-brightness <-width) ->beamUID
Creates a beam. Beams are laser like lines between two points in 3D space. A beam will persist once created. Call DestroyBeam to remove a beam. Don't call CreatBeam repeatedly unless you plan to make more than one beam. Each call creates a new beam that will persist until destroyed. If you are creating a beam for a unit, call CreateBeam in a once clause (or some other initialization function) then reference that beam in the unit. You can toggle the beam's visibility rather than creating, destroying, and recreating the beam. Toggling the visibility is more efficient that creating and destroying a beam. If you attach a beam to a unit, the beam will be destroyed if the unit is destroyed. CreateBeam pushes to the stack a unique ID for the created beam. Use this ID in other beam related calls to reference the beam. A value of -1 is pushed to the stack if the beam creation fails. A MAXIMUM OF 4096 BEAMS IS ALLOWED.
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 ourselfs, 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(10 0 20)) endonce
⇐ Index