Deadly water

Ask questions, discuss ideas, get answers
Post Reply
anselmus
Posts: 82
Joined: Sun Oct 18, 2009 6:42 pm

Deadly water

Post by anselmus »

It is possible to have the soldier loses energy very quickly when you fall into the sea, almost instantly?
As if the water was deadly.
Tkanks.
User avatar
archer
Posts: 54
Joined: Fri Feb 05, 2010 4:40 pm
Location: Übertów
Contact:

Re: Deadly water

Post by archer »

Hi!
You are interested in objects.rfa, file
Objects/Soldiers/Common/CommonSoldierData.inc
The lines are
ObjectTemplate.WaterDamageDelay 90
ObjectTemplate.DamageFromWater 1
The first one is the number of seconds after which you start taking damage (You want to set it to 0.)
The other one is the number of HP you loose after each second of being in water. (Any big number will do here.)
By default players have 30hp, so they can swim for 90 seconds without taking damage, and then additional 30 seconds while loosing 1hp per second. This gives us 2 minutes in total before a healthy soldier drowns. Not much IMHO ^^
dzn.battlefield.pl - my Bf1942 modding website
anselmus
Posts: 82
Joined: Sun Oct 18, 2009 6:42 pm

Re: Deadly water

Post by anselmus »

:) Ok, but it is possible to SSM, without changing the original files bf42?
Ex: Deadly water: "Wake Insland" or "Battle of Britain", "no more swimming"..rs.
User avatar
archer
Posts: 54
Joined: Fri Feb 05, 2010 4:40 pm
Location: Übertów
Contact:

Re: Deadly water

Post by archer »

It is possible in theory, never tried it though.
Just see what sides take part in your map and then for each team update their soldier with your aquaphobia script in ObjectSpawnTemplates.con.
For example: let's take Bocage.
bf1942/levels/Bocage/Conquest/ObjectSpawnTemplates.con:

Code: Select all

ObjectTemplate.active GermanSoldier
ObjectTemplate.WaterDamageDelay 0
ObjectTemplate.DamageFromWater 9000

ObjectTemplate.active USSoldier
ObjectTemplate.WaterDamageDelay 0
ObjectTemplate.DamageFromWater 9000
If you are unsure what soldiers take part in your map, check your map's init.con

Code: Select all

game.setTeamSkin 1 GermanSoldier
[...]
game.setTeamSkin 2 USSoldier
The possible soldiers are:
BritishSoldier
CanadianSoldier
GermanDesertSoldier
GermanSoldier
JapaneseSoldier
RussianSoldier
USMarineSoldier
USSoldier
dzn.battlefield.pl - my Bf1942 modding website
Post Reply