[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/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 - Breathing and Constant pain sounds

Breathing and Constant pain sounds

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Breathing and Constant pain sounds

Postby thommoboy » Thu Jan 19, 2012 2:21 am

how would i code it so that while my player is walking or idling quake plays a sound and when the players health drops below 20 it plays another sound?
thommoboy
 
Posts: 95
Joined: Mon Nov 21, 2011 6:35 am

Re: Breathing and Constant pain sounds

Postby sniperz227 » Thu Jan 19, 2012 3:11 am

if(self.health < 20)
{
sound (self,CHAN_VOICE,"soundname here", 1, ATTN_NORM);
}

i wasnt sure if you were talking bout if there health goes under 20 or while its under 20 the method above is if for while you'd obviously do while loop.

for idiling you'd use

if (!self.velocity_x && !self.velocity_y)
{
sound (self,CHAN_VOICE,"soundname here", 1, ATTN_NORM);
}

etc.. for walking basically the opposite of the example above. although i should worn you the statement above is called as soon as your player stops moving so if you want it to be after a certain amount of time just use the time thing in qc
sniperz227
 
Posts: 112
Joined: Sat Apr 09, 2011 3:19 am

Re: Breathing and Constant pain sounds

Postby Ghost_Fang » Thu Jan 19, 2012 3:53 am

Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Re: Breathing and Constant pain sounds

Postby thommoboy » Thu Jan 19, 2012 3:54 am

where would i put it? lol :P
thommoboy
 
Posts: 95
Joined: Mon Nov 21, 2011 6:35 am

Re: Breathing and Constant pain sounds

Postby thommoboy » Thu Jan 19, 2012 3:59 am

thommoboy
 
Posts: 95
Joined: Mon Nov 21, 2011 6:35 am

Re: Breathing and Constant pain sounds

Postby thommoboy » Thu Jan 19, 2012 4:19 am

dw ive got it figured out thanks heaps :P
thommoboy
 
Posts: 95
Joined: Mon Nov 21, 2011 6:35 am

Re: Breathing and Constant pain sounds

Postby sniperz227 » Thu Jan 19, 2012 5:45 am

thommo boy its not very hard finding out how to code little things like this, i dont know how to do it by heart but as soon as i saw player, play,sound i thought of how when the player jumps or falls and it plays a sound then found that function, even for idle i know theres an animation for a player standing so i checked player.qc n found it
sniperz227
 
Posts: 112
Joined: Sat Apr 09, 2011 3:19 am

Re: Breathing and Constant pain sounds

Postby thommoboy » Thu Jan 19, 2012 6:28 am

cool ive been trying to do this for ages but how would i make it so the player spawns with sv_gravity 90000
?
thommoboy
 
Posts: 95
Joined: Mon Nov 21, 2011 6:35 am

Re: Breathing and Constant pain sounds

Postby sniperz227 » Thu Jan 19, 2012 8:36 pm

the fact that you said cool n just ignored everything i said doesnt help... some already told you how *baker* in one of your posts what function to use... you cant make up a game that consists of other ppl's code
sniperz227
 
Posts: 112
Joined: Sat Apr 09, 2011 3:19 am

Re: Breathing and Constant pain sounds

Postby DukeInstinct » Thu Jan 19, 2012 11:34 pm

OK GUYS. I've been trying to do this for ages, and by ages, I mean 5 and a half seconds. How do you make gun shoot bullet that goes really really fast and hits people in the face and kills them?
*Gets answer*
*Copies and pastes code*

Cool next question....
Image
User avatar
DukeInstinct
 
Posts: 20
Joined: Sat Jul 10, 2010 11:20 pm
Location: DukeLand

Re: Breathing and Constant pain sounds

Postby thommoboy » Fri Jan 20, 2012 12:16 am

here we go with the trolling again...
thommoboy
 
Posts: 95
Joined: Mon Nov 21, 2011 6:35 am

Re: Breathing and Constant pain sounds

Postby ceriux » Fri Jan 20, 2012 2:53 am

thommo i suggest you literally read quakes source like it's a book, so you get the idea of where you can find things. after that start with smaller mods, then move on to something bigger. if you don't try and work with what you know and learn how to use the resources you have, you will never be able to code anything yourself and will have to ask how to code EVERY thing you're working on. i suggest attempting to code something yourself even if it is not a feature that really matters, see how far you can get , then move on to something harder and do the same. get the code as close to as what you think it should be or how you think it should work. post your work here then ask for suggestions. that way you can see your way of thinking when it comes to code and the correct methods and compare them.
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Breathing and Constant pain sounds

Postby thommoboy » Fri Jan 20, 2012 6:34 am

thats what im doing right now
thommoboy
 
Posts: 95
Joined: Mon Nov 21, 2011 6:35 am

Re: Breathing and Constant pain sounds

Postby ceriux » Tue Jan 24, 2012 1:03 am

you should post up the work you tried when making a topic, so everyone can see what you've tried and tell you where your mistakes are...
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 2 guests