Page 1 of 2

How do you make units immune to water?

Posted: Fri Aug 03, 2007 4:02 pm
by 1z2x3c
how do you make you units amune to water?

RE: immune to water

Posted: Fri Aug 03, 2007 10:41 pm
by Penguin
To our knowledge, you cant.

RE: immune to water

Posted: Fri Aug 03, 2007 11:28 pm
by Phyzzle
Can't you make it so that a person regularly recieves health to cancel out the effects of water... you have to make the map completely underwater though.

RE: immune to water

Posted: Fri Aug 03, 2007 11:32 pm
by Penguin
you could add negative damage regions in the water, but then players could just stand 1/2 in the water so that they get the added health :/

Posted: Sat Aug 04, 2007 12:15 am
by Ace_Azzameen_5
Maybe a bunch of crazy LUA stuff involving OnEnterRegion and some kind of SetProperty(PLAYER, Health, 100) thing.

Not sure if all the functions are there. Not at this time of night.

Posted: Sat Aug 04, 2007 12:24 am
by Maveritchell
Problem is still that entering the region restores/maximizes health (what if you're getting shot at?) when you stand in it.

Posted: Sat Aug 04, 2007 1:46 am
by 1z2x3c
i was trying to make the gungans breath under water.

Posted: Sat Aug 04, 2007 8:09 am
by Master Fionwë
There is a way you could do it. Find out the rate at which water damages guys, and then counter that rate with a regen ability working at a parallel level to the damage. Quite simply, if the water does 20 damage every second, mess around with the regen until it heals the unit, at the same pace, so that he does not gain any health really, except what he lost from the water. So if he is brought down to 200 health by a bullet, the regen won't bring it any higher because the water is trying to bring it lower, it might increase by ten in that second, and then the water does ten damage.
See what I mean?
It would take a while to get right, since regen appears to work faster than water, but still, it would work to get that apearance you want.

Posted: Sat Aug 04, 2007 8:19 am
by Penguin
We were saying that before Fionwë lol.

Posted: Sat Aug 04, 2007 8:22 am
by Master Fionwë
I know, I was just explaining further how he could do it. ;)

Posted: Sat Aug 04, 2007 8:59 am
by Maveritchell
There're some inherent problems with using a healing region to counteract water damage.

One, there's always going to be an area where the healing region works and the water damage doesn't, or vice versa. (Don't be so fast to say you have a solution, what if you walk into the water crouched down?)

Two, water damage takes a few seconds to start working; healing regions don't.

Posted: Sat Aug 04, 2007 9:17 am
by Phyzzle
Hmm...

Maybe we should just do what Penguin did make it looks as though it's underwater with creative lighting Sun'ken Mines FTW!

Posted: Sat Aug 04, 2007 10:26 am
by Master Fionwë
What if you used a delay on the region. Could you set that up in the scripts, so that it waits for two seconds before taking effect?

Posted: Sat Aug 04, 2007 11:24 am
by Ace_Azzameen_5
Maveritchell wrote:Problem is still that entering the region restores/maximizes health (what if you're getting shot at?) when you stand in it.
Yeah, actually, my post was a really, really simplified version of my idea.
It involves checking the class, possible the animation position (roll, crouch)
and then getting its current health and setting it to that plus how much the water has damaged the units.

Their would also be timers to match the amount of time it takes for the unit to start getting damaged and how long it takes to occur.

Also there would be a variable that indicates wether or not the unit is till in the water, it would be set back to zero by an OnExitRegion event.

There might even be a way to check if the water has damaged the unit,
like by using the GetLastHitWeapon statment or something

Despite how complicated it sounds, it could be coded pretty efficiently ... but I'm not even going to try untill I get "GetCharacterUnit(player)" to work. Also, there is still the crouch loop hole, cause I don't think their actually is a way to check a player's current pose.

Posted: Wed Aug 15, 2007 10:46 am
by Carth
Hey guys, I found something in the Droideka .odf... maybe it can help:

Code: Select all

WaterDamageInterval     = "1.0"
WaterDamageAmount       = "10.0"
Have you tried to change the "Damage Amount" to 0? It's only a idea. :-/

Carth

Posted: Wed Aug 15, 2007 10:54 am
by Caleb1117
Interesting find Carth.
Perhaps if you added that line to each units odf (or just the concerned unit)
And set it to 0.0 That might work.

Posted: Wed Aug 15, 2007 1:15 pm
by Maveritchell
Doesn't work, it's been tried. Good eyes, though.

Posted: Wed Aug 15, 2007 1:15 pm
by jangoisbaddest
You're forgetting a rather large problem #2: you can't use weapons underwater.

Posted: Wed Aug 15, 2007 1:22 pm
by ARC_Commander
I always thought that WaterDamageInterval and WaterDamageAmount controlled water damage.

Posted: Wed Aug 15, 2007 1:22 pm
by 1z2x3c
all i was trying to do was keep my gungans from dieing when the go underwater because their stupid ai's