[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Sbar_DrawFace question

Sbar_DrawFace question

Discuss CSQC related programming.

Moderator: InsideQC Admins

Sbar_DrawFace question

Postby smd » Mon Feb 23, 2015 11:42 pm

Hi!

I have edited my HUD in darkplaces, all works fine except the little animation for the gfx/face!

It only changes to face1, face2, face3, face4, face5, it misses the face_p1, face_p2, face_p3, face_p4, face_p5 when i get hit!

Maybe someone can help, would be great

Here is what i got:


health = GetStat_FLOAT_TRUNCATED(STAT_HEALTH);
if (health < 0)
health = 0;
if (health >= 100)
f = 4;
else
f = floor(health / 20);

Sbar_DrawPic('-208 24 0', strcat("gfx/face", ftos(5 - f)), ALPHA_FULL, 1);
smd
 
Posts: 26
Joined: Sun Sep 23, 2007 2:58 pm

Re: Sbar_DrawFace question

Postby Spike » Tue Feb 24, 2015 1:03 am

dp has dmg_take, dmg_save, dmg_origin globals in its csqc.
if take or save is set, make a note of the time and if it happened within the last second or so, insert an extra _p into the drawpic image name.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Sbar_DrawFace question

Postby smd » Tue Feb 24, 2015 7:09 pm

thanks for your help but im a newbie.

how can i set this dmg_values and where to put them?

its annoying i know, sorry!
smd
 
Posts: 26
Joined: Sun Sep 23, 2007 2:58 pm

Re: Sbar_DrawFace question

Postby PrimalLove » Tue Feb 24, 2015 8:59 pm

PrimalLove
 
Posts: 14
Joined: Sun Oct 19, 2014 2:37 am

Re: Sbar_DrawFace question

Postby Spike » Tue Feb 24, 2015 9:21 pm

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Sbar_DrawFace question

Postby smd » Tue Feb 24, 2015 10:00 pm

thank you very much both of you guys!
it works great now!
nice :D
smd
 
Posts: 26
Joined: Sun Sep 23, 2007 2:58 pm

Re: Sbar_DrawFace question

Postby toneddu2000 » Wed Feb 25, 2015 12:13 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: Sbar_DrawFace question

Postby Spike » Wed Feb 25, 2015 1:57 pm

no. they are fields in ssqc and thus I refuse to make them non-fields in csqc as it would force inconsistancies.
I'll add a CSQC_Parse_Damage as compensation, allowing you to emulate it (or easily inhibit it).
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Sbar_DrawFace question

Postby toneddu2000 » Wed Feb 25, 2015 2:41 pm

yeah, imo what FTEQW really needs is documentation: a solid documentation that explains in details all the CSQC_ builtin fuctions, one by one. I'm trying to do it by myself but I'm too noob to do the task all on my own. Because, for what I understood, the power of CSQC_ builtins is that you can use them as class-parented methods in Object-Oriented languages. If you let them unchanged, the default method will be applied. If you modify it, you'll ovveride default method. Which it's awesome, imo, but maybe that'd need a little documentation more
- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: Sbar_DrawFace question

Postby Cobalt » Sat May 16, 2015 2:58 pm

That code works great Primallove, thank you.
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA


Return to CSQC Programming

Who is online

Users browsing this forum: No registered users and 1 guest