Heat/Cold Metabolism Damage does not work

Hi Folks,

regardless of whether I set "Allow Cold Metabolism Damage" (or Heat) to true/false, I do not get these "attack-types". It works so far, that it hurts the player when it's wet in cold biome, a "to cold -20°C" is shown and health goes down. But a trace shows it only gets an "unknown hurt".

[2026-01-25 19:20:26]
======================
== STARTING TRACE ==
== 19:20:26.12874 ==
======================
From: Unknown_Weapon, Unknown_Prefab
To: BasePlayer, player
No exclusion found - looking up RuleSet...
Using RuleSet "default"
Initiator is hurt trigger; allow and return

I also tried to put a trace/log-statement right at the beginning of the "HandleMetabolismDamage" methode and checked the damageType variable. It's never DamageType.Cold or DamageType.Hot, so the method returns DamageResult.None right away without further processing.

Do I missing something, or does the metabolism-mechanism not work the way I think?

Greetings

hi, Ill look into it. if the damage type isn't heat or cold then a plugin could be the problem though. what does the trace say it is if not cold or heat?

on first line of HandleMetabolismDamage (this will output to server console):
if (victim.IsAdmin) Puts("Metabolism: {0} {1} to {2}", damageAmount, damageType, victim);

Okay, it works now and DamageType Cold/Heat are used. Seems that a reload of the Module is not always enough after changing the config. Also carbon does not always recognizes a change in the source (no automatic recompiling und reloading). After changes I often see this in the logs:

Failed to call internal hook 'OnEntityTakeDamage' on plugin 'TruePVE v2.3.5' [952055589] (Object reference not set to an instance of an object)
at bool Oxide.Plugins.TruePVE.AllowDamage(BaseEntity entity, HitInfo info) in C:/rust/Server-bak1/carbon/plugins/TruePVE.cs:line 1719
at object Oxide.Plugins.TruePVE.OnEntityTakeDamage(BaseEntity entity, HitInfo info) in C:/rust/Server-bak1/carbon/plugins/TruePVE.cs:line 1361
at object Oxide.Plugins.TruePVE.InternalCallHook(uint hook, object[] args) in TruePVE.cs/Internal:line 877

But it works after a complete restart of the rust-server.

So thanks for your help and sorry for bothering you. If you want to fix the reload-problem and need more information just tell me.

hi, glad you sorted it, but the reload and config issues aren't plugin issues. those are issues are with your hosts web panel, a caching issue with your browser, or Carbon (unlikely). such issues are common.

if your changes don't apply, then they were not saved even if it appears that they were.

  • if the config isn't saved, then changes will not be applied.
  • if the source isn't saved, then Carbon will not reload the plugin.
I can add a null check to line 877 for the error, but it's not going to fix anything.

follow these simple steps in your browser
  1. press CTRL+F5 to hard refresh the webpage you're editing from,
  2. apply your changes to the config or source again,
  3. save the file and
  4. manually reload the plugin if necessary
    Carbon users: c.reload TruePVE
    Oxide users: o.reload TruePVE

Hi nivex,
thanks for your detailed answer. I'm not using any game hoster. The rust testserver is running local on my workstation on Windows. The public rust server is running on a dedicated linux server at a data center managed by me via ssh/console. I installed rust and carbon on the comand line and edit files this way also. I do linux server administration for the living.  ;-)

But while used to c++/java/etc. , I'm new to c# and the way of hot patching functions and rust plugins. Sometimes I'm unsure what should work and what shouldn't.Thanks for clarifying.

The problem with the unreferenced Object originated from your quick hack to check the damage type on first line of HandleMetabolismDamage.

if (victim.IsAdmin) Puts("Metabolism: {0} {1} to {2}", damageAmount, damageType, victim);

At this Point victim is sometime null because of a "Generic" damage type with no victim. a simple if (victim != null && victim.IsAdmin) ... 
does the trick.

Thanks for your help so far.

gotcha. these are not web browser or web panel issues then. for anyone else using a web panel, refresh (or hard refresh) the web page and try again. if it still doesn't work then the option is broken.

TLDR; the metabolism option broke in a Rust update. wait for the next update.

if anyone wants to understand or learn about what's going on, then continue reading. I don't mind explaining, and I think it's important that people understand these things. running a server is fun, but so is understanding how everything works, including how to reload plugins with minimal downtime.

  • changes to the config were applied. it made no difference because that option was broken by a Rust update. HandleMetabolismDamage exits early at damageAmount > threshold 
  • the hurt trigger output in your trace is due to that issue. if the metabolism option worked correctly then metabolism would be shown in the trace instead. so why exactly does it show hurt trigger? because they use the same damage type, and the game does not pass any identifiers to distinguish them apart other than the damage amount itself. this is why the output shows "Unknown_Weapon, Unknown_Prefab" because both  the initiator and the weapon prefab are null.
  • the plugin should not reload itself after a source edit. that's handled by Carbon and Oxide. use c.reload TruePVE (and Oxide users can use o.reload TruePVE) if the plugin is not automatically reloaded.
if the plugin does not reload after using the reload command then a server restart is generally not required. a server restart will cause unwanted downtime and disrupt the players gaming session. rarely is it necessary to restart the server for a plugin unless a plugin is crippling the server or required in the plugins documentation. if you want to avoid a server restart then follow the below steps.
  1. move TruePVE.cs outside of the plugins folder
  2. c.unload TruePVE (Oxide users can type o.unload TruePVE) to ensure the plugin is unloaded. do not skip this step.
  3. usually you can skip this, but sometimes it's required to change the files hash even if it was just changed.
    it's very easy to do this.
    open TruePVE.cs
    go to line 22
    change "nivex" to "pizza" for example
    and save the file.
  4. move TruePVE.cs back into the plugins folder
  5. reload the plugin if Carbon/Oxide is still being stubborn and doesn't load it for you.
if you still cannot get the plugin to reload then you can restart the server. something is seriously wrong with it at that point.

Hey,

now that I'm a bit more familiar with the plugin system, reloading and making configuration changes is working really well for me.Thanks again for the explanations.

I took another quick look at HandleMetabolismDamage while my character was sitting in the snowy area.
It's receiving various values, with and without a player object, but I'm not sure what the correct/vanilla way to convert these into damage would be.

I also don't understand what you're calculating with the server ticks/threathold there.
I hope it can be fixed eventually so that we get the same result as on a vanilla server.

Cheers