Forum

Visible traceline

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Visible traceline

Postby Chip » Thu Feb 03, 2011 3:51 pm

How can I create a visible traceline for bullets?

I'm trying to create a simple gun that shoots almost instantly and I need a traceline for the bullet that fades away after a while.
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays

Fear not the dark, but what the dark hides.
User avatar
Chip
 
Posts: 575
Joined: Wed Jan 21, 2009 9:12 am
Location: Dublin, Ireland

Postby Error » Thu Feb 03, 2011 8:23 pm

use the lightning temp_ent but change the beam models? though isn't there a beam2?
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby Junrall » Fri Feb 04, 2011 4:45 am

Also, looking at some of the old grappling hook mods may be of some use.
Good God! You shot my leg off!
User avatar
Junrall
 
Posts: 191
Joined: Mon Sep 21, 2009 12:27 am
Location: North West Oregon, USA

Postby Sajt » Fri Feb 04, 2011 5:12 am

Are you using DarkPlaces?
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby leileilol » Fri Feb 04, 2011 5:16 am

Yeah there's no standard 'beam' builtin for engines like Half-Life has. Darkplaces at least has this weird undocumented "TE_TEI_G3" (NOT in dpextensions.qc) which is a white plane beam powered by two vectors (origin, destination) and a third filler vector of useless (Engoo reads it as rgb to make the color of the beam :D)). It was implemented way back in 2002 for Nexuiz, so using it will be compatible. BUT UNLESS YOU HAVE A LASER GUN OR SOME SORT OF AIR RIFLE IT IS GOING TO SUCK FOR BULLETS.
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Lardarse » Sat Feb 05, 2011 10:35 am

It might be easier to have a model of a tracer, and fire that as a projectile.
Roaming status: Testing and documentation
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby Spike » Sat Feb 05, 2011 2:40 pm

csqc specs specify a particletrail builtin, dp also implements this serverside. messy or not, it can be used instead of TE_TEI_G3, just give it a nice particle effect and job done.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Chip » Sun Feb 06, 2011 2:52 pm

Thanks for the help, I'll look those functions up and see what I can come up with.

The original idea was to have a thin trail of smoke which after a couple of seconds would disperse into the air, just like cigarette smoke.

EDIT: Yes, I'm using DarkPlaces.
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays

Fear not the dark, but what the dark hides.
User avatar
Chip
 
Posts: 575
Joined: Wed Jan 21, 2009 9:12 am
Location: Dublin, Ireland

Postby Sajt » Mon Feb 07, 2011 2:00 am

If the bullet is instant-hit (like a railgun), then TE_TEI_G3 is the way to go.

Code: Select all
void(vector start, vector end) te_tei_g3 =
{
   WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
   WriteByte (MSG_BROADCAST, 76);
   WriteCoord (MSG_BROADCAST, start_x);
   WriteCoord (MSG_BROADCAST, start_y);
   WriteCoord (MSG_BROADCAST, start_z);
   WriteCoord (MSG_BROADCAST, end_x);
   WriteCoord (MSG_BROADCAST, end_y);
   WriteCoord (MSG_BROADCAST, end_z);
   WriteCoord (MSG_BROADCAST, 0);
   WriteCoord (MSG_BROADCAST, 0);
   WriteCoord (MSG_BROADCAST, 0);
};


Save a file as particles/nexbeam.tga lets you retexture the beam. It's additive. It fades out in a second or so, not sure if you can configure it. Here's my nexbeam texture, it doesn't look like much in a paint program but in game it's a really nice subtle smoke trail (was used for a rifle).

http://www.manchild.org/nexbeam.tga

I think there might also be a console command that dumps the autogenerated particlefont/nexbeam to files. (If the files are present, they override the autogenerated ones.)
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby lth » Mon Feb 07, 2011 1:20 pm

You could use effectinfo in darkplaces too. I've got some neat tracers going on in my current mod.
User avatar
lth
 
Posts: 144
Joined: Thu Nov 11, 2004 1:15 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest