[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/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 - Noob setting too big a goal- would like assistance

Noob setting too big a goal- would like assistance

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Noob setting too big a goal- would like assistance

Postby TargetPractice » Fri Dec 01, 2006 4:45 am

TargetPractice
 
Posts: 17
Joined: Thu Nov 30, 2006 9:24 pm

Re: Noob setting too big a goal- would like assistance

Postby Preach » Fri Dec 01, 2006 9:55 am

That sounds like a pretty sensible way to do things. There are three functions you can use to get an integer from a floating point value(don't worry, it's not as complicated as it sounds!)

rint(a) returns the nearest integer to a, so rounds up if the decimal is .5 or more, and rounds down otherwise:
rint(3.276) = 3
rint(4.576) = 5

floor(a) returns the greatest integer less than a, so basically just chops off all the decimal places from the number:
floor(22.15983) = 22

ceil(a) returns the smallest integer greater than a, which is like doing floor and then adding 1.
ceil(22.15983) = 23

rint is probably the best one to use. Also make sure that you have a check to see when the damage the entity is doing is rounded to 0, and remove the entity at that point. Otherwise you'll have all these entities doing nothing, and eventually the engine may run out of entities.

To make the entity take damage off each frame, set the owner field of the poisoning entity to the self.owner you sent to Poison_it, and the enemy field to the other you sent. Then in the think function you create, have a line

T_Damage (self.enemy, self, self.owner, a);

where a is the amount of damage you have computed. This line tells quake to damage self.enemy (the player), that the damage is inflicted by self(the poison), that the damage was originally caused by self.owner(a scrag), and that the amount of damage to do is a.

Hope that helps somewhat, let us know if you have any more problems.
Preach
 
Posts: 122
Joined: Thu Nov 25, 2004 7:20 pm

Postby TargetPractice » Sat Dec 02, 2006 5:27 am

I never thought hearing pained, fearful screams could make one feel so... uplifted.

What?
TargetPractice
 
Posts: 17
Joined: Thu Nov 30, 2006 9:24 pm

Postby Lardarse » Sat Dec 02, 2006 11:03 pm

You will need to use a find loop, searching for the classname of the entity that is doing the acid damage (make sure that you set one when it is created), and then for each one, check that it belongs to the player in question.
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby TargetPractice » Sun Dec 03, 2006 3:53 am

I think I have it working now. I anticipate a problem with it if anything besides humans get acid burns when someone grabs a medikit, but I rather doubt that to be the case for now. (Will improve it if that ceases to be the case.)

Thank you all for the help.
I never thought hearing pained, fearful screams could make one feel so... uplifted.

What?
TargetPractice
 
Posts: 17
Joined: Thu Nov 30, 2006 9:24 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 3 guests