[mod] Death Compass [death_compass] 0.1

Post Reply
FaceDeer
Member
Posts: 464
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

[mod] Death Compass [death_compass] 0.1

by FaceDeer » Post

Have you ever died and been frustrated with being unable to find your way back to your corpse? Carry a death compass with you. When you die the compass will use its dark powers to respawn in your inventory and will be magically bound to point its bony finger toward the location of your demise.

Image

But hurry! The server administrator may have limited the duration that the compass will function for.

Crafting recipe: four bones and a mese fragment. And possibly a fragment of your soul.

Alternately, there is a configuration setting (false by default) that automatically gives a player a death compass whenever they die. This automatic compass will disappear back to wherever it came from once its grim task is complete.

Death Compass is released under the MIT license.

Links
Last edited by FaceDeer on Tue Mar 03, 2020 05:14, edited 3 times in total.

User avatar
FreeGamers
Member
Posts: 606
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [mod] Death Compass [death_compass] 0.1

by FreeGamers » Post

Cool concept. I think a description hint might help it out a bit. I had to come back here a second time to figure out how to use it. Its in Sara's Simple Survival Server now. Seems to work well. I limited it to 30 minutes. Nice one.

FaceDeer
Member
Posts: 464
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [mod] Death Compass [death_compass] 0.1

by FaceDeer » Post

Right-clicking anywhere with the inactive death compass will now send the player a brief explanation of what it's for.

I also cleaned up the display text (it now reads eg "X hours and Y minutes" instead of always "XXX seconds") and made it possible to have multiple independent death compasses. If you die all your inactive death compasses will be set to track your death, but you can then deactivate one or more of them via the crafting grid. Then if you die again en route to your corpse it won't wipe the destination from remaining active compasses, it'll only set the inactive one.

Hope that explanation made sense. :)

kestral
Member
Posts: 89
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: [mod] Death Compass [death_compass] 0.1

by kestral » Post

I also think this is a really cool concept too, but what's going on with the wield animations?
When the compass is wielded and active, the wield animations run continuously, even when my character is standing completely still.

FaceDeer
Member
Posts: 464
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [mod] Death Compass [death_compass] 0.1

by FaceDeer » Post

kestral wrote:I also think this is a really cool concept too, but what's going on with the wield animations?
When the compass is wielded and active, the wield animations run continuously, even when my character is standing completely still.
An unfortunate side-effect of how the game handles changing the properties of the held item. Whenever the item's properties are changed the game thinks you've swapped out a whole new item (which you sort of have, technically speaking) so it plays the animation. Since I've got the distance to your corpse and also a countdown timer in the item's description string that means the item is almost continuously changing.

I'm not aware of a workaround for this. I've seen the same behaviour in various compass mods (this particular mod's codebase started out life as calibrated compass) so if there's a workaround it's not widely known. I could investigate taking the distance and countdown out of the description string and putting it in the HUD instead, though, that would make the item only change if the direction it was pointing changed.

Edit: Done, I've moved the descriptive string from the item itself into the HUD. It's more visible this way too, so I think this is a net improvement rather than just a bugfix. Thanks.

User avatar
runs
Member
Posts: 1640
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [mod] Death Compass [death_compass] 0.1

by runs » Post

kestral wrote:I also think this is a really cool concept too, but what's going on with the wield animations?
When the compass is wielded and active, the wield animations run continuously, even when my character is standing completely still.
Your compass mods have the same issue! :-D
Day 42 of the quarantine

User avatar
FreeGamers
Member
Posts: 606
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [mod] Death Compass [death_compass] 0.1

by FreeGamers » Post

I thought it was a weird at first, but of course once you realize its just swapping out items and textures and that is what is giving the dynamic appearance of the textures, it makes sense and is acceptable.

Just leave it in the hotbar and don't worry about it to much. I've never heard a single complaint from a player about any of the compasses like that actually. Quite unusual, but I suppose that is a good sign!

User avatar
FreeGamers
Member
Posts: 606
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [mod] Death Compass [death_compass] 0.1

by FreeGamers » Post

I was made aware of a item duplication bug with this mod by a few players. Someone has finally given me the method to recreate:

It is being discussed here: https://www.freegamers.org/d/159-death- ... duplicated

Here is a quote:
mistere wrote:I saw that that was in the to-do list... It is duplicated simply by dying. If there is a death compass in the player's invetory when they die, the mod places another death compass in their invetory but does not remove it from their bones. When they get their bones, they now have 2 compasses. It is a horrible curse... Your inventory fills up quick... I have seen bones FULL of them...!

FaceDeer
Member
Posts: 464
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [mod] Death Compass [death_compass] 0.1

by FaceDeer » Post

On further testing I'm seeing some tricky behaviour. Both this mod and the bones mod register on_dieplayer callbacks, and the order in which those on_dieplayer callbacks are called may be what's causing this. Since there isn't an explicit dependency on the bones mod the order is undefined.

I've just added a fix that should force this mod's on_dieplayer to always run before the bones mod's on_dieplayer. That means that this mod should always have the opportunity to remove uninitialized death compasses from the player's inventory before the bones mod populates the inventory of the bones node it's about to place. Hopefully that'll solve whatever's going on here.

If there are other mods dealing with on_dieplayer inventory manipulation I could add a more generic fix that should ensure death_compass' on_dieplayer *always* runs first, regardless of other mods, but I'm reluctant to get hackier than I already am being here. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests