Page 1 of 1

Anti Combat Logging System [anticombatlog]

Posted: Thu Apr 26, 2018 17:26
by sparky
This is a mod that is good for pvp servers where players often log off when they are being killed by another player, in order to avoid losing items, or to avoid any other negative aspects of dying. Also known as "Combat Logging"

Image
(a player entering combat with a rifle)

How it works:
When a player punches another player, both players are in combat for a set time. (default 15 seconds)
A double swords icon will show up on each player's screen, indicating they are in combat, as shown in the pic.

if a player leaves while in combat, a "ghost" entity will be spawned, and remain until it has been 15 seconds since the last hit was taken or given.

The ghost has the same hp and armor values as the player did. Kill the ghost object to have all of their items drop.
when the combat logging player comes on next they will loose all their items and die.

if the player logs back on before the ghost disappears, the player will be whatever HP the ghost is, and will be in combat until the ghost would have otherwise disappeared. (15 seconds after the last hit taken or given)

In effect, the player is forced to stay online until they are out of combat. (though the client itself is disconnected)

Notes:
I might make a demonstration video sometime.
If the ghost entity is unloaded, it will despawn.
ATM there is only support for skins mod with 3d_armor
When you kill a "ghost" stuff will drop like dropondie, no usage of bones is supported yet.
It is only for pvp at the moment, pve combat with mobs or taking fall damage does not enter combat.
you can make the combat time longer or shorter with the "battletimeout" variable at the start of init.lua
I did have a mod that I edited, but I don't remember it's name, and most of the code is mine anyways. tell me if you find it.

As with any new mod, report any bugs and/or duped items here, git, or wherever.
And thanks to the minetest irc community for helping with solving problems.

Download: download latest or browse code

Re: Anti Combat Logging System [anticombatlog]

Posted: Thu Apr 26, 2018 17:41
by Chem871
Would be perfect for Skywars, good deterrent for wimps who run away at the slightest touch.

Re: Anti Combat Logging System [anticombatlog]

Posted: Thu Apr 26, 2018 20:06
by Stix
Chem871 wrote:Would be perfect for Skywars, good deterrent for wimps who run away at the slightest touch.
yes ill waste food fighting a guy and just as im gonna kill em they leave, i also have ppl immeidately log out on first damage, but there can be a reason, i was in a fight with enrico and was winning but then server lag cauzed me to teleport all over the place and i couldnt get a hit in, so i reconnected.

Re: Anti Combat Logging System [anticombatlog]

Posted: Thu May 17, 2018 23:52
by sparky
wimps can still run away, they just can't disconnect to do so. :P

(also, 100th post, yay)

Re: Anti Combat Logging System [anticombatlog]

Posted: Wed Sep 21, 2022 19:20
by Jai77IsNoob
u use it in my SUSMODDED server
Its vary useful to me because i see to many combat loggers