Author Topic: Sinking in water instead of floating.  (Read 1363 times)

Self explanatory for the most. Could anybody spare a couple minutes to throw together a player-type, or maybe little script that will make the player sink instead of float in environment/brick water? I have no clue how to do it. And I'm not sure if it already exists.
Thanks.

pretty sure you can set density
looked on the forums and wheeled things have modifyable density
tested it ingame (echo(findClientByName("phflack").player.dataBlock.density); gives 0.7)
and looks like setting it to 5 drops me like a rock, and setting it to 0.1 launches me out of the water

you should be able to put that value into a playertype or edit it ingame as needed

edit: looks like water has a density of 1, so setting my density to 1 means I don't go up/down
and setting my density to 0 gave me a white screen, I don't think BL likes that (probably some divide by 0 while rendering? not sure)
« Last Edit: September 01, 2017, 07:11:17 PM by phflack »

wtf i had no clue there was a property for player density

I kind of remember a playertype using it, but I can't find it anymore
it might've just been maps set the water density differently, which would cause all players/vehicles to sink/float

Sad to say I wouldn't know how to make that into a functioning add-on. That's a useful command to know tho.

Have a playertype with the density stuff already in it. Can post it tomorrow.

make a folder in addons (ie Player_Sink)
make a description.txt (can be blank)
make a server.cs

Code: [Select]
datablock PlayerData(PlayerSinkArmor : PlayerStandardArmor)
{
density = x;
};
replace x with the desired density (ie 5) and put that in the server.cs

(just copied from the quake player, just putting the density in there should work, if you want to extend nojet use PlayerNoJet instead of PlayerStandardArmor)


The playertype worked, and so did the little things I added in. How do I prevent them from actually swimming back up to the surface?

The playertype worked, and so did the little things I added in. How do I prevent them from actually swimming back up to the surface?
probably increase density? if that doesnt work it would probably be better to use a gravity zone instead of water bricks

can disable jump with jumpForce = 0; (default 1080)
even with a density of 10000 you can still swim up with the default jump force (or even 1 jumpforce)