Hi.
I want to add the 3D model lightning bolt effect to the Q1 Lightning gun, but i dont know how would i make it move (since it has no anims) or make its reach beign dynamic.
It is 3 model (bolt.mdl;bolt2.mdl;bolt3.mdl) files that works like a trail, but moves randomly and has a dynamic reach (like a trail, but with a model).
Heres what im trying to do:
[IMG]http://www.arrakis-ttm.com/quake/lightng.gif[/IMG]
And this is some C code i have found on Quake's Sourcecode (maybe porting it to LUA may solve my issue):
[CODE] // Lightning bolt effect
TraceResult trace;
Vector vecOrg = pev->origin + Vector(0,0,16);
UTIL_MakeVectors( pev->v_angle + pev->punchangle );
// adjust lightning origin
Vector tmpSrc = EyePosition() + gpGlobals->v_forward * 20 + gpGlobals->v_up * -8;
UTIL_TraceLine( vecOrg, vecOrg + (gpGlobals->v_forward * 600), ignore_monsters, ENT(pev), &trace );
if (trace.fAllSolid == FALSE)
{
MESSAGE_BEGIN( MSG_BROADCAST, gmsgTempEntity );
WRITE_BYTE( TE_LIGHTNING2 );
WRITE_ENTITY( entindex() );
WRITE_COORD( tmpSrc.x );
WRITE_COORD( tmpSrc.y );
WRITE_COORD( tmpSrc.z );
WRITE_COORD( trace.vecEndPos.x );
WRITE_COORD( trace.vecEndPos.y );
WRITE_COORD( trace.vecEndPos.z );
MESSAGE_END();
}
Vector vecDir = gpGlobals->v_forward + ( 0.001 * gpGlobals->v_right ) + ( 0.001 * gpGlobals->v_up );[/CODE]
Any help is appreciated.
That C code is nothing to do with the effect, all it does is send the start and end coordinates of the beam to client, and the effect index.
[editline]15th March 2014[/editline]
You should post screenshots of those 3 models.
[QUOTE=Robotboy655;44237675]That C code is nothing to do with the effect, all it does is send the start and end coordinates of the beam to client, and the effect index.
[editline]15th March 2014[/editline]
You should post screenshots of those 3 models.[/QUOTE]
Oh, sure, here they are (i still didnt port them):
[url]http://prntscr.com/30u188[/url] (bolt.mdl)
[url]http://prntscr.com/30u1eg[/url] (bolt2.mdl)
[url]http://prntscr.com/30u1m5[/url] (bolt3.mdl)
What Quake does I believe is simply render the same model over and over again from the start point to the end point.
Honestly I think you should try to recreate the effect as a trail in gmod without the use of custom models.
[QUOTE=Robotboy655;44237978]What Quake does I believe is simply render the same model over and over again from the start point to the end point.[/QUOTE]
How would i do that?
I mean, i know how to add a model to a effect, but i dont know how i would make it draw the bolts again and again till it reaches the wall (or NPC).
[QUOTE=BFG9000;44237987]Honestly I think you should try to recreate the effect as a trail in gmod without the use of custom models.[/QUOTE]
It is a trail already (Check Quake SWEPs), but i love the model thingy because its looks more like its old counterpart.
How "long" are the models then? Say, relative to a watermelon.
[QUOTE=BFG9000;44238239]How "long" are the models then? Say, relative to a watermelon.[/QUOTE]
I dont know exactly, but its probably sized like a crossbow bolt.
[QUOTE=Matsilagi;44238265]I dont know exactly, but its probably sized like a crossbow bolt.[/QUOTE]
Perfect, that's a small and manageable size and having it clip through walls ever so slightly would be a non-issue.
Also, do you have a way to compensate the bolt lag like in QuakeWorld? In standalone Quake multiplayer it pissed me off big time.
[QUOTE=BFG9000;44239175]Perfect, that's a small and manageable size and having it clip through walls ever so slightly would be a non-issue.
Also, do you have a way to compensate the bolt lag like in QuakeWorld? In standalone Quake multiplayer it pissed me off big time.[/QUOTE]
Unfortunately, no. Since we use this more in Singleplayer. But if i have an base code, i may optimize it later.
Pretty sure ToolTracer is a lightning style effect which you could use. Make an "effect" file which zigzags that all the way to the target?
Quake SWEPS already has a sprite based lightning effect according to Mat, he wanted the 3D effect specifically
Sorry, you need to Log In to post a reply to this thread.