Barotrauma

Barotrauma

Barotrauma Workshop
You can build your own submarines and monsters with in-game editors and share your creations with other players. Imagine and experiment.
 This topic has been pinned, so it's probably important
Vihis  [developer] 27 Jan, 2023 @ 4:30am
Information for modders regarding the 0.21.6.0 update (1.0. Pre-patch)
Hello all mod makers!

The upcoming Barotrauma update will change some aspects of the status effect and poison systems. These changes will unfortunately cause issues with some existing mods, but we felt these improvements were important to make: the functionality of status effects has been lacking and inconsistent in many ways. Now they function more uniformly and predictably, hopefully making them nicer to use for existing and new mod makers alike.

To mitigate the inconvenience for authors of existing mods, we wanted to make sure to get these changes done before leaving early access. Below is a summary on what has changed and what to do to make mods compatible. After this rework, we aim not to make any mod-breaking changes to the game, so hopefully it will be the last time you need to fix your mods.

Status effect changes:

We've addressed various inconsistencies in how the status effects are used.

  • Firstly, there are changes to the targeting logic. Previously, status effects with the target type "Character" targeted either the user (e.g. of an item or an attack) or the target character inconsistently. The item components affected were Projectile and MeleeWeapon. Attack definitions also suffered from this issue.

    This is now changed so that in these contexts, "Character" always refers to the user and "UseTarget" refers to the target. So, if your mod uses the status effect target "Character" to refer to the target, change this to "UseTarget".

  • Status effects can now consistently target a character, an item, or a structure, depending on the context. This allows for example triggering effects when a melee weapon hits a wall.

  • In some cases we'll now need to introduce restrictions in the definitions. For example, using a conditional to check whether the target is of the right type before triggering the status effect (<Conditional entitytype="eq Character"/>).

  • The MeleeWeapon component has a new attribute, "HitOnlyCharacters". By enabling this, the weapon doesn't register hits to walls or items at all. So if you want to use different effects on different targets, use the status effect conditionals.

  • In addition, all the status effects treating "OnUse" as the success state (as the counterpart for "OnFailure"), should now use "OnSuccess" instead. "OnUse" still works, but it will always trigger regardless of the skill or item requirement checks. In addition, If no skill or item requirements are defined, both OnUse and OnSuccess will trigger. Also note that status effects of type "OnUse" now trigger when the projectile is launched, not when it hits the target. For the latter, use "OnImpact".

Poisons rework:

Our primary goal was to make the poisons work on monsters, to make the Medic a more combat-capable job and on the whole increase the effectiveness of poisons in combat.

Specifically for modders, we've reworked how the skills are gained from doing damage or healing.
  • Instead of only using the universal multipliers defined in the SkillSettings.xml, there are now two new attributes for the afflictions: "WeaponsSkillGain" and "MedicalSkillGain".
    These should be used for defining how much the weapons or the medical skill is increased when the affliction is applied. Both default to 0, so be sure to define them for your custom afflictions.

  • Consequently, applying organ damage, which is the main source of poison damage on monsters, now boosts the medical skill instead of weapons skill like it used to. And due to this, applying buffs now also increases the medical skill of the applier.

Again, we apologize for the inconvenience, but by making these changes your mods will be compatible with Barotrauma 1.0 once it releases, and you should not need to change them again for the foreseeable future. Happy modding!
Last edited by Vihis; 17 Feb, 2023 @ 5:14am
< >
Showing 1-8 of 8 comments
Lagmanor 10 27 Jan, 2023 @ 10:41am 
That's really great thing to know about in advance, thanks for the heads-up!
Lennic 27 Jan, 2023 @ 10:57am 
Awesome changes overal
Pulsarion 3 27 Jan, 2023 @ 7:48pm 
Will these changes actually allow my characters to increase Afflictions on themselves upon attacking something? I couldn't increase my "Evolution" Affliction when attacking, while I see the Husk healing itself in nearly the exact same way I am attempting to alter my status.
Vihis  [developer] 30 Jan, 2023 @ 3:19am 
Originally posted by Pulsarion:
Will these changes actually allow my characters to increase Afflictions on themselves upon attacking something? I couldn't increase my "Evolution" Affliction when attacking, while I see the Husk healing itself in nearly the exact same way I am attempting to alter my status.

Hi!
I asked a dev who worked with the status effect rework and here's what they said:

The current husk attack has this definition which reduces affliction:

<StatusEffect type="OnUse" target="This" disabledeltatime="true"> <ReduceAffliction type="damage" strength="5" /> </StatusEffect>

In it, "this" refers to the head of the husk, which it uses to attack. If it were "limb" it would be the target limb, if it was "UseTarget" it would be the target character and if it were "Character" it would target the husk itself.
So it should work if it was something like:

<StatusEffect type="OnUse" target="Character"> <Affliction type="evolution" strength="1" /> </StatusEffect>

Previously that would have targeted the "target" but now it should make the custom effect possible.

Hope this helps!
Shnorfpph 4 1 Feb, 2023 @ 1:16am 
Hello everyone! I've got small prob:
I wanted to make the knife that after hitting character few times it drops several items(in this case meats) depending on the species. I tried to make my own knife and then took some code from thalassophobia, but it still didn't worked. Any tips about it? I'll be very grateful!
Vihis  [developer] 2 Feb, 2023 @ 3:20am 
Originally posted by Свинцовый Ныряла:
Hello everyone! I've got small prob:
I wanted to make the knife that after hitting character few times it drops several items(in this case meats) depending on the species. I tried to make my own knife and then took some code from thalassophobia, but it still didn't worked. Any tips about it? I'll be very grateful!
Hi!
Unfortunately I don't know enough about modding to answer, but you could try making your own post about this issue on this forum, that way more people will see it. Or join our Discord server and ask for help in the #baro-modding -channel. Link to our discord server: https://discord.gg/undertow
Originally posted by Vihis:
Hello all mod makers!
Is it possible to add more animations to the game, Because I cant seem to be able to find an .xml file where I can add additional animations using the NotDefined tag? I have copy and pasted an animation file and renamed all the important parts and added NotDefined to the type of animation part and put it in the animation file, but it does nothing.
Last edited by TheRestartPrincess; 2 Jun, 2023 @ 5:37am
NothingSuS 8 Dec, 2023 @ 10:42pm 
Hello can you fix hostages because I have to stun them to get them in my sub and its annoying
< >
Showing 1-8 of 8 comments
Per page: 1530 50