Inside3D!
     

Impulse commands
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Wed Aug 22, 2007 4:25 pm    Post subject: Reply with quote

Guys, I tried some of the tutorials. I got to the footsteps to work, and the proportional fall damage to work as well. (Didn't teach me much though, more of a walk-thru).
I can't get the healing backpack to work. Is the tutorial correct?

Where can I find the "Coffee" Tutorials?

Thanks for putting up with a noob!
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Orion



Joined: 12 Jan 2007
Posts: 413
Location: Brazil

PostPosted: Wed Aug 22, 2007 4:37 pm    Post subject: Reply with quote

There's a mistake in the healing backpack tutorial.
To fix that, find BackpackTouch() in items.qc, and after this line: (other.ammo_cells = other.ammo_cells + self.ammo_cells)

Add this:
Code:

other.health = other.health + self.health;
   if (other.health > other.max_health)
      other.health = other.max_health;


Now the player will receive health. Wink


Here you can find the Coffee's tutorials.
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Thu Aug 23, 2007 12:00 am    Post subject: Reply with quote

Thanks man! I'll try it out later.
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Thu Aug 23, 2007 10:04 pm    Post subject: Reply with quote

Man am I getting frustrated! Mad

It didn't work. Still won't compile.

Anyway, I was thinking and tinkering. I thought it would be better if you lost health for picking up a backpack. A penalty for all the goodies. So I tried some coding on my own:


PLAYER BACKPACKS

===============================================================================
*/

void() BackpackTouch =
{
local string s;
local float best, old, new;
local entity stemp;
local float acount;
local float b_switch;

self.touch=health_touch;
self.healamount = -25;
if (self.health <= 0)
return;


if (deathmatch == 4)
if (other.invincible_time > 0)
return;

I added the code in bold.

The good news is it worked. When I grab the backpack I lost 25 health. Surprised
Bad news is if I died I wouldn't respawn. I'd just lie there on the ground dead. Mad

How do I get to respawn?
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
scar3crow
Inside3D Staff


Joined: 18 Jan 2005
Posts: 837
Location: Las Vegas, NV

PostPosted: Fri Aug 24, 2007 12:44 am    Post subject: Reply with quote

I'm not a coder, but in my dabbling, I have found that if your health goes below 1, and it isn't dealt by T_damage or some sort (anyone can correct me on this I know), it doesn't perform a proper death.

Instead of just doing a negative heal amount, you need to put in the backpack's touch function a damage call to whoever is picking it up. Take a look at the code for weapons and see how they damage things, find the specific line, and try applying similar to the backpack touch.
Back to top
View user's profile Send private message AIM Address
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Fri Aug 24, 2007 4:26 am    Post subject: Reply with quote

What scar3crow said. Also what the iD source code says. T_Damage and T_RadiusDamage should be the only functions used to do damage to the player.
_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Mon Aug 27, 2007 2:42 am    Post subject: Reply with quote

Ok, got it.
All I needed to do was add:

T_Damage (other, self, self, 5);

In (void() BackpackTouch =) to do 5 damage. Smile

I have another question.
You know how you lose a frag when you fall to your death?
How can that be removed?
I looked for a (self.frags = self.frags - 1; ) in (void() PlayerPostThink =) in client.qc where the code is for the falling damage, but I didn't see it. Confused
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Mon Aug 27, 2007 3:05 am    Post subject: Reply with quote

I think that happened in the ClientObituary function (bottom of client.qc)
_________________
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Mon Aug 27, 2007 4:34 am    Post subject: Reply with quote

OK, found it. Thanks.
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group