[MOD] Tool Ranks and Modifiers [lib_trm][git]

ShadMOrdre
Member
 
Posts: 470
Joined: Mon Dec 29, 2014 08:07
Location: USA
GitHub: ShadMOrdre
In-game: shadmordre

[MOD] Tool Ranks and Modifiers [lib_trm][git]

by ShadMOrdre » Fri Sep 06, 2019 22:54

What is Tool Ranks and Modifiers?

This mod simply combines the two wonderful mods, toolranks (by lisacvuk) and c-t-m (by davidthecreator).

I have tested this on MT v5.0.1. Due to the on_mods_loaded call, it will not work on previous versions. However, do not worry. If a version of this mod for MT previous versions is in high enough demand, I can repost previous versions which may have worked. Whatever version of MT you use must support the register_on_crafted API function for the craft modifiers to work, and must support the on_mods_loaded API function, for the overrides to take effect. Due to this function call, and the inability to check MT versions, this may crash previous versions of MT.

In order to avoid both dependency nightmares, and to avoid requiring mods to specifically modify tool registration code or add dependencies, this mod was born.

This mod has no dependencies, nor requires any recoding or dependency by mods using this functionality. This mod uses the on_mods_loaded function to override all registered tools to add the above functionality. If there are any specific mods for which I should disable the override, please let me know.

If you experience any issues, please let me know. Also, if you like this mod, please, drop a line.


DOWNLOAD and SOURCE: lib_trm

Image
Image
Image
Attachments
screenshot_20190906_155920.jpg
(244.39 KiB) Not downloaded yet
screenshot_20190906_155913.jpg
(246.03 KiB) Not downloaded yet
screenshot_20190906_155858.jpg
(230.1 KiB) Not downloaded yet
MY MODS: lib_ecology lib_materials lib_clouds lib_node_shapes ---- Inspired By: Open Source Virtual World Simulator Opensimulator.
 

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

Re: [MOD] Tool Ranks and Modifiers [lib_trm][git]

by runs » Sat Sep 07, 2019 23:38

Translation support. Toolranks used descriptions to identify items, so no internationalization possible.
 

ShadMOrdre
Member
 
Posts: 470
Joined: Mon Dec 29, 2014 08:07
Location: USA
GitHub: ShadMOrdre
In-game: shadmordre

Re: [MOD] Tool Ranks and Modifiers [lib_trm][git]

by ShadMOrdre » Sun Sep 08, 2019 07:09

I've updated this mod to use 1 of 3 available translation modes.

Enabled, by default, is an optional dependency on intllib mod. This is to maintain backwards compatibility.

If intllib mod is not installed or enabled, then lib_trm will fall back to an included intllib.lua module. As a native English speaker, I would need assistance if translations are needed.

To enable the MT v5.0+ built in translation module, go to the settings menu for lib_trm, and enable support there. Please note, that while I've used the intllib modules in previous mods, I am not yet familiar with the new builtin translation functionality, and this might be buggy.

Please let me know if this helps. It's also possible to apply the translation function around the description texts, but translations are already a tricky thing, so this might also need work.

Please report any issues, suggestions, or complaints. Thanks in advance.

Shad
MY MODS: lib_ecology lib_materials lib_clouds lib_node_shapes ---- Inspired By: Open Source Virtual World Simulator Opensimulator.
 

ThorfinnS
Member
 
Posts: 110
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [MOD] Tool Ranks and Modifiers [lib_trm][git]

by ThorfinnS » Tue Sep 10, 2019 04:15

I got a report from players (and confirmed it) that if you "repair" a pickaxe by creating a new pickaxe, then "merge" the worn out pick and the new pick, the property "disappears" after mining one node. I think it's only the description, though. In testing, I got a demonic stone shovel, and when digging stone, it was making the sound one gets from a pick going at stone, even though the description dropped back to regular old stone shovel. I made another stone shovel, and this one didn't do the same sound, and had no modifier. It also reported back 0 nodes dug, though the very next node dug said 120 or whatever nodes. Makes sense, I guess, since it looks like it's creating a new tool, rather than just updating the use count on an existing tool.

Repair seems to retain the properties, but not the description.

Might be one of the several dozen mods I have loaded, though. I have toolranks disabled, and don't have c-t-m- downloaded at all. Might also be the check to see if toolranks exists, rather than is enabled, I suppose.

[EDIT]
Oh, and the stone hoe I tried out made no sound at all before it broke. With Toolranks, it gives at least two warning sounds that it's going to break.
[/EDIT]
 

ThorfinnS
Member
 
Posts: 110
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [MOD] Tool Ranks and Modifiers [lib_trm][git]

by ThorfinnS » Wed Sep 11, 2019 18:02

Here's what I'm talking about.

has-props.png
Pick has properties
(18.9 KiB) Not downloaded yet


one-use.png
...after digging one stone block,
(17.64 KiB) Not downloaded yet


first.png
...there's no longer properties in the hover.
(13.77 KiB) Not downloaded yet
 

ShadMOrdre
Member
 
Posts: 470
Joined: Mon Dec 29, 2014 08:07
Location: USA
GitHub: ShadMOrdre
In-game: shadmordre

Re: [MOD] Tool Ranks and Modifiers [lib_trm][git]

by ShadMOrdre » Mon Sep 16, 2019 23:01

ThorfinnS,

Yes, I've encountered this issue. Thank you for reporting.

I've got this fixed, just not in a way that I am comfortable with, ie, there are still "issues" regarding the tooltips and the way they are managed. With a little more integration between the two mods, the issues will go away. Note, due to the way that the description field is handled, there will continue to be issues with other mods that directly write the description, without accommodating the existing description. Those mods will need to be updated to correctly write the descriptions, without overwriting what any other mod may be adding to a tools description.

I also want to attempt creating armor modifiers, but I'll wait until after I post this update.

Again, thanks for your reporting.

Shad
MY MODS: lib_ecology lib_materials lib_clouds lib_node_shapes ---- Inspired By: Open Source Virtual World Simulator Opensimulator.
 


Return to WIP Mods



Who is online

Users browsing this forum: Kurtzmusch and 7 guests