Post by jonesQL on Nov 1, 2010 19:56:30 GMT 1
Right now I'm trying to figure out how to make a unique rail trail; I want to have a thin rail beam with a small amount of smoke or fire to surround the rail beam that will evaporate upwards before the rail beam disappears (my railtrail is set to 1500 to mimic the rail reload).
I still cant seem to fully understand the code behind the rail trail, but here is a basic paint picture of what im talking about; the grey dots is smoke or sparks that slowly evaporate upwards while the rail beam is up.
Here are a couple pictures to help ->
My paint skills aren't that great but I think it gets to the point:
Q2 rail trail (I'm looking at the inner part of the rail trail):
www.bluesnews.com/screenshots/q2/quake2-02.jpg
This is the default code I've seen with q3mme:
I still cant seem to fully understand the code behind the rail trail, but here is a basic paint picture of what im talking about; the grey dots is smoke or sparks that slowly evaporate upwards while the rail beam is up.
Here are a couple pictures to help ->
My paint skills aren't that great but I think it gets to the point:
Q2 rail trail (I'm looking at the inner part of the rail trail):
www.bluesnews.com/screenshots/q2/quake2-02.jpg
This is the default code I've seen with q3mme:
weapon/rail/trail {
//Color1 gets set before calling
//The beam
size r_railCoreWidth*0.5
shader railCore
emitter cg_railTrailTime * 0.001 {
colorFade 0
Beam
}
shader railDisc
//color2 is stored in the parent input structure, retrieve it like this
pushparent color2
pop color
if cg_oldrail {
//Do the rail rings
size r_railWidth*0.5
//Rings take their stepsize from the width variable
width r_railSegmentLength
emitter cg_railTrailTime * 0.001 {
colorFade 0.1
Rings
}
// } else {
//Do a spiral around the rail direction
//Get length in t0
t0 dir
normalize dir
//Create a perpendicular vector to the beam
perpendicular dir v0
//Radius around center
scale v0 v0 4
size 1.1
//Set the rotate around angle to start value
t1 rand*360
//Go through length of beam in repeat steps
repeat ( t0 / 5 ) {
rotatearound v0 dir v1 t1
//Slightly increase beyond regular 10 it so they don't all line up
t1 t1 + 20
addScale v1 dir origin loop * t0
add parentOrigin origin origin
emitter 0.8 {
//5 radius + 6
addScale origin v1 origin lerp * 0.8
colorFade 0.7
Sprite
}
}
}
}