Anti Combat Logging System [anticombatlog]
Posted: Thu Apr 26, 2018 17:26
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"
(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
(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