Inside3D!
     

Darkplaces effectinfo and QC - how?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
lth



Joined: 11 Nov 2004
Posts: 129

PostPosted: Wed Dec 02, 2009 2:08 am    Post subject: Darkplaces effectinfo and QC - how? Reply with quote

Hi,

Anyone actually know how to add a new custom effect to a mod using effectinfo? I want to add a new grenade-trail-like effect.

So, some questions:
- When I create a new effect in effectinfo I give it a name: what does this name relate to? If I call it TR_PELLET, how do I decide in my QC what float value TR_PELLET should have in order to be detected and used?
- Is it possible to add custom sprites to effectinfo? How?

Any tutorials anyone can point me at would be greatly appreciated, I have searched for them but not found any.

If there isn't a "beginners' guide to effectinfo" then if people spew everything they know about effectinfo here, I will attempt to write one!

Thanks,

LTH
_________________
randomviolence - tactical combat boardgame
Back to top
View user's profile Send private message
Chip



Joined: 21 Jan 2009
Posts: 314
Location: Romania

PostPosted: Wed Dec 02, 2009 10:30 am    Post subject: Reply with quote

I created new fire and smoke effects, but I was working on a CSQC installation I found on the web, and I just replaced the functions, see where they appeared and I replicated that.

Let me search inside the source, and I'll come up with something you might use. It'll take a couple of days, though.

Check out my Vimeo channel for the smoke and fire tests: http://www.vimeo.com/butterflymedia

EDIT: I might say that this effect http://www.vimeo.com/6994514 is using two effectinfo.txt effects, placed one above the other.

It's pretty simple to do it, the hard part comes when tweaking and trying to make it look real. Wink
_________________
My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake
Back to top
View user's profile Send private message Visit poster's website
lth



Joined: 11 Nov 2004
Posts: 129

PostPosted: Wed Dec 02, 2009 10:52 am    Post subject: Reply with quote

Yeah, I saw some of your stuff a while ago, which is why I was interested Smile Any help you can give is greatly appreciated.
_________________
randomviolence - tactical combat boardgame
Back to top
View user's profile Send private message
LordHavoc



Joined: 05 Nov 2004
Posts: 243
Location: western Oregon, USA

PostPosted: Wed Dec 02, 2009 1:02 pm    Post subject: Re: Darkplaces effectinfo and QC - how? Reply with quote

lth wrote:
Hi,

Anyone actually know how to add a new custom effect to a mod using effectinfo? I want to add a new grenade-trail-like effect.

So, some questions:
- When I create a new effect in effectinfo I give it a name: what does this name relate to? If I call it TR_PELLET, how do I decide in my QC what float value TR_PELLET should have in order to be detected and used?


If the name matches one of the engine-supported names, then it is a replacement for that engine effect (TE_GUNSHOT, etc).

Custom names can only be reached using pointparticles(particleeffectnum("shotgunpellet"), org, vel, num);
or trailparticles(particleeffectnum("rifletrail"), start, end);

Where the example strings are "shotgunpellet" and "rifletrail", any custom name works fine, however the same effectinfo.txt must be installed on both client and server so that they agree on the numbers for these names.

Multiple entries can have the same name and will be triggered at once (for example sparks, smoke, decal + light flash).

lth wrote:
- Is it possible to add custom sprites to effectinfo? How?


The short answer is no, but it's not as hopeless as it sounds.

All particle textures must be in a single image (named particles/particlefont.tga ) in an 8x8 grid (that is to say, 64 total cells).

I discussed the idea of customizing the grid size and allowing a number of beams (repeating textures) on one side of the image, with divverent at one point, but it appears that he has not added such a feature.

You can get an example effectinfo.txt here:
http://icculus.org/twilight/darkplaces/files/particlefont.zip

The tex commands in the effectinfo.txt correspond to ranges of cells (0-63) in the font, so for example tex 8 16 will choose randomly from 8 9 10 11 12 13 14 15 (collectively the entire second row) when spawning each particle.

Take consideration of the blend mode used as well - for example the ordinary particle textures are white with an alpha channel, where as decals are full color but inverted (that is to say, a cyan blob on black will make a dark red stain in the middle of an otherwise white surface).

lth wrote:
Any tutorials anyone can point me at would be greatly appreciated, I have searched for them but not found any.

If there isn't a "beginners' guide to effectinfo" then if people spew everything they know about effectinfo here, I will attempt to write one!

Thanks,

LTH


I'd appreciate it if someone writes such a guide Smile
Back to top
View user's profile Send private message Visit poster's website
lth



Joined: 11 Nov 2004
Posts: 129

PostPosted: Wed Dec 02, 2009 1:29 pm    Post subject: Reply with quote

Thanks, LH, that's a great help!
_________________
randomviolence - tactical combat boardgame
Back to top
View user's profile Send private message
Supa



Joined: 26 Oct 2004
Posts: 122

PostPosted: Wed Dec 02, 2009 5:52 pm    Post subject: Reply with quote

lth wrote:
If there isn't a "beginners' guide to effectinfo" then if people spew everything they know about effectinfo here, I will attempt to write one!

While it isn't exactly a guide, Electro has documented most of the keys here.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group