<=[[4rpl:start|Index]] \\ <=[[cw4:Tutorials]] ===== Getting Started With Beams in CW4 ===== Working with beams may seem a bit overwhelming at first due to the number of properties to assign, but it's actually rather simple once you've whittled it down to the basics. Here are the minimum steps required to get a beam operational with 4RPL: * Create beam with [[4rpl:commands:CreateBeam]] (Takes 3 arguments. string for color, float for brightness/intensity, float for thickness.) ID of newly created beam will be left on stack, export to a variable for later re-use. * (OPTIONAL) Attach beam to unit with [[4rpl:commands:AttachBeam]] (Takes 3 arguments. Int for beam ID, int for ID of unit to attach to, string for name of sub-object within unit to attach to.) * Designate offset of beam's start point with [[4rpl:commands:SetBeamStart]] (Takes 2 arguments. Int for beam ID, V3 for position.) If you did not use [[4rpl:commands:AttachBeam]], the position supplied is treated as an absolute world position. If you did use [[4rpl:commands:AttachBeam]], the position supplied is used as an offset relative to the position of the sub-object to which you've attached it. * Designate beam's end point with [[4rpl:commands:SetBeamEnd]] (Takes 2 arguments. Int for beam ID, V3 for position of beam's end.) Beam's end seems to be treated as absolute world position, unless you use [[4rpl:commands:SetBeamForceLocalEnd]] (Take 2 arguments. Int for beam ID, bool for state.) * (OPTIONAL) If you wish to make the beam invisible or restore its visibility, use [[4rpl:commands:SetBeamVisible]] (Takes 2 arguments. Int for beam id, bool for state.) * (OPTIONAL) If you wish to destroy the creeper along the path of the beam as the sweeper does, you will want to use [[4rpl:commands:ClipCreeperLine]] (Takes 5 arguments. V3 for start position, V3 for end position, int for width, bool for affects creeper, bool for affects anti-creeper.) The amount of creeper allowed to pass through the line is determined by the vertical height of the beam (in other words, the y components supplied for the start and end vectors.) If you set both y components to 0, it should clip all creeper passing over the line. Additional beam related commands: [[4rpl:commands:IsBeam]], [[4rpl:commands:SetBeamBrightness]], [[4rpl:commands:SetBeamColor]], [[4rpl:commands:SetBeamWidth]], [[4rpl:commands:UnattachBeam]], [[4rpl:commands:DestroyBeam]], [[4rpl:commands:DestroyAllBeams]], [[4rpl:commands:DestroyAllAttachedBeams]]