#NT Thermal

256 messages · Page 1 of 1 (latest)

gilded flame
odd fable
#

This is really awesome, thank you.. Will the "Heater" item found throughout Outposts and certain Submarines finally see use with this mod, or will it remain purely decorative?

odd fable
#

Bug: Diving Suits don't check for the Condition of a Battery Cell slotted in; Dead Batteries will heat up suits.

odd fable
#

Bug: Someone was suffering from Pulmonary Embolism (Blood Clot in a Lung Artery), and it got to the point where their Lungs had to be replaced, so I removed them and installed Cyber Lungs in their place. Their Lung Arteries were still clotted with blood.

She had a fresh set of Lungs at this point, so this is physically impossible.

gilded flame
#

Alright they're almost fixed twin, just let me make sure I didn't break anything else.

gilded flame
#

If I did that would probably make any sub that initial Desu made incompatibile. lol but on a real note I think it will break most subs.

odd fable
gilded flame
#

For right now I just made blood clots low key easier and pulmonary embolism slightly less deadly, and also more forgiving.

#

Oh twin

#

I so misread your bug

#

I thought you were saying it was too hard to remove

#

I still nerfed it

#

Um. I'll make it so if the lung condition is higher than 50 it will remove the clot.

odd fable
# gilded flame Oh no btw, I didn't think of that.

Oh, huh. Temperature is a crucial element of Barotrauma's world-building; Everyone wears warm, layered clothing with gloves and boots, and Heaters are set up in certain places because the insulation they wear sometimes isn't enough.

With that said, I wish Temperature were an officially-supported gameplay mechanic. It should be.

odd fable
gilded flame
odd fable
gilded flame
#

We still need the pants slot more than temperature tho in vanilla.

#

🙏

odd fable
#

😄 Yes we do..

gilded flame
gilded flame
odd fable
odd fable
# gilded flame Updated the mod, let me know if you find anything else.

Oh, right. I forgot to tell you this before I left earlier today: The Bathhouse Outpost Module of Barotrauma contains a small room with water. It's implied that this is warm water to bathe and swim in, but I'm not sure how you'd make it mechanically-warm from your end.

Hungry Europans adds a #TestKitchen Submarine, which also contains a Pool. 🤷‍♂️This shouldn't be cold, freezing water either, but, again, I've no idea how you'd make it warm from your mod.

gilded flame
odd fable
#

Will mod developers be capable of easily adding Proximity Heat items? (A Campfire from a Survival mod, for instance.)

gilded flame
#

I mean, it's possible, just kind of inconvient from my understanding. I haven't done it. I believe mods such as Enhanced Reactors give heat by a xml range and affliction. In lua I could just get the distance between the player and item, I think.

odd fable
#

Well, just for the sake of performance, I'd recommend making it in XML. Neurotrauma is mainly Lua, and that's exactly why your FPS gets tanked down to 5-10 when large amounts of Humans are injured; All of them have afflictions with mod-related checks running every frame, therefore they are not subject to the recent Optimizations the Baro devs made to the Vanilla game.

#

Another thing: You should take a peek at the "Animated Arms: Adaptive Combat" mod. It uses Lua to add "Plate Slots" to certain Diving Suits (Combat Diving Suit and Slipsuit), allowing you to equip Body Armor Plates for ballistic protection.

Using this knowledge, you can do the same here, adding Battery Slots to Vanilla and Modded Diving Suits alike.

gilded flame
glass bluff
#

bro

#

the game is already hard enough in my modpack 💔

#

i am not adding temps and shi 😭

gilded flame
odd fable
# gilded flame Ooh, thanks for telling me, I'll take a look.

👍 Sure thing.

Is there a "Temp Display" to view my character's current temperature every frame/second, or will the Handheld Thermometer need to be used every time?

One of the reasons I bring this up is because Super Metroid: X-Fusion (2025) had a very unique feature for the Varia upgrade: Instead of giving your suit permanent immunity against cold and hot environments like other games have, a Temperature Display would show up, and you'd begin taking damage at -130° C / -202° F.

If it isn't a thing already, maybe you could add a similar feature to the more advanced suits, like the PUCS or the Exosuit; A display showing both your Internal Body Temperature, and your External Temperature.

gilded flame
#

You just gotta use the handheld thermometer.

odd fable
#

Alright. I'll bring it up again if I'm able to think of a way to get it working.

odd fable
#

Bug: Pulmonary Edema has the same issue as Pulmonary Embolism; Replacing Lungs does not remove it.

odd fable
#

Hopefully, Home & Harbor eases Organ Logic, so weird bugs like this are harder to replicate in the future.

gilded flame
odd fable
#

It's okay, I can wait. I'll need to head to bed in a few minutes anyway. (And yeah, I get it. I forget some pretty important things too..)

gilded flame
odd fable
#

I think the Temperature of characters should gradually drop if they aren't wearing any Innerwear item, and aren't around a heat source.

Implementation of this has to be done carefully, though. A custom Map won't always take place in a cold environment. Someone could make a scene that takes place during the Summer on Earth, for instance, or a really hot room like a Refinery.

So there needs to be a way for map designers to govern what areas are hot/cold. We can't assume every place is going to be cold, even if that's the case in Vanilla Barotrauma's world of Europa.

Maybe you could take inspiration from the "Tough as Nails" mod for Minecraft in some manner? Dynamically changing the Temp of a character depending on the environment they're in, the heat sources they're around, and the insulation/cooling they wear. It's possible to become too hot from clothing in that mod.

However, it will be difficult to control the heat of all clothing in this game, because there's no real distinction between Commoner Clothes and a Prisoner Jumpsuit.. The Baro devs would have to implement support for that themselves, for there to be the expectation for mod developers to make their clothing items temperature-compatible. (I know this because I wrote a Footsteps script, and I had to manually check if an Innerwear item had Sneakers, Boots or Formal Shoes. It's a pain, as I won't be able to account for every modded item out there.)

gilded flame
#

I was planning on adding a ship wide heater at one point but I ended up not.

#

The problem is that would cause all subs to be built with thermal in mind.

stuck tree
#

thatd b annoying

gilded flame
#

We need the pants

#

Literally unplayable without

stuck tree
#

slots not being hardcodes would be nice

gilded flame
#

What do you mean?

stuck tree
#

u cant add new kinds of slots in the human xml

#

smh

gilded flame
#

oh yeah

stuck tree
#

asking for a pants slot without knowing this

gilded flame
#

Still unplayable

stuck tree
#

itd would break literally every mod that adds clothing for no improvement in anything

gilded flame
#

It's needed though, part of the bigger picture.

#

🙏

stuck tree
#

of what?

gilded flame
#

The bigger picture

#

Nothing lol, just thought it would be kinda funny/neat lol.

stuck tree
#

adding skirts pup bet smh

#

most the outfits have the same pants but with different colors

#

BTW

gilded flame
#

Didn't know that.

odd fable
# gilded flame That's a really good idea, but I'm not too sure how I would add that.

I thought of a similar idea just now: A simple overlay applied to the screen, which will gradually fade to Light Blue or Bright Orange, depending on how cold/hot your character feels.

I often find it to be unbelievable when my currently-controlled character freezes to death, because they are in what I think is a warm room. If I see a light-blue overlay fading in, I'll know they're actually really freezing in that moment.

gilded flame
#

I'll do some more research.

odd fable
#

Oh awesome. Taking a peek at Hungry Europans might help, although it is not a script-based mod: When sleeping in beds, a black overlay will quickly cloud your character's vision.

gilded flame
#

Added it

#

Just lemme upload it

#

Fades in and out too

#

Uploaded, tell me what you think.

odd fable
#

Hm.. I can't seem to get wet any longer.

#

Maybe the Robotrauma compatibility has a bug somewhere?

Hm, okay, so it seems newly spawned characters cannot become wet, whereas the main Crew (Captain, Mechanic, Electrical Engineer, etc.) can.

While observing it from the Crew, however, I didn't find the effect to be strong enough on my end. I could finally begin seeing the overlay when my character went numb, which is too late of an indicator, but maybe I need to do more testing to verify.

gilded flame
# odd fable Hm.. I can't seem to get wet any longer.

I believe this is a NT issue, the mod itself only updates when certain afflictions are applied, which doesn't include any of my afflictions. Applying a human update should fix this issue. I.E placing a bandage, getting hurt so on so forth. I'll look into still tho.

gilded flame
odd fable
gilded flame
odd fable
# gilded flame I'll make the overlay a bit stronger.

I can see it now, but it's extremely subtle unless you're within a dark environment.

Maybe a slider in the Config would help make adjustment easier, but I don't know if you'd want (or have the time) to implement that.

odd fable
gilded flame
odd fable
#

Ah, okay. It should be an easy fix, then.

odd fable
#

Despite the PUCS being an Environmental Suit, the user still ends up passing out from being overheated within a room of fire, despite not being badly burnt. Is this intentional?

Another thing: I think NT's "Chilled" affliction, along with NT Thermal's "Wet" affliction, should lower your internal temperature ("Wet" already does this, I think), so you can prepare to enter a heated room to buy yourself some extra time within the flames.

(🙂 I can see the overlays very clearly now, by the way. Thank you.)

gilded flame
#

As for pucs, yes I know you can still overheat with it, it's not intentional. Once I get the damage modifer of the suit I can't figure out how to distuingish between the fire one and the others. Furthermore I can't even get the value of them.

gilded flame
gilded flame
#

Basically I can't get the resistance for burns from suits.

odd fable
# gilded flame As for pucs, yes I know you can still overheat with it, it's not intentional. On...

🫤 Ah, yeah.. I ran into a similar issue with an Armor script I wrote.. I had a function that detected how much Gunshot Wound an item reduces, but one day, it stopped working. I put a lot of time into that script, so I felt heartbroken over it for a while.

Here, in case it works for you:

local function GetGunshotReductionFactor(item)
    if not item or not item.Prefab then return nil end
    if not item.Prefab.ConfigElement then return nil end
    for element in item.Prefab.ConfigElement.Elements() do
        if element.Name.ToString() == "Wearable" then
            for child in element.Elements() do
                if child.Name.ToString() == "damagemodifier" then
                    local afflictions = string.lower(child.GetAttributeString("afflictionidentifiers") or "")
                    -- Ram-Shackled Debug Messages made in swift desperation.
                    print("[CT: Functional Armor] Checking armor:", item.Prefab.Identifier)
                    print("[CT: Functional Armor] afflictions list:", afflictions)
                    print("[CT: Functional Armor] matched gunshot:", afflictions:find("gunshot"))
                    if afflictions:find("gunshot") then
                        local multiplierString = child.GetAttributeString("damagemultiplier")
                        local multiplier = tonumber(multiplierString) or 1.0
                        return multiplier
                    end
                end
            end
        end
    end
    return nil
end

You'd just have to replace gunshot with burn, but, I don't know if this function even works to begin with. It doesn't for me any longer.

gilded flame
#

Lemme try pucs

#

Same with pucs

#

Burns must be stored somewhere else?

odd fable
#

Whoa.. That is weird.. It listed everything out except for Burn..

gilded flame
#

Stand by

#

Burn is considered a affliction type, so maybe that breaks it?

odd fable
#

Hopefully this is the discovery that fixes it.

gilded flame
#

🙏

gilded flame
#

You are the goat

#

I'll tweak it and implement it later

#

I'm only going to calculate it once tho on equip. Then store it in my own thermal data section thingy majigy.

#

Thank you.

#

What's your steam? I'll add you to the credits.

odd fable
gilded flame
#

Alright just gimme some time to add that and make sure it didn't cause twenty other issues.

#

local function BurnReductionFactor(item)
if not item or not item.Prefab then return nil end
if not item.Prefab.ConfigElement then return nil end
for element in item.Prefab.ConfigElement.Elements() do
if element.Name.ToString() == "Wearable" then
for child in element.Elements() do
if child.Name.ToString() == "damagemodifier" then
local afflictions = string.lower(child.GetAttributeString("afflictiontypes") or "")
-- Ram-Shackled Debug Messages made in swift desperation.
print("[CT: Functional Armor] Checking armor:", item.Prefab.Identifier)
print("[CT: Functional Armor] afflictions list:", afflictions)
print("[CT: Functional Armor] matched gunshot:", afflictions:find("burn"))
if afflictions:find("burn") then
local multiplierString = child.GetAttributeString("damagemultiplier")
local multiplier = tonumber(multiplierString) or 1.0
return multiplier
end
end
end
end
end
return nil
end

#

Here it is btw

#

I just changed the list to use 'afflictiontypes'.

#

Idk if this will fix your issue tho.

odd fable
#

Hm, yeah, if this is running correctly, then the function itself was not the culprit.. Thanks, though. This may be helpful in the future.

gilded flame
#

Lol thats funny, it returns (1 - resistance)

#

So pucs returns .1

#

diving suit .75

gilded flame
#

I don't know why I'm getting that error.

#

It wasn't occurring earlier.

#

nvm lmao

#

I removed the "local afflictions = string.lower(child.GetAttributeString("afflictionidentifiers") or "")" on accident

#

Ignore this

gilded flame
#

It's not a complete immunity, just a very large chunk of resistance.

odd fable
gilded flame
#

Also I added compatibility with enhanced reactors built in, idk if you want to test that or not.

odd fable
odd fable
gilded flame
#

My bad gang, let me just finish this assignment really quick.

#

This is why you error handle.

#

Don't be like me lol.

gilded flame
#

I think I narrowed down the issue

gilded flame
odd fable
# gilded flame Don't be like me lol.

You seem like you've got a lot of school to do, so it makes sense with your circumstances. (..But yes, it's important to put updates off until you can thoroughly stress-test them.)

gilded flame
#

I can't recreate it btw.

odd fable
odd fable
gilded flame
#

I think whats happening is that you have some mod overriding the pucs identifer? So the identifier I have in code is different from the index? Or of the sorts.

#

Whats the mod list?

#

If I may.

odd fable
gilded flame
#

Yep

#

Got it

#

Just put it below Thermal for right now.

#

I'll fix it.

#

My bad

odd fable
# gilded flame I'll fix it.

Well, I think the proper fix is to add a Battery Slot through Lua. I'll look into how Animated Arms does it, and come back with (hopefully) working code.

odd fable
gilded flame
#

Ah I see

#

I fixed it, I'm just really silly.

#

I never checked if the variant existed.

#

So it just tried to do "".HasTag()

#

Which obviously doesn't exist.

#

Whoops.

#

Now let me see how the gun mod you said does it.

#

Thank you for reporting.

#

Alright I uploaded it.

#

This gun mod is so damn high quality.

#

Thank you for showing me this lol.

#

I gotta add this to my campaign.

odd fable
#

🫤 What a mess that mod is.. He just shoved everything into the main directory of his project..

I don't know if you were able to find it yet, but the Slipsuit has a Ballistic Plate Slot, and the item wasn't overriden to have an ItemContainer component, so it has to be done with Lua, but.. 🤷🏻‍♂️where?

Regardless, though, yeah, it is certainly a must-have for this game. It fills in Barotrauma's lack of combative depth.

gilded flame
#

Wow

#

You were not being harsh enough lol.

odd fable
gilded flame
odd fable
#

Yeah. The following items have a Ballistic Plate Slot:

  • Light Body Armor
  • Medic Body Armor
  • Body Armor
  • Heavy Body Armor
  • Combat Diving Suit
  • Slipsuit (<- This seems to be the only one without an ItemContainer, so it's given a slot through scripting.)
odd fable
#

Bug: The Hazmat Suit of Enhanced Reactors is not insulated against Water.

gilded flame
#

Although the more I think about it the less it makes sense.

#

I'll fix it rn.

gilded flame
odd fable
#

Hm.. You update your mod extremely often. It's making me think I should do the same.

The people who use one of my mods have been waiting nearly 3 months for an update now. It's a big update that fixes, improves and adds a lot, but still, 3 months is a long time to wait..

Should I, or would that be unwise, given the focus of the project? Maybe the focus doesn't actually matter, though.. Maybe updating a project weekly is simply the courteous thing to do.

gilded flame
odd fable
#

That's true.. And I don't have all the time in the world to get everything done right away either.

#

Hey, what power do map designers have with hot/cold areas? Would I be able to make a room super hot or super cold yet? Or would you need to create an item that sets a Hull's temperature to the entered amount?

By the way, could you add a temp command that sets the temperature of a client's Character? It can be done sort of like this:

Game.AddCommand("temp", "Sets your character's temperature.", function(args, client)
    local character = client and client.Character or Character.Controlled
    if not character then return end
    local temp = args[1]
    --Set Temperature here.
end,nil,true)
gilded flame
#

I'll add those items in a update later.

gilded flame
odd fable
gilded flame
#

Wow discord just slammed all the code to the right of the text file.

gilded flame
odd fable
#

🙂 Awesome, that's perfect. Thank you.

odd fable
#

@gilded flame Ydrec wrote this to show me how to display numbers on a client's screen. You can reference this in the making of a dynamic Temperature Meter for advanced suits. Maybe you could display the meter when holding the Handheld Thermometer, at the cost of its Battery.

gilded flame
odd fable
odd fable
#

Got a rough version working. I'll polish it up some more with dynamic text color and then send the code here.

gilded flame
#

I just gotta think of a way that it will work.

#

Maybe a upgrade for the thermometer?

#

Or healthscanner.

odd fable
#

Hm, yeah.. Maybe an upgrade involving both items would be best.

I think the PUCS should definitely display both Internal Temperature, and External Temperature (Suit Temperature), but I've no idea how the latter works yet. I'm not sure if you added a "Comfort Range" to suits, or simply gave Temperature Resistance to all suits that reduce Burn.

gilded flame
odd fable
#

Well, hopefully Suit Temperature can be displayed as well. It would be really cool to see that your Internal Temperature doesn't change until the Suit Temperature of your PUCS reaches 578°C or so.

gilded flame
odd fable
#

🫤 Hm.. There's this weird bug I'm having trouble with.. The display doesn't go away unless you are no longer controlling a character.

odd fable
#

Alright, that weird bug is still in, but aside from that, it's functional. So far, it features:

  • Internal Temperature Display in both Celcius and Fahrenheight.
  • Dynamic, Gradually-Changing Display Color (Cyan for cold, White for normal, Red for hot.)
LuaUserData.RegisterType('Barotrauma.CharacterHUD') 
CharacterHUD = LuaUserData.CreateStatic('Barotrauma.CharacterHUD')
local textblock = nil
Hook.Patch('NTThermal.TempHUD','Barotrauma.CharacterHUD', 'Update', function (instance, ptable)
    local character = ptable["character"]
    if not character then return end
    local temp = character.CharacterHealth:GetAffliction("temperature")
    local tempC = temp and temp.Strength -1 or 0
    local tempF = tempC * 9/5 + 32
    if not textblock then
        textblock = GUI.TextBlock(GUI.RectTransform(Vector2(0.1, 0.2), CharacterHUD.HUDFrame.RectTransform, GUI.Anchor.CenterRight), 'text', Color.White, GUI.Style.LargeFont, GUI.Alignment.Right, false, 'GUITextBox', Color.Blue)
    end
    textblock.Text = string.format("%.1f°C / %.1f°F", tempC, tempF)
    if math.abs(tempC - 37) < 0.25 then textblock.TextColor = Color.White
    else textblock.TextColor = Color.Lerp(Color.Cyan, Color.Red, math.min(1, math.max(0, (tempC - 30) / 15))) end
end, Hook.HookMethodType.After)
gilded flame
odd fable
gilded flame
#

I think I'll add that to the PUCS, a temperature headset and the thermometer when scanning a patient or something along those lines.

#

Pucs for sure

#

Maybe even thermometer goggles? So walking past someone displays the temp above there head.

#

However that would require me to convert global positions of heads to screen position.

#

Which isn't too hard I think.

odd fable
#

Hm.. Maybe this behavior should be added to Vanilla Baro's Thermal Goggles? They already show the Heat Signatures of other characters, after all.

gilded flame
#

I wonder if I could edit the thermal overlay? Like make them blue if cold and vice versa.

odd fable
#

I think this feature will need extensive testing. I'm certain it's possible to add this display to the PUCS, but what happens when you remove the suit?

🤷🏻‍♂️I don't know how I'd make it go away. The display might just stay there..

odd fable
gilded flame
#

It's just for biological activity.

#

I think

odd fable
#

If that's true.. then they should have made it more realistic.

odd fable
#

Bug: Even when you're very far away from a heat source (such as Fire), your Temperature will rise as if you're close to it. This is easily noticeable with the ERC Donjon mod, where you are given a large, open world to explore.

gilded flame
#

I'll fix it tomorrow.

#

I'll also add a config for heat transfer to be safe.

#

I'm just a lil busy right now with this homework.

#

I'm just 102 off of the max combinations. I'm addicted.

odd fable
#

Well, I think it can wait. This is a non-critical bug, as you'd only ever encounter it in very unique scenarios. (I'm sure you have a ton of work to do anyway.)

gilded flame
#

I'll have to devise a better plan on how heat works later.

odd fable
#

You may want to add a "Thermal Blanket" wearable item.

gilded flame
#

I haven't actually got to adding it tho.