CSQC HUD possibilities

Discuss anything not covered by any of the other categories.
Post Reply
Seven
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

CSQC HUD possibilities

Post by Seven »

Hello,

I am sorry for creating a new thread, but I didnt want to hijack other CSQC threads with this.
Now that CSQC becomes more and more popular and important (which is a god thing !), I would like to ask a question, that I have in mind for quite some time:
With CSQC the HUD is very good customizable.
But is it also possible to add a model instead of a texture ?
Example:
I would like to replace the Armor HUD textures (green, yellow red) with a slowly spinning armor model in that color.
Same would go with the ammo HUD texture, which should be replaced by a slowly spinning armor model of that type.
The model should not be interactive/sensible towards light. It shall always be fullbright.

Is this possible ?

Thank you very much for your answer.
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: CSQC HUD possibilities

Post by toneddu2000 »

good question. I always asked myself if it's possible.
+1
Meadow Fun!! - my first commercial game, made with FTEQW game engine
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: CSQC HUD possibilities

Post by Spike »

Seven
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: CSQC HUD possibilities

Post by Seven »

Thank you Spike,

I read through Hud_Draw3dItem and begin to understand.
The thing that is not clear yet, is the spinning of the model.
It should not spin via flag "8". It should spin via "hud3ditem.avelocity". Is this possible ?

Or do I need to make a loop function that counts in 5° steps upwards till 360° and then counts backwards and sets the angle accordingly and calls Hud_Draw3dItem() with the angle value everytime ?
A ".avelocity" possibility would be easier I think.

Anyway, it is very good to know that you gave the possibility via CSQC to do these kind of things.
Thank you Spike.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: CSQC HUD possibilities

Post by Spike »

there should be a dp extension to disable that dp extension. hud3ditem.modelflags = whatevertheheckitwas;
Seven
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: CSQC HUD possibilities

Post by Seven »

Sorry, I most probably used the wrong word in my above post.

I only wanted to know if I can use "hud3ditem.avelocity = '0 100 0';" (for example) in CSQC´s HUD function.
The model will not have a hardcoded flag, that needs to be disabled via DP_SV_MODELFLAGS_AS_EFFECTS.

But you gave the answer already, while saying that I can even use "hud3ditem.effects = EF_NOMODELFLAGS;" in CSQC.
So that means I can extend the HUD function with every existing SSQC extension as well.
In other words, SSQC extensions also work in CSQC.
That is great !
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: CSQC HUD possibilities

Post by Spike »

.avelocity is part of the movetype. DP does not support movetypes in csqc, thus you cannot use .avelocity with dp's csqc implementation.
the code I pointed you to is a generic function to add a single entity in the current frame. the entity used can end up being reused for multiple different models/hud items (ie: q3 has ammo+head+armor on its hud). In which case even if avelocity worked, you'd need to tweek that part specifically.
It should be easy enough to just set self.angle_y = time*ROTATIONSPEED; Its csqc so its not sent over the net, not interpolated, etc, so should be perfectly smooth.
Seven
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: CSQC HUD possibilities

Post by Seven »

Hello Spike,

during my trial and errors with this subject, I maybe found a bug in your hud.qc.
I am of couse not sure if this is really a bug or if it is just my incompetence, but at least I wanted to share it with you.
During compiling with fteqcc I got a "bad vector" in hud.qc.

In your file hud.qc
http://fteqw.svn.sourceforge.net/viewvc ... /cs/hud.qc
there is a function called: Hud_Draw3dScene.
This line created a "bad vector" for me:

Code: Select all

setviewprop(VF_FOV, '30 30');
It seems that the 3rd value for the vector is missing.
But again, maybe it is just my fault...
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: CSQC HUD possibilities

Post by Spike »

I keep tweeking fteqcc all the time, for better or for worse.
svn builds of fteqcc currently accept 2-componant vectors as valid vectors, silently assuming the third is 0. Its quite handy for csqc things, but not a universal feature.
(note that it doesn't accept 1-componant vectors as valid, because those are interpreted as character constants and would be too ambiguous).
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: CSQC HUD possibilities

Post by Nahuel »

in csqc to get display stuff (like HUD) everytime z value is 0 :)
hi, I am nahuel, I love quake and qc.
Post Reply