
Mods / Outgoing Damage Log
Author: DessertOverlord
Side: Server
Created: Mar 5th at 7:01 AM
Last modified: Mar 8th at 7:14 AM
Downloads: 231
Follow Unfollow 13
Latest file for
v1.20.4:
OutgoingDamageLog v1.1.1.zip
1-click install
WHAT DOES IT DO?
Made this in an evening because I was tired of not having a clue what weapons were actually any good in Combat Overhaul. The output will list what damage type it is (no, it's not localized, I don't know how to do that, sue me) NOW WITH LOCALIZATION! along with the amount (in full float precision, deal with it, rounding is for suckers) and to what creature the damage was done (probably doesn't work for players, honestly, didn't get to test it yet).
DOES IT WORK WITH COMBAT OVERHAUL? WHAT ABOUT THIS OTHER WEIRD MOD I INSTALLED?
Compatible with Combat Overhaul, both for melee and ranged weapons, including crossbows and firearms. Should be compatible with almost anything as long as they don't implement their damage code stupidly. Worst case it does nothing, so adding this shouldn't break anything.
WILL YOU DO X, Y, OR Z? (stuff i might do some day)
Some day I might make a config and add the option to see how much hp the enemy has remaining, but for now that's above my pay grade.
Another day I might figure out how on god's good green earth localization works and do that. Don't hold your breath. If you held your breath anyways, now you can exhale.
Some other day I want to add in some notification to the player that their attack was blocked (i.e., bellheads and nightmare bowtorn) or something of the sort.
Thanks for reading and have a cool day (unless it's Tuesday, in which case, have a mediocre day.)
Version | For Game version | Downloads | Release date | Changelog | Download | 1-click mod install* |
---|---|---|---|---|---|---|
v1.1.1 | 123 | Mar 8th at 7:14 AM | Show | OutgoingDamageLog v1.1.1.zip | Install now | |
v1.1.0 | 2 | Mar 8th at 7:04 AM | Show | OutgoingDamageLog v1.1.0.zip | Install now | |
v1.0.0 | 106 | Mar 5th at 7:08 AM | Show | OutgoingDamageLog.zip | Install now |
11 Comments (oldest first | newest first)
The update fixed the problem for me. Happy to help. :)
Yeah I got the server-main log error too, it also crashed my game. Thought it was a one-time thing so I didn't bother reporting it. Will update accordingly.
Kathanon
Thanks for the feedback, hopefully this new release solves the issues you mentioned. I've also cleaned up some of my lazy code and added localization thanks to your help!
goated
My server-main.log is filled with errors (see below) from this mod, to the point that the game closed with the message "Too many errors detected.".
The cause is that Vintagestory.GameContent.BlockDamageOnTouch.OnEntityCollide does not set DamageSource.CauseEntity, so dmgSource.CauseEntity.Class in your code generates a null pointer exception.
Changing it to dmgSource.CauseEntity?.Class should fix that issue.
Additionally, the call to SendMessage is after the end of the innermost if clause, which will cause similar errors whenever the cause is not a player.
I'm guessing that is a mistake, and that you meant to put it inside the inner if.
Exception:
[Error] Exception: Object reference not set to an instance of an object.
at OutgoingDamageLog.OutgoingDamageLogModSystem.OutgoingDamageLogPlayer(Entity __instance, DamageSource dmgSource, Single damage) in C:\Users\Heath\source\repos\OutgoingDamageLog\OutgoingDamageLog\OutgoingDamageLogModSystem.cs:line 32
at Vintagestory.GameContent.EntityBehaviorHealth.OnEntityReceiveDamage(DamageSource damageSource, Single& damage) in VSEssentials\Entity\Behavior\BehaviorHealth.cs:line 209
at Vintagestory.API.Common.Entities.Entity.ReceiveDamage(DamageSource damageSource, Single damage) in VintagestoryApi\Common\Entity\Entity.cs:line 851
at Vintagestory.GameContent.BlockDamageOnTouch.OnEntityCollide(IWorldAccessor world, Entity entity, BlockPos pos, BlockFacing facing, Vec3d collideSpeed, Boolean isImpact) in VSSurvivalMod\Block\BlockDamageOnTouch.cs:line 54
at Vintagestory.API.MathTools.CollisionTester.ApplyTerrainCollision(Entity entity, EntityPos entityPos, Single dtFactor, Vec3d& newPosition, Single stepHeight, Single yExtra) in VintagestoryApi\Math\CollisionTester.cs:line 197
at Vintagestory.GameContent.EntityBehaviorControlledPhysics.ApplyTests(EntityPos pos, EntityControls controls, Single dt, Boolean remote) in VSEssentials\Entity\Behavior\BehaviorControlledPhysics.cs:line 256
at Vintagestory.GameContent.EntityBehaviorControlledPhysics.OnPhysicsTick(Single dt) in VSEssentials\Entity\Behavior\BehaviorControlledPhysics.cs:line 491
at Vintagestory.Server.PhysicsManager.DoWork(Int32 threadNumber) in VintagestoryLib\Server\PhysicsManager.cs:line 592
Ket
It will work fine in vanilla. It was made for CO because CO has more complex mechanics for damage, but it will function fine in vanilla. Even if it doesn't work with how a mod is implemented, it shouldn't break anything.
Is this meant to be compatible with vanilla as well? If it's not it is a good idea to add combat overhaul as a dependency in the modinfo
Kathanon
Thanks for the input, I might see if I can add localization tonight and push out a new release. I also want to try adding configs and things like that to make it more tunable, as this mod is really designed for multiplayer servers.
DejFidOFF
No, this is strictly so a player can see how much damage they're dealing to an enemy they're hitting. It does not record that information anywhere in a file or in the server log beyond what Vanilla does.
Since you said you don't know how to do localization, here's how:
- Add a file assets\mod_id\lang\en.json, containing a json dict (the one in curly brackets).
- Populate it with with one key/value pair per string you want to localize, with both key and value being the English version of that string.
- Example: "some_string" : "some_string",
- Wherever you use the string in your code, replace "some_string" with Lang.Get("mod_id:some_string")
- If you want to insert a value into a string, then you add {0} in the string in en.json, and pass the value as the second parameter to Lang.Get.
- If you need several values, then use {1}, {2}, etc.
Replace mod_id and some_string with appropriate strings.
Technically the keys can be any string you want, but if there is no localization for the string in the active language, then it uses the key instead, so using the same string gives you English as default.
This is not to push you to localize it, I just want to help a fellow modder. :)
DessertOverlord
So how it works? When I put that on the server it will track and log of all players / entities damage?