How do you make units immune to water?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

1z2x3c
3rd Warning
3rd Warning
Posts: 259
Joined: Mon Jul 16, 2007 3:22 am

How do you make units immune to water?

Post by 1z2x3c »

how do you make you units amune to water?
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

RE: immune to water

Post by Penguin »

To our knowledge, you cant.
Phyzzle

RE: immune to water

Post 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.
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

RE: immune to water

Post 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 :/
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post 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.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Post by Maveritchell »

Problem is still that entering the region restores/maximizes health (what if you're getting shot at?) when you stand in it.
1z2x3c
3rd Warning
3rd Warning
Posts: 259
Joined: Mon Jul 16, 2007 3:22 am

Post by 1z2x3c »

i was trying to make the gungans breath under water.
Master Fionwë
Rebel Colonel
Rebel Colonel
Posts: 598
Joined: Wed May 30, 2007 3:33 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: At RCTC
Contact:

Post 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.
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

Post by Penguin »

We were saying that before Fionwë lol.
Master Fionwë
Rebel Colonel
Rebel Colonel
Posts: 598
Joined: Wed May 30, 2007 3:33 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: At RCTC
Contact:

Post by Master Fionwë »

I know, I was just explaining further how he could do it. ;)
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Post 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.
Phyzzle

Post 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!
Master Fionwë
Rebel Colonel
Rebel Colonel
Posts: 598
Joined: Wed May 30, 2007 3:33 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: At RCTC
Contact:

Post 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?
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post 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.
Carth

Post 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
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Post 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.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Post by Maveritchell »

Doesn't work, it's been tried. Good eyes, though.
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

Post by jangoisbaddest »

You're forgetting a rather large problem #2: you can't use weapons underwater.
ARC_Commander
High General
High General
Posts: 838
Joined: Tue Feb 06, 2007 7:18 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by ARC_Commander »

I always thought that WaterDamageInterval and WaterDamageAmount controlled water damage.
Last edited by ARC_Commander on Wed Aug 15, 2007 1:24 pm, edited 1 time in total.
1z2x3c
3rd Warning
3rd Warning
Posts: 259
Joined: Mon Jul 16, 2007 3:22 am

Post by 1z2x3c »

all i was trying to do was keep my gungans from dieing when the go underwater because their stupid ai's
Post Reply