DP .modelflags

Discuss programming in the QuakeC language.
Post Reply
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

DP .modelflags

Post by Cobalt »

Messing around with these, finally got them to work. Found that setting it to 1 for a model flag will give it an orange glow. Seems if the movetype is none, it will be an orange glow, but if its moving, it will be an orange trailer. I tried it with the wall torches for a new effect:


Image

Looks decent but turns out if you move far away or change to an extreme angle the glow goes away. I guess this is normal because of the protocal or whatever. However the NO_MODELFLAG float does not seem to do anything at all when I set it....?
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: DP .modelflags

Post by Spike »

.modelflags is really only there for consistancy I believe.
you'll have achieve greater versitility from using other features instead.
Seven
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: DP .modelflags

Post by Seven »

Hello Cobalt,

I am using a DP build from august 2011 (and the corresponding dpextensions.qc).
You are speaking about the extension DP_SV_MODELFLAGS_AS_EFFECTS, right ?

I use this extension quite often inside the "small mod compilation".
You can give or take away or replace every "hardcoded" flag of a model.
That is very handy for some situations.
One example:
In Rogue (mission pack 2), the multirocket-launcher spits out 4 rocket parts at once.
Each of these 4 models use the flag for rockets.
If you have a custom rocket trail effect via effectinfo.txt, you will most probably run into
a to intense looking trail (because it is quadtrippled).
So I removed the flag via EF_NOMODELFLAGS and gave the model a new trail
via DP_ENT_TRAILEFFECTNUM.

For your special idea (to give some entities a "new" look/visual), I recommend to make
use of the DP_ENT_TRAILEFFECTNUM extension.
You can then declare your new custom effect via effectinfo.txt.
You must know that you can give each entity 2 different effects:
A) if the entity does not move
B) if the entity moves
Example for this:
Burning/glowing debris model:
When the debris lies on the floor, you can give it a small fire-like effect
When the debris flies (example directly after explosion) you can give it a smoke trail.
(Shoot the exploding boxes in the "small mod compilation" to see the debris example.)

I am happy to give you some more details if you have questions.

Best wishes,
Seven

EDITED:
The reason why the "effect" turns out if you move far way is the cvar setting for decals/particles.
Increase the distance of the cvar (look into dpwiki to see which ones are important) and you will see it longer.
But this affects all particles of course. So expect a bigger fps impact if you have many particles in your mod/game.

EDITED 2:
I forgot that I made a small youtube clip about the burning debris chunks.
That shows the 2 different effects of the same model nicely. Please find it here:
http://www.youtube.com/watch?v=ZxWK7UBkWjc&feature=plcp
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: DP .modelflags

Post by Cobalt »

Hi Seven:

Yea, thats the DP_SV_MODELFLAGS_AS_EFFECTS float in my example. I had suspected what you said abut the movement of the entity effecting how the effect looks but was not sure. I tried setting the cvar r_drawparticles_drawdistance to double the original , but still, the effect goes away. Its not as much a distance factor but depends more on the angle you are viewing the effect at if its around a corner for example. Not sure if that was the cvar you were refering to?
Seven
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: DP .modelflags

Post by Seven »

Hello Cobalt,

DP_SV_MODELFLAGS_AS_EFFECTS can only add the standard flag values to an entity.
For your case (you want to give a effect, like glowing to an entity) this dpextension is better:
DP_ENT_TRAILEFFECTNUM

You are absolutely free and can create your custom effect for your specific entity.

I tried to do what you intended: Giving a glow around torches.

Here are some screenshots of different conditions:

1.) original QC (with Romis rtlights)
Image

2.) Glowing around torches (with Romis rtlights)
Image

3.) Overbright glowing around torches to show you the possibility (with Romis rtlights)
Image


This was just a quick test, you can of course finetune the color values, intensity and so on.


This is the necessary QC change (in pure 1.06) inside misc.qc:
before:

Code: Select all

void() light_torch_small_walltorch =
{
	precache_model ("progs/flame.mdl");
	setmodel (self, "progs/flame.mdl");
	FireAmbient ();
	makestatic (self);
};
after:

Code: Select all

void() light_torch_small_walltorch =
{
	precache_model ("progs/flame.mdl");
	setmodel (self, "progs/flame.mdl");
self.traileffectnum = particleeffectnum("mycustomtorch");
	FireAmbient ();
//	makestatic (self);
};
This is the effect declaration (for screenshot 2) inside effectinfo.txt:

Code: Select all

effect mycustomtorch     
lightradius 100               
lightshadow 0                
lightcolor 1.7 0.5 0  
You need to add file "dpextensions.qc" and add it into progs.src right below "defs.qc" of course.

Best wishes,
Seven


EDITED:
There are of course other ways to bring the torch-glowing into your game.
Either modifiy the light itself inside each maps (bsp)
Or modify/create rtlights for each map

The above mentioned is the quickest way. All torches in all maps will have a glowing.
But you have to pay a price for that: fps
Depending on how many torches are inside the map, the fps will decrease accordingly.
Each torch/glow means a light source.
I dont know how this will effect fps with disabled realtime lighting.
You can test it. Maybe the fps hit is less with disabled realtime lighting
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: DP .modelflags

Post by Cobalt »

Hi Seven:


Thanks for that post, I tried your ideas and they look nice. for some reason, that extension was not in my copy of the extensions fiel, maybe I did not copy it entirely. I am combining the extensions file and the sv_playerphysics file into one qc file at the top of my mod. I did search more on this site and found the extension you posted it a while ago and others made comments on it. Also, Electro had a definition of the paramaters for effectinfo.txt which I was needing too so I got that off his site. Thank you.
Seven
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: DP .modelflags

Post by Seven »

Hello Cobalt,

the extension DP_ENT_TRAILEFFECTNUM has been introduced into the dpextension.qc in june 2011.
Please be sure to use the dpextension.qc file that came with the DP build that you use for your mod.
On the other side, you must always consider that users, that play your mod, use an older DP build.
The mod will therefore NOT work for them (as DP does not know the extension).
It is always a bit tricky to decide how far you want to go back with the dpextensions that you use.

I recommend going back to the last "stable" DP release from 28th june 2011.
This build and newer will be most probably used by players.

Regarding the effectinfo.txt explanations.
There is this amazing dpwiki (created by Error).
Here is the link to the effextinfo.txt script description:
http://dpwiki.slipgateconstruct.com/ind ... _Reference

Every existing param (and more) is explained nicely there.
I do not know Electro´s page. Maybe you want to give a link to his descriptions ?
It is always good to have different sources.
Thank you.
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: DP .modelflags

Post by Cobalt »

Hi Seven:

Im not sure where I got my extensions file from what build of DP....but putting in the extension manually seem to so far be working ok. That link to Electro's site is here:

http://bendarling.net/rts/dp_particles.txt

Yes, the June 2011 version is the one most people download from LH's site, however there are many builds happening all the time, and I no longer use that version anymore because after I got LH to check for the .items2 float which I need in my mod, I make sure I have a version > Nov 2011 to play my mod, and my server requires the same.

There is also a bug I found regarding a collision problem that appears on E1M4 and E1m1 that LH is aware of and is trying to fix. I suppose after he fixes that , he can up the latest stable release version.....
Post Reply