making a ship sink faster
making a ship sink faster
Hello,
as you probably already know, my mod involves flying battleships. When destroyed, i need them to "sink" by plummeting to earth. Yet for some reason the game is reluctant to make the ships go down.
On the current build, they have the same mass and floatbundle layout as the Prince of Wales, with a much higher hull height. When the ships die, they keep on floating. Even using a wreckage geometry they float.
they all float.
they bounce up and down as they sloooooowly descend into the ground.. IF they descend, which they don't always do.
I tried using the ObjectTemplate.SetSinkingSpeedMod but all i could do is make it tilt a little. The ObjectTemplate.SinkInToLandAfterDeathSpeed modifier makes them disappear for some reason. Setting the minimum floater lift to 0 doesn't help either.
The mod weights heavily on these ships working properly. Any help is apreciated
as you probably already know, my mod involves flying battleships. When destroyed, i need them to "sink" by plummeting to earth. Yet for some reason the game is reluctant to make the ships go down.
On the current build, they have the same mass and floatbundle layout as the Prince of Wales, with a much higher hull height. When the ships die, they keep on floating. Even using a wreckage geometry they float.
they all float.
they bounce up and down as they sloooooowly descend into the ground.. IF they descend, which they don't always do.
I tried using the ObjectTemplate.SetSinkingSpeedMod but all i could do is make it tilt a little. The ObjectTemplate.SinkInToLandAfterDeathSpeed modifier makes them disappear for some reason. Setting the minimum floater lift to 0 doesn't help either.
The mod weights heavily on these ships working properly. Any help is apreciated
Re: making a ship sink faster
I think you already tried this.
ObjectTemplate.create FloatingBundle WillyNitroFloater
ObjectTemplate.setHullHeight 2.2
ObjectTemplate.setFloatMaxLift 6
ObjectTemplate.setFloatMinLift 6
ObjectTemplate.setSinkingSpeedMod 1
Did you try to "rem" it out?
You said it only made your ships tilt a little. Maybe there was a set of differently-named floaters? Some vehicles have two different floater templates.
ObjectTemplate.create FloatingBundle WillyNitroFloater
ObjectTemplate.setHullHeight 2.2
ObjectTemplate.setFloatMaxLift 6
ObjectTemplate.setFloatMinLift 6
ObjectTemplate.setSinkingSpeedMod 1
Did you try to "rem" it out?
You said it only made your ships tilt a little. Maybe there was a set of differently-named floaters? Some vehicles have two different floater templates.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Re: making a ship sink faster
this is what i have right now
i tried with and without the speedmod, with speedmods ranging from 1 to 300 with no luck
Code: Select all
rem *** Anatoray_Floater ***
ObjectTemplate.create FloatingBundle Anatoray_Floater_1
ObjectTemplate.setHullHeight 500
rem 260
ObjectTemplate.setFloatMaxLift 2
ObjectTemplate.setFloatMinLift 0
ObjectTemplate.SetSinkingSpeedMod 2
rem 15
rem *** Anatoray_Floater ***
ObjectTemplate.create FloatingBundle Anatoray_Floater_2
ObjectTemplate.setHullHeight 500
rem 260
ObjectTemplate.setFloatMaxLift 2
ObjectTemplate.setFloatMinLift 0
ObjectTemplate.SetSinkingSpeedMod 1
rem 4
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: making a ship sink faster
I recently had this issue with my boats not sinking in my BFH mod. I discovered that the boats will only sink if they have a chance to be in "critical damage". If you have a projectile set up to do enough damage to take the vehicle from healthy HP down to zero, then it will not sink. To fix this, increase the critical damage setting of your vehicle. (or add one if your vehicle doesn't have one). Make sure that no single hit can cause the vehicle to skip the critical range. Don't worry about instances where it's hit by more then one projectile. This only counts for a single hit. Even if two projectiles hit a vehicle it will always count one of the hits first and the critical damage can take effect. As soon as the vehicle hits critical, the floaters will finally let go and let it sink.
At that point it will sink according to your sink speed mod. Example code:
Code to enable critical damage for the host vehicle:
The critical damage setting is similar to how armor effects work. Set it to the HP count that your vehicle will be at before critical damage. For example, my boats have 600HP. I want critical damage to occur at 100HP, so I set it to 100. Note that this will effect your HP counter in the HUD. My boats for example have 600 HP, but the HUD will only report 500HP. Anything below 100 becomes negative. It does not effect when your vehicle dies (if you decide not to have the vehicle self destruct from critical damage), it's just a quirk in the HUD system. I only noticed it because my BFH mod had the addition of a number readout for the HP of soldiers and vehicles and noticed that it only shows the amount of HP the vehicle minus the HP in the critical range. So when it goes critical it would then show a negative number. But if your mod has no number read out for HP, then it won't matter much. Just know that your HP bar will hit zero faster if you use a higher critical damage number. But that won't mean your vehicle has less HP as a result, it just indicates the part when the vehicle will stop working. 
This code will effect how fast it will sink once it starts sinking: (this goes on the floater object)
It is a multiplier, so higher numbers mean faster sinking. 
You may not need to have the vehicle actually take damage from critical. You can set it to zero and it should still sink. As long as the "criticaldamage" value is set to something higher then the max damage any single projectile does to your vehicle can do, then it should sink. (also note that when in critical, rotational bundles will rotate slower and engines will stop working. Springs will also stop working. But since your ship is "falling" having control over it via engines is not expected as well...its falling out of control. That's the idea so it should work for you in this case)
I spent a good 2-3 hours of code tweaking with my boats before I discovered this behavior.
At that point it will sink according to your sink speed mod. Example code:
Code to enable critical damage for the host vehicle:
Code: Select all
ObjectTemplate.criticalDamage 100
ObjectTemplate.hpLostWhileCriticalDamage 20

This code will effect how fast it will sink once it starts sinking: (this goes on the floater object)
Code: Select all
ObjectTemplate.setSinkingSpeedMod 1

You may not need to have the vehicle actually take damage from critical. You can set it to zero and it should still sink. As long as the "criticaldamage" value is set to something higher then the max damage any single projectile does to your vehicle can do, then it should sink. (also note that when in critical, rotational bundles will rotate slower and engines will stop working. Springs will also stop working. But since your ship is "falling" having control over it via engines is not expected as well...its falling out of control. That's the idea so it should work for you in this case)
I spent a good 2-3 hours of code tweaking with my boats before I discovered this behavior.




I have cameras in your head!
Re: making a ship sink faster
For those airships it might even be a cool idea to use a relatively high criticaldamage and reduce the sinking speed a lot, basically making the descent very slow as one would except from a vessel of that size. Imagine only some of the many stabilizers got hit and the vessel just can't keep up the required uplift, so it starts "drifting/sinking" until it crashes. This might even work very well with the HPlostwhilecriticaldamage 0. Meaning it will start sinking and is out of control (=can no longer be steered and just is crashing), all gun systems are still online (but flawed, as rotation speed is slowed as well due to crit damage) but it won't lose health until it crashes to the ground, making for kind of an epic "Last Stand" of the battleship, allowing for at least some small try at revenge before you die. Go down in flames, bit of heroism and all that. 
EDIT: That's what instantly popped into my mind after reading Apache's explanation and rethinking the possibilites of critdamage...Anoter possibility you might consider is using attached PCOs to give the biggest battleships subsystems. As they are slowmoving (I assume), they "jiggling" and "lag" of attached PCOs shouldn't be visible/disturbing while it allows for far more possibilites. E.g. you could make individual gun systems or turret bays be individually destructible or add the engine to a sub-object, allowing for your engine to be "shot off" and things like that. I always dreamt of doing sth. like this but the only object so far which I had with these subsystems so far was a beta of the FHSW "Ratte" landcruiser that had all sub-turrets as individual PCOs that must be destroyed one by one (the vehicle itself was indestructible, even). I added the possibility to kill each track separatly (mines/explosives, lots of heavy gunfire) or even kill the engine. Those were some very fun "objective" maps in our campaign. One full team mans the Ratte (it had 16 positions to man, while the rest was running around inside the Ratte [yeah, it had internal hallways connecting most of the positions and providing a full internal combat zone should the other team manage to "board" the Ratte] trying to repair or provide close-quarter-defense which the Ratte sucks at) while the other tries to stop it from overrunning their base by use of airforce, tanks, and even ships. But all this only worked because the Ratte drives sth. about 3km/h top speed...and even then a slight jittering of the turrets was noticeable, but the very original gameplay was worth it
. On the other hand it required hours and hours of work to get that object that far...I think the Ratte alone has more lines of code than all Vanilla air vehicles combined.

EDIT: That's what instantly popped into my mind after reading Apache's explanation and rethinking the possibilites of critdamage...Anoter possibility you might consider is using attached PCOs to give the biggest battleships subsystems. As they are slowmoving (I assume), they "jiggling" and "lag" of attached PCOs shouldn't be visible/disturbing while it allows for far more possibilites. E.g. you could make individual gun systems or turret bays be individually destructible or add the engine to a sub-object, allowing for your engine to be "shot off" and things like that. I always dreamt of doing sth. like this but the only object so far which I had with these subsystems so far was a beta of the FHSW "Ratte" landcruiser that had all sub-turrets as individual PCOs that must be destroyed one by one (the vehicle itself was indestructible, even). I added the possibility to kill each track separatly (mines/explosives, lots of heavy gunfire) or even kill the engine. Those were some very fun "objective" maps in our campaign. One full team mans the Ratte (it had 16 positions to man, while the rest was running around inside the Ratte [yeah, it had internal hallways connecting most of the positions and providing a full internal combat zone should the other team manage to "board" the Ratte] trying to repair or provide close-quarter-defense which the Ratte sucks at) while the other tries to stop it from overrunning their base by use of airforce, tanks, and even ships. But all this only worked because the Ratte drives sth. about 3km/h top speed...and even then a slight jittering of the turrets was noticeable, but the very original gameplay was worth it

Re: making a ship sink faster
I tried apache's idea and i can confirm that the ship sinks while below critical HP (my original setup had critical HP of 0). I also moved the floaters from the complex bundle to the player control object as i read somewhere that it might cause problems otherwise.
The ships now "sink", but way too slow. Slow as in, it takes about 60 seconds to drop its own height, and about a full 10 minutes to drop to the ground. This is excesive as i need broken ships to leave the battle area as soon as they are disposed, to make room for others.
The problem is that the sinkspeedmodifier apparently does nothing. I tried ranges from 0 to 1.000 and it always falls at pretty much the same speed. I tried playing with the min / max float values and the number of floaters but no cigar.
the "last stand mode" is present, but you can hardly tell a broken ship from a normal one (except for a column of white smoke). I need my ships to drop 500 game units in 100 seconds top
The ships now "sink", but way too slow. Slow as in, it takes about 60 seconds to drop its own height, and about a full 10 minutes to drop to the ground. This is excesive as i need broken ships to leave the battle area as soon as they are disposed, to make room for others.
The problem is that the sinkspeedmodifier apparently does nothing. I tried ranges from 0 to 1.000 and it always falls at pretty much the same speed. I tried playing with the min / max float values and the number of floaters but no cigar.
the "last stand mode" is present, but you can hardly tell a broken ship from a normal one (except for a column of white smoke). I need my ships to drop 500 game units in 100 seconds top
Re: making a ship sink faster
Have you tried changing the "1.000" to "1000"?hipnox wrote:from 0 to 1.000
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Re: making a ship sink faster
my bad, i meant 1000. i wrote it in spanish (1.000 in spanish = 1,000 in english). so, yeah, i tried with 1000
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: making a ship sink faster
What's the mass of your ship? You may need to increase it. You can also decrease the drag on the PCO and floaters.
Drag setting for PCO showing default values:
Drag Modifier for Floaters:
Smaller numbers mean less drag. Drag modifier may have the most effect in this case.
Drag setting for PCO showing default values:
Code: Select all
ObjectTemplate.drag 1
Code: Select all
ObjectTemplate.setDragModifier 1



I have cameras in your head!
Re: making a ship sink faster
Drag on the ship is set to 0.125 (or whatever the default value is for the B17)
Mass on the ship is the default Prince of Wales (3500000000 something)
i tried with 0.01 drag but didn't help. Changing the mass seems to modify the floating height but didn't really see any effect on sinking speed.
i dunno. i'm running out of modifiers to tweak
maybe it just doesn't work
Mass on the ship is the default Prince of Wales (3500000000 something)
i tried with 0.01 drag but didn't help. Changing the mass seems to modify the floating height but didn't really see any effect on sinking speed.
i dunno. i'm running out of modifiers to tweak

maybe it just doesn't work