watertype / slime
Moderator: InsideQC Admins
4 posts
• Page 1 of 1
watertype / slime
Guys, I need a little help.
I have proportional fall damage.
I want to change it so that you take no damage when you fall into slime or water.
I was able to get it so that you take no damage when you fall in water, but the slime is giving me trouble.
Take a look at this bit of code and tell me what you think:
Thanks!
I have proportional fall damage.
I want to change it so that you take no damage when you fall into slime or water.
I was able to get it so that you take no damage when you fall in water, but the slime is giving me trouble.
Take a look at this bit of code and tell me what you think:
- Code: Select all
if (self.jump_flag <= -450 && self.jump_flag >= -600)
if (self.watertype != CONTENT_WATER)
if (self.watertype != CONTENT_SLIME)
{
r = self.jump_flag - (self.jump_flag * 2);
r = r / 80;
sound (self, CHAN_VOICE, "player/land2.wav", .8, ATTN_NORM);
self.deathtype = "falling";
T_Damage (self, world, world, r);
}
Thanks!
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
Maybe this would work:
This zeroes the damage if it's water or slime and only play sounds and damage self if there's something in r
I haven't tested it, but it might make thin layers of water or slime remove the falling damage.
This zeroes the damage if it's water or slime and only play sounds and damage self if there's something in r
- Code: Select all
if (self.jump_flag <= -450 && self.jump_flag >= -600)
{
r = self.jump_flag - (self.jump_flag * 2);
r = r / 80;
if (self.watertype == CONTENT_WATER || self.watertype == CONTENT_SLIME)
r = 0;
if (r > 0)
{
sound (self, CHAN_VOICE, "player/land2.wav", .8, ATTN_NORM);
self.deathtype = "falling";
T_Damage (self, world, world, r);
}
}
I haven't tested it, but it might make thin layers of water or slime remove the falling damage.
zbang!
-

jim - Posts: 599
- Joined: Fri Aug 05, 2005 2:35 pm
- Location: In The Sun
jim wrote:I haven't tested it, but it might make thin layers of water or slime remove the falling damage.
You might want to use the waterlevel field too. I don't remember its exact values though.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: Bing [Bot] and 1 guest