Garry's Mod

Garry's Mod

74 ratings
[E2] Beam Core
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun, Scenic
File Size
Posted
Updated
17.047 KB
14 Feb, 2015 @ 3:24pm
19 Apr, 2020 @ 6:34pm
13 Change Notes ( view )

Subscribe to download
[E2] Beam Core

Description
THIS IS AN EXTENSION FOR WIREMOD, NOT CONSOLE COMMANDS
Temporary Description:
Allows you to draw beams "lasers" with an e2
these can either be relative to the world or to an arbitrary position and rotation set by you.

Usage logic:
You define points for the beam to pass through, lines will go from point to point in sequencial order.
Leaving an empty index will result in an empty space between two lines.
An example of this would be:
-Define points 1,2,3,5,6,7
->4 Lines are drawn, 1-2, 2-3, 5-6, 6-7
You change the 'settings' of the beam (such as material and color) anytime.

Note that excessive use of these functions will result in a high NET IN. Be smart about it, parent the points.

If you want a beam (set of lines) to follow a particular entity, you define the points locally (small vectors usually, no entity():pos()! ).
Now to make the points move with the entity, you use the 'beamSetOrigin*' functions. (You set its position and use the parent function)

Function list:
beamPoint(id, vector position) --Define a new point
beamPoint(id, entity parent [, vector localpos]) --'Parents' a point to an entity.
beamMaterial(material) --Change the material of the beam
beamClear() --Clears the points (remove them)
beamSize(size) --Change the width of the beam
beamAlpha(alpha) --Change the alpha of the beam
beamColor(vector color) --Change the color of the beam
beamVisible(player, can_see) --Sets whether or not <player> can see the beam
beamGlobal(global) --Define whether points positions are local to an arbitrary origin or not (see below)
beamSetOriginPos(vector pos) --Change the position of the origin
beamSetOriginAng(angle ang) --Change the angles of the origin
beamSetOriginParent(entity parent) --Parent the origin to an entity
beamGetOriginEntity() --Get the entity representing the origin. Destroying this will remove the beam.

Note that all functions accept an extra 'beam index' at the start which can be used in a similar way to holograms indexes to manipulate multiple beams.

Commands:
BeamCore_CanUse [1-2] 2=Admin Only 1=Everyone (default:1)
BeamCore_MaxBeamsPerE2 [seconds] --Max beams per e2 (obvious)

Credits
JackCarterSmith -- Fixing this old addon for those that still use it :)
20 Comments
Sanders 14 Oct, 2022 @ 11:04pm 
ok well seeing as you doint respond and your code with beamPoint(1,entity()) breaks causing the e2 to go nope and die i have to ask do you plan an upodate?
Sanders 28 Sep, 2022 @ 1:55pm 
ok so i wanna use this to target more then one prop is ther an example i could perhaps use?
Vurv 6 Sep, 2022 @ 12:26am 
This is a notice that some functionality this extension will likely be broken by wiremod/wire#2399 if you don't convert your ``e2function``s to return proper ``Vector`` and ``Angle`` userdata rather than tables of three numbers.

This is a copy pasted message, I cba to download the addon and check myself if it does contain use of these. Feel free to delete if this is non-applicable.
Sanders 30 Jun, 2022 @ 12:13pm 
ok well i guess the person that built this refuses to respond
Sanders 25 May, 2022 @ 9:37pm 
ok there a way to "clip" the beams as im using them on rangers
[Sk$Bh]Trick or treat KID! 15 Dec, 2020 @ 6:57am 
Useful !
NutellaBrain 1 Jun, 2018 @ 12:37pm 
how do i use it
Zeluseffio 15 Mar, 2017 @ 11:55pm 
Please can you make an example video or code, as i cant figure out whats what, i do know how to use holos but not these.
Meru 4 Feb, 2017 @ 8:01am 
Fix! beamColor dosen't work and stays white.
Sanders 23 Jan, 2017 @ 12:07pm 
please fix this! the beam will not accept a diffrent color or material!