Scripting: q: func_beam
Moderator: Moderators
Scripting: q: func_beam
Might be a noobish question for u guys, but this forum is for questions, right? What is func_beam for, what can i do with it? Thanks 
- HyperKiller
- Corporal
- Posts: 38
- Joined: Wed May 19, 2004 8:00 pm
- Location: Slovenia
- Contact:
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Here is the code to spawn a red beam from the center of the map and 500 units straight up, and remove it after 2 seconds:
( thanx jv )
Code: Select all
local.start = ( 0 0 0 )
local.start = ( 0 0 500 )
local.beam = spawn func_beam origin local.start endpoint local.end maxoffset 0
local.beam doActivate
local.beam color (1 0 0)
local.beam commanddelay 2 remove-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Um, it's also available in Spearhead. There is a very large section in the MOH_GameClasses.html on it.
FuncBeam (func_beam) -> ScriptSlave -> Mover -> Trigger -> Animate -> Entity -> SimpleEntity -> Listener -> Class
activate
Activate the beam
angle( Float newAngle )
set the angles of the entity using just one value.
Sets the yaw of the entity or an up and down
direction if newAngle is [0-359] or -1 or -2
angles( Vector newAngles<0.00...360.00><0.00...360.00><0.00...360.00> )
set the angles of the entity to newAngles.
color( Vector beam_color<0.00...1.00><0.00...1.00><0.00...1.00> )
Set the color of the beam
deactivate
Deactivate the beam
delay( Float delay )
Set the amount of delay on the beam updater
doActivate( Entity activatingEntity )
General trigger event for all entities
endalpha( Float alpha )
Set the endpoint alpha value of the beam
endpoint( Vector beam_end_point )
Set the end point of the beam. The beam will be draw from the origin to
the end point.
findendpoint
Find the endpoint of a beam
life( Float beam_life )
Set the amount of time the beam stays on when activated
maxoffset( Float max_offset )
Set the maximum offset the beam can travel above, below, forward or back of it's endpoints
minoffset( Float min_offset )
Set the minimun offset the beam can travel above, below, forward or back of it's endpoints
model( String modelName )
set the model to modelName.
numsegments( Integer numsegments )
Set the number of segments for the beam
numspherebeams( Integer num )
Set the number of beams that will be shot out in a sphere like formation
overlap( Float beam_overlap )
Set the amount of overlap the beams have when they are being strung together
persist( Boolean bool )
Set the persist property of the beam
radius( Float radius )
Set the starting radius of the beams if this is a beamsphere
shader( String beam_shader )
Set the shader that the beam will use
shoot
Make the beam cause damage to entities that get in the way <<-- this is interesting!!
shootradius( Float radius )
Set the radius of the damage area between beam endpoints
target( String beam_target )
Set the target of the beam. The beam will be drawn from the origin
to the origin of the target entity
tileshader( String beam_shader )
Set the shader that the beam will use. This shader will be tiled.
toggledelay( [ String [random] ], [ Float time ] )
Causes a beam toggling effect. Sets the time between toggling. If random is specified, The time will be between 0 and time
updateendpoint
Update the endpoint of a beam
updateorigin
Update the origin of a beam
FuncBeam (func_beam) -> ScriptSlave -> Mover -> Trigger -> Animate -> Entity -> SimpleEntity -> Listener -> Class
activate
Activate the beam
angle( Float newAngle )
set the angles of the entity using just one value.
Sets the yaw of the entity or an up and down
direction if newAngle is [0-359] or -1 or -2
angles( Vector newAngles<0.00...360.00><0.00...360.00><0.00...360.00> )
set the angles of the entity to newAngles.
color( Vector beam_color<0.00...1.00><0.00...1.00><0.00...1.00> )
Set the color of the beam
deactivate
Deactivate the beam
delay( Float delay )
Set the amount of delay on the beam updater
doActivate( Entity activatingEntity )
General trigger event for all entities
endalpha( Float alpha )
Set the endpoint alpha value of the beam
endpoint( Vector beam_end_point )
Set the end point of the beam. The beam will be draw from the origin to
the end point.
findendpoint
Find the endpoint of a beam
life( Float beam_life )
Set the amount of time the beam stays on when activated
maxoffset( Float max_offset )
Set the maximum offset the beam can travel above, below, forward or back of it's endpoints
minoffset( Float min_offset )
Set the minimun offset the beam can travel above, below, forward or back of it's endpoints
model( String modelName )
set the model to modelName.
numsegments( Integer numsegments )
Set the number of segments for the beam
numspherebeams( Integer num )
Set the number of beams that will be shot out in a sphere like formation
overlap( Float beam_overlap )
Set the amount of overlap the beams have when they are being strung together
persist( Boolean bool )
Set the persist property of the beam
radius( Float radius )
Set the starting radius of the beams if this is a beamsphere
shader( String beam_shader )
Set the shader that the beam will use
shoot
Make the beam cause damage to entities that get in the way <<-- this is interesting!!
shootradius( Float radius )
Set the radius of the damage area between beam endpoints
target( String beam_target )
Set the target of the beam. The beam will be drawn from the origin
to the origin of the target entity
tileshader( String beam_shader )
Set the shader that the beam will use. This shader will be tiled.
toggledelay( [ String [random] ], [ Float time ] )
Causes a beam toggling effect. Sets the time between toggling. If random is specified, The time will be between 0 and time
updateendpoint
Update the endpoint of a beam
updateorigin
Update the origin of a beam


