[0.7.0.1] Barotrauma Server Modification

A place to show off your mods and discuss modding Barotrauma.
User avatar
nilanthanimosus
Dr. Bright's Assistant
Posts: 26
Joined: Thu Aug 10, 2017 6:48 pm

Re: [0.6.1.4] Barotrauma Server Modification

Postby nilanthanimosus » Wed Nov 08, 2017 7:56 am

Alright got another update for everybody which adds a series of cool features, been a little busy and not kept full track so I may have missed some things!

Some bug fixes and hopefully less crashes.

Added missing Stun bar to the new character HUD information.

Added ability for clients to reconnect to the server and it's configurable, they are stunned and will take their original pre-disconnect stun + a configurable stun timer on rejoin, but will be granted their character back if they are still alive.

Added new refinements to vote kick mechanics, it can now (Differently for admin and vote kicks) prevent rejoins for a duration and announce a rejoin of a recently kicked player for a timer, I have defaulted these to 10 minutes announcement for votekick with a 1 minute rejoin timer while admins have a 2 minute announce with 20 second rejoin timer (Given this is generally used as a warning method), kicks do not allow clients to control their previous body.

Added a new Freeze click command and console command, Freeze denies a player the ability to do anything whatsoever (items/gui and movement controls/buttons etc) more or less except talk. this also works on the AI and disables them accordingly, finally it is possible to mass-freeze and kill all creature and player movement and operation on the server. (But take care they don't crash and die because you paused say, their driving captain or force some poor player to drown).

New default settings to pre-disable Particles / Lights and line of sight.

Ability to modify the behavior of fires and electrical items plus adding in new fire syncing (Before this wasn't synced) if you wish to change fires I recommend using that too - as a note the "Armoursoakfiredamage" is more of a bugfix and recommended to be false, fireproof removes fire damage but armour accidentally absorbed it completely as well but is left in so you may return the old behaviour.

Ability to increase sturdyness of none-broken engines and junction/relays by adding a configurable health regeneration to them, recommend small values naturally unless you want immortal subs.



Added an optimization you may toggle that can reduce server lag with numerous status effects that occur over time, this will be good for modified XML servers and have no harm or changes on game play, it may also help slightly during some hefty chaos such as mass drownings.

A few new values related to toggling the HUD and room information

the new values in the settings file:
Spoiler
ShowRoomInfo
UseUpdatedCharHUD
UseCreatureZoomBoost
CreatureZoomMultiplier
VoteKickStateNameTimer
VoteKickDenyRejoinTimer
AdminKickStateNameTimer
AdminKickDenyRejoinTimer
KickStateNameTimerIncreaseOnRejoin
KickMaxStateNameTimer
ClearKickStateNameOnRejoin
ClearKicksOnRoundStart

UseCharStatOptimisation

DisableParticlesOnStart
DisableLightsOnStart
DisableLOSOnStart
AllowReconnect
ReconnectAddStun
ReconnectTimeAllowed

ArmourSoakFireDamage

PlayerCrushDepthInHull
PlayerCrushDepthOutsideHull
SyncFireSizeChange
FireSyncFrequency
FireSizeChangeToSync
FireProofDamagePercentReduction
FireProofRangePercentReduction
FireCharDamageMultiplier
FireCharRangeMultiplier
FireItemRangeMultiplier
FireUseRangedDamage
FireRangedDamageStrength
FireRangedDamageMinMultiplier
FireRangedDamageMaxMultiplier
FireOxygenConsumption
FireGrowthSpeed
FireShrinkSpeed
FireWaterExtinguishMultiplier
FireToolExtinguishMultiplier
EnginesRegenerateCondition
EnginesRegenAmount
ElectricalRegenerateCondition
ElectricalRegenAmount
ElectricalOverloadDamage
ElectricalOverloadMinPower
ElectricalOverloadVoltRangeMin
ElectricalOverloadVoltRangeMax
ElectricalOverloadFiresChance
ElectricalFailMaxVoltage
ElectricalFailStunTime
Host of ARS (A Random Server)

User avatar
nilanthanimosus
Dr. Bright's Assistant
Posts: 26
Joined: Thu Aug 10, 2017 6:48 pm

Re: [0.6.1.4] Barotrauma Server Modification

Postby nilanthanimosus » Thu Nov 09, 2017 9:38 pm

Made a few blunders and added a few bugs :shock: , I have spent the last 1-2 days restlessly fixing the silly things. :laugh:

Now it should perform as expected, assuming anybody updated to the latest copy, Always check the time stamp of the copy and perhaps keep the previous as a backup. Whichever is the later date and high update # of that date is going to be more up to date code.
Host of ARS (A Random Server)

Brian Blessed
Class-D
Posts: 4
Joined: Sun Nov 19, 2017 2:37 pm

Re: [0.6.1.4] Barotrauma Server Modification

Postby Brian Blessed » Sun Nov 19, 2017 2:39 pm

I got a question, when you try to control a client it refers to a pop-up menu, Can you show me how to reach the menu as I can't find it B.

User avatar
nilanthanimosus
Dr. Bright's Assistant
Posts: 26
Joined: Thu Aug 10, 2017 6:48 pm

Re: [0.6.1.4] Barotrauma Server Modification

Postby nilanthanimosus » Fri Nov 24, 2017 1:17 am

I'm not sure what the question is exactly, or if what your asking about actually exists.

It is not possible to control another clients (Another players) character as the server, and there is even code in place in default Barotrauma that I've kept in place explicitly to prevent this.

There are no menus to control characters either, only a menu to spawn characters via the top right HUD. Control is still through the debug console exactly how you would with the original game (F3 -> Control character name #)

Setting the control of another player (changing a clients character) is done with setclientcharacter Capitalized client name ; None capitalized creature name #

But no menu exists in my mod yet for that either. I have an idea on how to go about it but was thinking of waiting until the next or a few versions later before perhaps looking further into those GUI menu features.
Host of ARS (A Random Server)

Brian Blessed
Class-D
Posts: 4
Joined: Sun Nov 19, 2017 2:37 pm

Re: [0.6.1.4] Barotrauma Server Modification

Postby Brian Blessed » Sat Nov 25, 2017 1:18 pm

Let me explain a bit more, I was asking about trying to make someone else a certain character like a husk and with that command you provided me answered my question, thanks.

https://cdn.discordapp.com/attachments/ ... nknown.png

Can you tell me how to set that one up as I wan't to try to play on my own server without it branding me with the server name.
This looks very noob-friendly but I can't figure it out xd.

Utmanarn
Dr. Bright's Assistant
Posts: 18
Joined: Sun Jul 23, 2017 8:51 pm

Re: [0.6.1.4] Barotrauma Server Modification

Postby Utmanarn » Wed Nov 29, 2017 10:25 am

Hello! I must say im verry happy that you created this mod! It is verry helpfull to me as a server Host. But I have one question.
Can you mid round enable/disable respawning?
If yes then how?
If no can you add that option maybe?
Thank you for this great mod!
Host of the Barotrauma server RP Dedicated Server. Because why not? Remember kids you have a radio r;

Utmanarn
Dr. Bright's Assistant
Posts: 18
Joined: Sun Jul 23, 2017 8:51 pm

Re: [0.6.1.4] Barotrauma Server Modification

Postby Utmanarn » Wed Nov 29, 2017 10:38 am

Brian Blessed wrote:Let me explain a bit more, I was asking about trying to make someone else a certain character like a husk and with that command you provided me answered my question, thanks.

https://cdn.discordapp.com/attachments/ ... nknown.png

Can you tell me how to set that one up as I wan't to try to play on my own server without it branding me with the server name.
This looks very noob-friendly but I can't figure it out xd.

Hello I have seen that option! You go to the bottom of the .xml file and between the "" (I made them bigger so it's easier to see) you add the name you want!

More detailed: You go down close to the bottom in the mod edditing .xml file (same file you found that text in green https://cdn.discordapp.com/attachments/379136942882947084/383968237051969546/unknown.png) and there should be an option in red named something abaout the PlayYorselfName: or something... (Not at home right now so I can't check) and in thoes "(Here you add name. This text wont be here it will just be blank!!)" you just put your desired name!

I hope this is to some help.
Host of the Barotrauma server RP Dedicated Server. Because why not? Remember kids you have a radio r;

Utmanarn
Dr. Bright's Assistant
Posts: 18
Joined: Sun Jul 23, 2017 8:51 pm

Re: [0.6.1.4] Barotrauma Server Modification

Postby Utmanarn » Wed Nov 29, 2017 5:06 pm

Might I come with a suggestion?
Being able to edit players while playing!
Example. Add commands to infect with husk/cure husk and set what type of chemical is in blood and how much.
Host of the Barotrauma server RP Dedicated Server. Because why not? Remember kids you have a radio r;

User avatar
nilanthanimosus
Dr. Bright's Assistant
Posts: 26
Joined: Thu Aug 10, 2017 6:48 pm

Re: [0.6.1.4] Barotrauma Server Modification

Postby nilanthanimosus » Wed Nov 29, 2017 9:39 pm

You need to scroll down the options, it should be much closer to the bottom of the file - if its wrapping and hard to read I also recommend using something like Notepad++

The settings need to go under their respective categories, which is populated for you (And ones that do not exist are also automatically removed). new items are added retroactively too while settings that do not exist are removed.

The <!-- --> lines at the top of the file are actually comments, I never did fully write it out but was essentially a guide in far earlier versions detailing what did what and how to go about it.

settings that are blank, are just two quotes, as Utmanarn stated you just insert the name between the two "" so it looks like:
PlayYourselfName="Bob"

Don't make it too long / daft however. I have yet to sanity check every case.

If you cannot mid-round disable respawning via the normal game options (the button is in one of the pages using the arrows on the top right of the GUI) I don't think its something that is easily possible, if respawning is possible and the timers are sent before the game starts in the initial sync. Of course I'm sure I could add code to kill existing respawns though I already have plans to enabled limited respawn mechanics (Such as a max count of shuttles and max count of new respawned players). Sadly I would like methods to allow those who lost their body / never got into a round the ability to vote end.

its not possible to add respawning to a round that did not have respawning (The shuttle is not loaded) without client editing or always telling clients it is enabled even when its not (Which would add quite a lot of items unnecessarilly). of course it wouldn't be hard to have methods to disable mid round respawning.

It may be possible to begin husk infections via commands, it is already possible to remove husk infections (The heal command has been modified to remove husk now as well if it is not maxed). it is not possible to remove a maxed husk infection or modify the time of the infection (Cannot be slowed or easily set), it is a value that can desync as the client locally measures its own time and attaches the husk parts client side, and then denies any update to the variable and has no method to remove it.

It is most definitely not possible to edit (Or even remove as far as I can tell) status effects on a per-player basis, and drugs administer an effect - not a quantity. IE, Erythrozine (Blue drug) grants the effect:

<StatusEffect type="OnUse" target="Character" Health="-0.3" Oxygen="2.0" duration="10">

Which translates to "For 10 seconds, give 2 points of oxygen and deduct 0.3 points of health per second" - I cannot remove or edit these (I would have to remove all status effects across the entire server at best due to the way it is setup generically using co-routines).

The rest of player editing I can think of (Job, skills, name etc) would not sync and have buggy/unintended behaviour (Such as can fix server side, but they cant tell the server they clicked the button as the client believes it cannot), and could only take effect the next respawn.
Host of ARS (A Random Server)

Utmanarn
Dr. Bright's Assistant
Posts: 18
Joined: Sun Jul 23, 2017 8:51 pm

Re: [0.6.1.4] Barotrauma Server Modification

Postby Utmanarn » Thu Nov 30, 2017 1:04 am

nilanthanimosus wrote:You need to scroll down the options, it should be much closer to the bottom of the file - if its wrapping and hard to read I also recommend using something like Notepad++

The settings need to go under their respective categories, which is populated for you (And ones that do not exist are also automatically removed). new items are added retroactively too while settings that do not exist are removed.

The <!-- --> lines at the top of the file are actually comments, I never did fully write it out but was essentially a guide in far earlier versions detailing what did what and how to go about it.

settings that are blank, are just two quotes, as Utmanarn stated you just insert the name between the two "" so it looks like:
PlayYourselfName="Bob"

Don't make it too long / daft however. I have yet to sanity check every case.

If you cannot mid-round disable respawning via the normal game options (the button is in one of the pages using the arrows on the top right of the GUI) I don't think its something that is easily possible, if respawning is possible and the timers are sent before the game starts in the initial sync. Of course I'm sure I could add code to kill existing respawns though I already have plans to enabled limited respawn mechanics (Such as a max count of shuttles and max count of new respawned players). Sadly I would like methods to allow those who lost their body / never got into a round the ability to vote end.

its not possible to add respawning to a round that did not have respawning (The shuttle is not loaded) without client editing or always telling clients it is enabled even when its not (Which would add quite a lot of items unnecessarilly). of course it wouldn't be hard to have methods to disable mid round respawning.

It may be possible to begin husk infections via commands, it is already possible to remove husk infections (The heal command has been modified to remove husk now as well if it is not maxed). it is not possible to remove a maxed husk infection or modify the time of the infection (Cannot be slowed or easily set), it is a value that can desync as the client locally measures its own time and attaches the husk parts client side, and then denies any update to the variable and has no method to remove it.

It is most definitely not possible to edit (Or even remove as far as I can tell) status effects on a per-player basis, and drugs administer an effect - not a quantity. IE, Erythrozine (Blue drug) grants the effect:

<StatusEffect type="OnUse" target="Character" Health="-0.3" Oxygen="2.0" duration="10">

Which translates to "For 10 seconds, give 2 points of oxygen and deduct 0.3 points of health per second" - I cannot remove or edit these (I would have to remove all status effects across the entire server at best due to the way it is setup generically using co-routines).

The rest of player editing I can think of (Job, skills, name etc) would not sync and have buggy/unintended behaviour (Such as can fix server side, but they cant tell the server they clicked the button as the client believes it cannot), and could only take effect the next respawn.

Thank you for all your comments. You cleared up a lot of things!
The most important thing I would want is the ability to enable/disable respawning mid round. And if you could, make it so that once you disable you can the enable it again. If you don't intend on using respawning then maybe the option in server settings is to help? It makes it so that the shuttle is spawned or not and can save that unnecessary items.

To clarify im not saying that you should spawn the shuttle mid round, but that you can if you had it enabled disable it mid round and then maybe enable it again.
Host of the Barotrauma server RP Dedicated Server. Because why not? Remember kids you have a radio r;


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 1 guest