Mods / dummyPlayer - pvp anti-leave

Category: #Other #Tweak
Author: KenigVovan
Side: Both
Created: Feb 5th 2022 at 8:39 PM
Last modified: Nov 19th 2024 at 5:37 PM
Downloads: 7402
Follow Unfollow 11

Latest file for v1.20.0-pre:
dummyplayer_1.3.1.zip 1-click install


Mod adds behavior "pvp tag" - if you hit another player or you are attacked - next X seconds you are in a combat state.

If you leave during this state, clone entity will be spawned on the same place with your current health. This entity will have
items in it's enventory depending on setting (can be bags, hotbar etc, more info below). If entity is killed it drops everything it
has from source player entity. On next login of the player(whose clone entity was killed) is killed as well.

If entity wasn't killed, only player's health will be changed to clone's one if it changed.

There is time period after clone will be despawn - 30 sec by default.

 

Big thanks to jakecool19 for very useful example in "Lands of Chaos" mod (https://mods.vintagestory.at/show/mod/847)

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

KILL_AFTER_LOGIN - if true - player will be killed if his clone was killed and inventories which were selected by settings will be cleared for player

DROP_BAGS, DROP_HOTBAR, DROP_CLOTHS, DROP_ARMOR - if true, copy of inventory will be placed in the clone, if player logout during combat

SECONDS_PVP_TAG_TIMER - how long pvp state is active for player after he attacked or was attacked

TIME_TO_DISAPPEAR - how long clone will exist

By default: 

  1. DROP_HOTBAR and DROP_BAGS are true; DROP_CLOTHS and DROP_ARMOR are false;
  2. KILL_AFTER_LOGIN is true
  3. SECONDS_PVP_TAG_TIMER - 30 seconds
  4. TIME_TO_DISAPPEAR - 30 seconds

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v1.3.1 69 Nov 19th 2024 at 5:37 PM Show dummyplayer_1.3.1.zip Install now
v1.3.0 34 Nov 19th 2024 at 4:38 PM Show dummyplayer_1.3.0.zip Install now
v1.2.5 81 Oct 25th 2024 at 4:16 PM Show dummyplayer_1.2.5.zip Install now
v1.2.4 922 May 9th 2024 at 3:45 PM Show dummyplayer_1.2.4.zip Install now
v1.2.3 942 Nov 16th 2023 at 7:26 PM Show dummyplayer_1.2.3.zip Install now
v1.2.2 125 Nov 15th 2023 at 10:34 PM Show dummyplayer_1.2.2.zip Install now
v1.2.1 1004 Aug 21st 2023 at 4:16 PM Show dummyplayer_1.2.1.zip Install now
v1.2.0 867 Apr 26th 2023 at 5:24 PM Show dummyplayer_v1.2.0.zip Install now
v1.1.1 672 Nov 13th 2022 at 1:50 PM Show dummyplayer_v1.1.1.zip Install now
v1.1.0 242 Jul 9th 2022 at 2:58 PM Show dummyplayer_v1.1.0.zip Install now
v1.0.4 1167 May 1st 2022 at 7:57 AM Show dummyplayer_v1.0.4.zip Install now
v1.0.3 244 Mar 27th 2022 at 11:37 AM Show dummyplayer_v1.0.3.zip Install now
v1.0.2 415 Mar 5th 2022 at 10:27 PM Show dummyplayer_v1.0.2.zip Install now
v1.0.1 275 Mar 4th 2022 at 3:41 PM Show dummyplayer_v1.0.1.zip Install now
v1.0.0 304 Feb 5th 2022 at 8:40 PM Show dummyplayer_v1.0.0.zip Install now

11 Comments (oldest first | newest first)

💬 Raithe, Jan 24th at 5:48 AM

This is causing a crash with Player Corpse whenever we log out of the world.

Game Version: v1.20.1 (Stable)
1/23/2025 6:27:50 AM: Critical error occurred in the following mod: dummyplayer@1.3.1
Loaded Mods: brickmold@1.2.0, canoemod@1.0.2, combatoverhaul@0.1.9, craftablecompanion@1.2.0, dummyplayer@1.3.1, floralzonescaperegion@1.0.13, floralzonescaribbeanregion@1.0.10, floralzonescentralaustralianregion@1.0.7, floralzoneseastasiaticregion@1.0.5, floralzonesmediterraneanregion@1.0.3, floralzonesneozeylandicregion@1.0.6, caninae@1.0.25, capreolinae@1.2.1, casuariidae@1.0.17, dinornithidae@1.0.9, elephantidae@1.0.2, felinae@0.2.4, machairodontinae@1.0.18, pantherinae@1.1.18, rhinocerotidae@1.0.12, sirenia@1.0.13, vombatidae@0.1.1, millwright@1.1.8, pipeleaf@1.10.0, primitivesurvival@3.7.5, repairablelocust@1.4.0, Sergsmetaltongs@2.0.0, spyglass@0.5.2, terraprety@6.0.1, upgradeablelocust@1.0.3, game@1.20.1, vsimgui@1.1.7, AgeOfConfession@2.1.3, alchemy@1.6.42, armory@0.1.1, flags@1.1.5, betterruins@0.4.6, butchering@1.7.8, cancrops@0.2.11, canmarket@0.4.8, carryon@1.8.0-pre.1, coinage@1.12.1, commonlib@2.6.1, configlib@1.4.3, decayingcreatures@0.1.2, fieldsofsalt@1.2.2, fromgoldencombs@1.8.2, gourmand@1.5.0, hardcorewater@1.3.2, herbarium@1.4.0, hydrateordiedrate@1.7.1, liquidcontainers@1.3.1, maltiezcrossbows@0.6.1, moreanimals@1.3.6, noticeboard@1.1.0, petai@3.0.1, playerlist@2.1.5, pysicalmap_tk@1.0.0, rivers@4.1.0, rpgdifficulty@1.1.4, smithingplus@1.1.8, SoundOfConfession@1.0.4, stonebakeoven@1.1.4, tentbag@2.2.0, th3dungeon@0.4.0, thievery@1.0.0, trailmodcupdate@1.2.0, traitacquirer@0.9.6, unconscious@1.8.3, creative@1.20.1, survival@1.20.1, wearandtear@1.1.6, wildfarmingrevival@1.3.4, woodenfortifications@1.0.0, xlib@0.8.9, bookbinders@1.3.0-pre.1, em@3.0.0, playercorpse@1.11.0, shearlib@1.1.1, stonequarry@3.4.2, thebasics@5.0.1, wolftaming@3.0.2, xdiseases@0.1.0, xskills@0.8.10, tailorsdelight@1.8.0, wool@1.5.1
System.NullReferenceException: Object reference not set to an instance of an object.
at dummyplayer.src.compat.playercorpse.PlayerCorpseCompat.ShouldLoad(EnumAppSide forSide) in C:\Users\koeni\source\repos\dummyplayer_7\dummyplayer\dummyplayer\dummyplayer\src\compat\playercorpse\PlayerCorpseCompat.cs:line 28
at Vintagestory.Common.ModLoader.RunModPhase(List`1& enabledSystems, ModRunPhase phase) in VintagestoryLib\Common\API\ModLoader.cs:line 576
at Vintagestory.Common.ModLoader.RunModPhase(ModRunPhase phase) in VintagestoryLib\Common\API\ModLoader.cs:line 564
at Vintagestory.Common.ModLoader.Dispose() in VintagestoryLib\Common\API\ModLoader.cs:line 668
at Vintagestory.Client.NoObf.SystemModHandler.Dispose(ClientMain game) in VintagestoryLib\Client\Systems\ModHandler.cs:line 253
at Vintagestory.Client.NoObf.ClientMain.Dispose() in VintagestoryLib\Client\ClientMain.cs:line 2700
at Vintagestory.Client.NoObf.ClientMain.DestroyGameSession(Boolean gotDisconnected) in VintagestoryLib\Client\ClientMain.cs:line 2647
at Vintagestory.Client.NoObf.GuiDialogEscapeMenu.OnLeaveWorld() in VintagestoryLib\Client\Systems\Gui\Dialogs\GuiDialogEscapeMenu.cs:line 349
at Vintagestory.API.Client.GuiComposer.OnMouseUp(MouseEvent mouse) in VintagestoryApi\Client\UI\GuiComposer.cs:line 445
at Vintagestory.API.Client.GuiDialog.OnMouseUp(MouseEvent args) in VintagestoryApi\Client\UI\Dialog\GuiDialog.cs:line 591
at Vintagestory.Client.NoObf.GuiDialogEscapeMenu.OnMouseUp(MouseEvent args) in VintagestoryLib\Client\Systems\Gui\Dialogs\GuiDialogEscapeMenu.cs:line 422
at Vintagestory.Client.NoObf.GuiManager.OnMouseUp(MouseEvent args) in VintagestoryLib\Client\Systems\Gui\GuiManager.cs:line 415
at Vintagestory.Client.NoObf.ClientMain.OnMouseUpRaw(MouseEvent args) in VintagestoryLib\Client\ClientMain.cs:line 1960
at Vintagestory.Client.GuiScreenRunningGame.OnMouseUp(MouseEvent args) in VintagestoryLib\Client\MainMenu\Screens\GuiScreenRunningGame.cs:line 357
at Vintagestory.Client.NoObf.ClientPlatformWindows.Mouse_ButtonUp(MouseButtonEventArgs e) in VintagestoryLib\Client\ClientPlatform\Input.cs:line 208
at OpenTK.Windowing.Desktop.NativeWindow.MouseButtonCallback(Window* window, MouseButton button, InputAction action, KeyModifiers mods)
--- End of stack trace from previous location ---
at OpenTK.Windowing.Desktop.NativeWindow.RethrowCallbackExceptionsIfNeeded()
at OpenTK.Windowing.Desktop.GameWindow.Run()
at Vintagestory.Client.ClientProgram.Start(ClientProgramArgs args, String[] rawArgs) in VintagestoryLib\Client\ClientProgram.cs:line 334
at Vintagestory.Client.ClientProgram.<>c__DisplayClass10_0.<.ctor>b__1() in VintagestoryLib\Client\ClientProgram.cs:line 130
at Vintagestory.ClientNative.CrashReporter.Start(ThreadStart start) in VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 93

 

 

💬 KenigVovanAuthor, Oct 25th 2024 at 4:17 PM

Wahazar

Hey, I don't know if you still need compatibility with PlayerCorpse, but 1.2.5 version should work with it

💬 Wahazar, Aug 4th 2024 at 6:33 PM

KenigVovan this mod doesn't work with Player Corpse mod - if dummy player is killed, it drops items. I imagine it is not possible to fix without having have Player Corpse functionality integrated within this mod?

💬 Wahazar, Jul 25th 2024 at 8:48 AM

Is it possible to have version/config leaving dummy player always, regardles of PVP flag?

Also for infinity time, if TIME_TO_DISAPPEAR = -1

It would be very helpful for multiplayer servers to deal with thieves, griefers or just causal players borrowing things and quitting forever - if their dummy stays, their inventory also stays on server.

Also solid house with padlocks would be even more important for regular players, to be here on logout.

💬 KenigVovanAuthor, Jul 7th 2024 at 9:39 AM

Wahazar

The main unknown here is chunk loader's behavior when there is no players left on server/in near area, I'll take a look when I'll have time but after updates I planned for other mods.
[But otherwise to set drifters or other mobs agressive towards player's clone and add "delay" on logout without any PVP tag shouldn't be complicated.]

💬 Wahazar, Jul 5th 2024 at 8:10 AM

Is it possible to have option with dummy player (and chunk loader) regardless of PVP tag? I mean, to avoid PVE meta "drifter attacking? lets disconnect".

💬 Marlim, Jan 20th 2024 at 5:50 PM

Will the mod be updated to 1.19?

💬 KenigVovanAuthor, Aug 13th 2023 at 4:01 PM

Ryuu

No, it just catchs event "PlayerDisconnect" from api and spawn a clone and remove it after some time or if player is back online on "PlayerNowPlaying"

💬 Ryuu, Aug 8th 2023 at 7:35 PM

Great solution for people wanting to go pve on a pvp server or pve in a pvp zone on a pvpve server to avoid PVP. If ya don't like PVP, why join a PVP game/server, you know? I know a lot of other games that could learn from this mod tbh. Thanks, KenigVovan! 
A question though, does it detect players with unstable internet and allow sufficient time for the player to log back in before the clone is attackable?

💬 YourCreator, May 1st 2022 at 11:01 AM

Very useful, noice. (thieved silently )
image

💬 TeacupAngel, Feb 5th 2022 at 11:15 PM

In case anyone is curious - this seems to add PvP tag functionality, where you leave behind a "dummy player" with all your items if you log out within 30 seconds of being hurt or attacking someone.

(edit comment delete)