A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Absolute beginners guide to decals

Decals are a type of particle. In the code they are defined as “type cdecal”.

1. In Gimp, make a new image, size 256×256 (or 64², 128² etc), advanced options->fill with background color, and start drawing your decal. Alternatively, if you already have an existing image: layers-> “add alpha channel”, and delete the areas (ie on top layer) which will be invisible.

2. Export as (eg) foo.png, and put it in “particles/foo.png”

3. Open/make text file and make a particle:
r_part blast_damage
type cdecal
texture particles/foo.png // name of the image
scale 10 // how big is it?
die 30 // how many seconds till it fades away?
rgb 255 255 255 // this will use the original colours

4. Save as Quake\yourmodname\particles\ my_decals.cfg

5. qc: Use particleeffectnum to give the particle a (global) number that pointparticles() can use later.

// a global
float PARTICLE_BLAST_DAMAGE = particleeffectnum(“my_decals.blast_damage”); // NOTE: “filename.particlename”, ie the file is called my_decals, the particle is called blast_damage

6. qc: call pointparticles!
// pointparticles void(float effectnum, vector origin, optional vector dir, optional float count) = #337;

pointparticles(PARTICLE_BLAST_DAMAGE, somesurface.origin, ‘0 0 0’, 1);

// because decals don’t move, and we only use one, we can condense this to:
pointparticles(PARTICLE_BLAST_DAMAGE, somesurface.origin);

1. blend mode merges by default. However this means you can see gunshots in darkness. Spoike says: “the problem is that as a post-process effect, the decal is unable to distinguish between light and surface. subtract assumes they’re the same thing while merge totally ignores the actual surface behind along with its lighting etc”

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.