laser

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

laser

Post by agentmad007 »

Hi ,

Someone know , how can i do a laser ?
i have no idea how to create the texture and the shader.

I would like to achieve a laser check, like you can see in some sci fi movie .

thx for any help ;)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

well actually to make one you'd most likely use line algorithms. like what the freeze-tag laser is, and what jv used for his botification method.

i'm not familiar with it so...

you could just make a pulsating texture and fit a shader to it but i'm not up-to-date on that either.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

yes thx liazrd i thought about a flashing texture , to make the lazer effect ......

and i even looked inside the freeze tag mod but none texture or shader
there is only .scr
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

func_beam

Post by tltrude »

There is a thing called "func_beam". It works great for lasars, but I have not been able to make it kill. Copy this code to Notepad and name the file "func_beam.cpp", then put it in a folder named "code" in main.

Code: Select all

/*QUAKED func_beam (0 0.25 .5) (-8 -8 -8) (8 8 8) START_ON PERSIST WAVE NOISE

This creates a beam effect from the origin to the target's origin. If no
target is specified, uses angles and projects beam out from there.

Values:
=======

"activate" Activate the beam
"alpha" Alpha of the beam (Default is 1.0)
"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 specifiying the red,green, and blue components. (Default is "1 1 1")
"damage" Amount of damage the beam inflicts if beam hits someone (Default is 0)
"deactivate" Deactivate the beam
"delay" ( Float delay ) Set the amount of delay on the beam updater (i.e. slows the effect of the beam down)
"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 ) Sets the life of the beam for use with the persist spawnflag.  This is how long a beam will be displayed.
"maxoffset" ( Float max_offset ) Set the maximum offset the beam can travel above, below, forward or back of it's endpoints (Default is 5)
"minoffset" ( Float min_offset ) Set the minimun offset the beam can travel above, below, forward or back of it's endpoints (Default is 0)
"model" Specifies the model to use as the beam
"numsegments" ( Integer numsegments ) Set the number of segments for the beam (Default is 4)
"numspherebeams" ( Integer num ) Set the number of beams that will be shot out in a sphere like formation
"overlap" ( Float beam_overlap ) Specifies the amount of overlap each beam link should have. Use this to fill in the cracks when using electric on beams. (Default is 0)
"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
"scale" Set the width of the beam
"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
"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

START_ON  - Starts the beam on
PERSIST   - Keeps the last few beams around and fades them out over the life of the beam
WAVE      - Make the beam follow a sin wave pattern
NOISE     - Use a more computationally expensive random effect, but the results are smoother

If the model field is not set, then a renderer generated beam will be created
using the color, minoffset, maxoffset, scale, and subdivisions fields

If the targetname is set, it will use the target specified as the endpoint of the beam
*****************************************************************************/
Tom Trude,

Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Thanks tom i should give a try ......

Doesnt matter if it dont kill , it just want to make a thing like a scanner ......
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

Holy...Hell. thats a big arse script
Image
User avatar
oddball
Corporal
Posts: 44
Joined: Tue May 27, 2003 3:49 pm
Contact:

Post by oddball »

you might take a look at the freeze tag scripts, they also use a laser to unfreeze people... :D
[VS-UK]Maj.OddBall[BnHQ]
Rindog
Corporal
Posts: 29
Joined: Wed Sep 24, 2003 6:34 pm

Post by Rindog »

I just figured out a way to make a beam appear to kill someone. I say "appear" because it's not actually the beam but another entity( a DamageModel). I have only tested this with SH. What I did was spawned a DamageModel and used fx/dummy.tik as the model. I then used the killtrace method for the DamageModel.

From the SH SDK:


killtrace( Vector offset, Vector direction, Float radius, Float distance )

kills all objects along the trace
offset - initial offset from origin
direction - angular offset orientation for trace
radius - thickness of trace
distance - how far to trace
Post Reply