[MOD] Tool ranks [toolranks]

Mineminer
Member
Posts: 58
Joined: Mon Mar 05, 2018 04:05

Re: [MOD] Tool ranks [toolranks]

by Mineminer » Post

maikerumine wrote:
Drgnrdr wrote:Love your mod, but last night ran into this error(game crash):

Code: Select all

2018-01-25 04:37:54: ACTION[Server]: singleplayer uses nyancats_plus:rainbow_hoe, pointing at [node under=-4,16,6 above=-4,17,6]
2018-01-25 04:37:54: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback item_OnUse(): C:\GAMES\MINETEST\bin\..\mods\toolranks\init.lua:13: bad argument #1 to 'find' (string expected, got nil)
2018-01-25 04:37:54: ERROR[Main]: stack traceback:
2018-01-25 04:37:54: ERROR[Main]: 	[C]: in function 'find'
2018-01-25 04:37:54: ERROR[Main]: 	C:\GAMES\MINETEST\bin\..\mods\toolranks\init.lua:13: in function 'get_tool_type'
2018-01-25 04:37:54: ERROR[Main]: 	C:\GAMES\MINETEST\bin\..\mods\toolranks\init.lua:28: in function 'create_description'
2018-01-25 04:37:54: ERROR[Main]: 	C:\GAMES\MINETEST\bin\..\mods\toolranks\init.lua:100: in function 'new_afteruse'
2018-01-25 04:37:54: ERROR[Main]: 	C:\GAMES\MINETEST\bin\..\mods\farming/hoes.lua:116: in function <C:\GAMES\MINETEST\bin\..\mods\farming/hoes.lua:64>
2018-01-25 04:37:54: ERROR[Main]: 	(tail call): ?
This happened when using any hoe other than default hoes. The error stopped only when mod was disabled or removed.
You wull need to add support for it manually, like I did here:

Code: Select all

if minetest.get_modpath("toolranks") then
--aikerum	
  minetest.override_item("es:pick_aikerum", {
    original_description = "Extreme Survival Aikerum Pickaxe",
    description = toolranks.create_description("Extreme Survival Aikerum Pickaxe", 0, 1),
    after_use = toolranks.new_afteruse})

  minetest.override_item("es:axe_aikerum", {
    original_description = "Extreme Survival Aikerum Axe",
    description = toolranks.create_description("Extreme Survival Aikerum Axe", 0, 1),
    after_use = toolranks.new_afteruse})

  minetest.override_item("es:shovel_aikerum", {
    original_description = "Extreme Survival Aikerum Shovel",
    description = toolranks.create_description("Extreme Survival Aikerum Shovel", 0, 1),
    after_use = toolranks.new_afteruse})
end
Add code like this in a new mod and do it for all the tools you want to add.


So you means for the more ores tools ( viewtopic.php?id=549 ) a new mod would has to be created just to prevent them from cashing the server?

User avatar
lisacvuk
Member
Posts: 274
Joined: Sat Jul 19, 2014 11:52
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk
Location: Serbia, Užice

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Post

No, it means the more ores mod needs to support this if it is to work correctly.
The server admin can add the support manually.
It's lisac, not lisa.
400 character limit? Am I writing a book?
Administrator on Craig's server. Minetest player.
"The enemy pales when they see the face of Dazzle!" ~ Dazzle obviously.
I live in Serbia.
Steam | OpenDOTA
My mods:
Tool ranks
I appreciate donations in TF2 items. :)

EdShouldBeInBed
Member
Posts: 48
Joined: Sun Feb 22, 2015 16:03
In-game: EdShdBInBed

Re: [MOD] Tool ranks [toolranks]

by EdShouldBeInBed » Post

So, partly as practice in coding and partly just to expand support, I made a little mod.
It's here. It extends the coverage of toolranks to:
bacon
glooptest
magma and ice mp
technic aluminum

Seems to work on my local game, but if you have any of these mods installed do try it.
I'm a writer who tinkers with code on occasion. I play minetest when insomnia makes the writing hard.

User avatar
Hamlet
Member
Posts: 716
Joined: Sat Jul 29, 2017 21:09
GitHub: h4ml3t
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [MOD] Tool ranks [toolranks]

by Hamlet » Post

lisacvuk wrote: [...]
What this does is add levels to tools depending on number of nodes you've dug with that tool.
Higher level tools take longer to wear out.
[...]
I'm using your mod since a long time and I find it very useful, thanks for your work.
Earlier I was repairing a sword and I thought if it could be possible to apply the same principle to weapons, it would be nice to have them record the number of killed mobs!
Another feature I would like to see is localized messages, is there any chance that you add Intllib support?
GitLab ContentDB VanessaE's Basic-plus Server (-1122.0, 19.5, -2438.0)

User avatar
lisacvuk
Member
Posts: 274
Joined: Sat Jul 19, 2014 11:52
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk
Location: Serbia, Užice

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Post

Hamlet wrote: I'm using your mod since a long time and I find it very useful, thanks for your work.
Earlier I was repairing a sword and I thought if it could be possible to apply the same principle to weapons, it would be nice to have them record the number of killed mobs!
Another feature I would like to see is localized messages, is there any chance that you add Intllib support?
Thanks for trying it out :)
There are a few mobs mods out there, with pretty much different APIs, so it would be hard to support all of them. Might just support mobs_redo once.
IIRC there is another way to do translations in .5, I'm waiting for that one.
It's lisac, not lisa.
400 character limit? Am I writing a book?
Administrator on Craig's server. Minetest player.
"The enemy pales when they see the face of Dazzle!" ~ Dazzle obviously.
I live in Serbia.
Steam | OpenDOTA
My mods:
Tool ranks
I appreciate donations in TF2 items. :)

User avatar
Hamlet
Member
Posts: 716
Joined: Sat Jul 29, 2017 21:09
GitHub: h4ml3t
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [MOD] Tool ranks [toolranks]

by Hamlet » Post

lisacvuk wrote: [..]There are a few mobs mods out there, with pretty much different APIs, so it would be hard to support all of them. Might just support mobs_redo once.
That would be cool :)
lisacvuk wrote: IIRC there is another way to do translations in .5, I'm waiting for that one.
Good to know, I'll stay tuned.
GitLab ContentDB VanessaE's Basic-plus Server (-1122.0, 19.5, -2438.0)

User avatar
bosapara
Member
Posts: 574
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
Contact:

Re: [MOD] Tool ranks [toolranks]

by bosapara » Post

How about to add sword and hoe to mod of tool rank?

Will be too much useful with anvil mod

ImageImage

User avatar
GamingAssociation39
Member
Posts: 832
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: [MOD] Tool ranks [toolranks]

by GamingAssociation39 » Post

This resembles a mod out there for MC that has similar functionality
Jesus Is Lord and Savior!!!

User avatar
TenPlus1
Member
Posts: 2717
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [MOD] Tool ranks [toolranks]

by TenPlus1 » Post

bosapara: swords were just added a few weeks ago and if you use farming redo then hoe's use toolranks also.

User avatar
bosapara
Member
Posts: 574
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
Contact:

Re: [MOD] Tool ranks [toolranks]

by bosapara » Post

TenPlus1 wrote:bosapara: swords were just added a few weeks ago and if you use farming redo then hoe's use toolranks also.
good news, thats awesome!

__________________________

Sword is easy to add (only for dig, not for punch), but hoe a few hard

User avatar
TenPlus1
Member
Posts: 2717
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [MOD] Tool ranks [toolranks]

by TenPlus1 » Post

Toolrank swords will still count it's uses when hitting mobs redo mobs :) not just digging leaves etc.

User avatar
Lord_Vlad
Member
Posts: 112
Joined: Thu Jul 20, 2017 07:58

Re: [MOD] Tool ranks [toolranks]

by Lord_Vlad » Post

Swords is kinda unbalanced in the fact that if you hold hit, you will hit fast for a few damages, but it will count as a ton of uses according to tool ranks.
Add to that that they last forever to start with, in my opinion...

Tikilou
New member
Posts: 3
Joined: Fri May 03, 2019 17:46

Re: [MOD] Tool ranks [toolranks]

by Tikilou » Post

Since this last post was created after the last backup of forum, the toolranks mods here is not compatible anymore with moreores and farming_redo with minetest 5.x.

You can download a fork of theses mods with compatibility here : https://notabug.org/TenPlus1/

I have forked too toolrank_extender for compatibility with gemtools, gloopblocks, octu, titanium :

Folder should be named "toolrank_extender" :

depends.conf :

Code: Select all

default
toolranks
bacon?
glooptest?
magma_and_ice_mp?
technic_aluminum?
gemtools?
gloopblocks?
octu?
titanium?
init.lua :

Code: Select all

if minetest.get_modpath("toolranks") then


-- Bacon Mod support.
  if minetest.get_modpath("bacon") then

    minetest.override_item("bacon:pick", {
      original_description = "Bacon Pickaxe",
      description = toolranks.create_description("Bacon Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("bacon:axe", {
      original_description = "Bacon Axe",
      description = toolranks.create_description("Bacon Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("bacon:shovel", {
      original_description = "Bacon Shovel",
      description = toolranks.create_description("Bacon Shovel", 0, 1),
      after_use = toolranks.new_afteruse})
  end



-- Glooptest Support.
  if minetest.get_modpath("glooptest") then

    minetest.override_item("glooptest:pick_alatro", {
      original_description = "Alatro Pickaxe",
      description = toolranks.create_description("Alatro Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("glooptest:axe_alatro", {
      original_description = "Alatro Axe",
      description = toolranks.create_description("Alatro Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("glooptest:shovel_alatro", {
      original_description = "Alatro Shovel",
      description = toolranks.create_description("Alatro Shovel", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("glooptest:pick_arol", {
      original_description = "Arol Pickaxe",
      description = toolranks.create_description("Arol Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("glooptest:axe_arol", {
      original_description = "Arol Axe",
      description = toolranks.create_description("Arol Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("glooptest:shovel_arol", {
      original_description = "Arol Shovel",
      description = toolranks.create_description("Arol Shovel", 0, 1),
      after_use = toolranks.new_afteruse})
  end



-- Magma and Ice MP mod support
  if minetest.get_modpath("magmatools") then

    minetest.override_item("magmatools:pick_magma", {
      original_description = "Magma Pickaxe",
      description = toolranks.create_description("Magma Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("magmatools:axe_magma", {
      original_description = "Magma Axe",
      description = toolranks.create_description("Magma Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("magmatools:shovel_magma", {
      original_description = "Magma Shovel",
      description = toolranks.create_description("Magma Shovel", 0, 1),
      after_use = toolranks.new_afteruse})
  end

  if minetest.get_modpath("icetools") then

    minetest.override_item("icetools:pick_ice", {
      original_description = "Ice Pickaxe",
      description = toolranks.create_description("Ice Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("icetools:axe_ice", {
      original_description = "Ice Axe",
      description = toolranks.create_description("Ice Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("icetools:shovel_ice", {
      original_description = "Ice Shovel",
      description = toolranks.create_description("Ice Shovel", 0, 1),
      after_use = toolranks.new_afteruse})
  end

  if minetest.get_modpath("technic_aluminum") then

    minetest.override_item("technic_aluminum:pick_aluminum", {
      original_description = "Ice Pickaxe",
      description = toolranks.create_description("Aluminum Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("technic_aluminum:axe_aluminum", {
      original_description = "Ice Axe",
      description = toolranks.create_description("Aluminum Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("technic_aluminum:shovel_aluminum", {
      original_description = "Ice Shovel",
      description = toolranks.create_description("Aluminum Shovel", 0, 1),
      after_use = toolranks.new_afteruse})


-- Gemtools Support.

  if minetest.get_modpath("gemtools") then

    minetest.override_item("gemtools:pick_emerald", {
      original_description = "Emerald Pickaxe",
      description = toolranks.create_description("Emerald Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gemtools:pick_ruby", {
      original_description = "Ruby Pickaxe",
      description = toolranks.create_description("Ruby Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gemtools:pick_saphire", {
      original_description = "Saphire Pickaxe",
      description = toolranks.create_description("Saphire Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gemtools:axe_emerald", {
      original_description = "Emerald Axe",
      description = toolranks.create_description("Emerald Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gemtools:axe_ruby", {
      original_description = "Ruby Axe",
      description = toolranks.create_description("Ruby Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gemtools:axe_saphire", {
      original_description = "Saphire Axe",
      description = toolranks.create_description("Saphire Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gemtools:shovel_emerald", {
      original_description = "Emerald Shovel",
      description = toolranks.create_description("Emerald Shovel", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gemtools:shovel_ruby", {
      original_description = "Ruby Axe",
      description = toolranks.create_description("Ruby Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gemtools:shovel_saphire", {
      original_description = "Saphire Shovel",
      description = toolranks.create_description("Saphire Shovel", 0, 1),
      after_use = toolranks.new_afteruse})

  end

-- Gloopblocks support

  if minetest.get_modpath("gloopblocks") then

    minetest.override_item("gloopblocks:pick_cement", {
      original_description = "Ciment Pickaxe",
      description = toolranks.create_description("Ciment Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gloopblocks:pick_evil", {
      original_description = "Evil Pickaxe",
      description = toolranks.create_description("Evil Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gloopblocks:axe_cement", {
      original_description = "Ciment Pickaxe",
      description = toolranks.create_description("Ciment Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gloopblocks:axe_evil", {
      original_description = "Evil Axe",
      description = toolranks.create_description("Evil Axe", 0, 1),
      after_use = toolranks.new_afteruse})


    minetest.override_item("gloopblocks:shovel_cement", {
      original_description = "Ciment Shovel",
      description = toolranks.create_description("Ciment Shovel", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("gloopblocks:shovel_evil", {
      original_description = "Evil Shovel",
      description = toolranks.create_description("Evil Shovel", 0, 1),
      after_use = toolranks.new_afteruse})

  end




-- Octu support

  if minetest.get_modpath("octu") then

    minetest.override_item("octu:pick_octu", {
      original_description = "Octu Pickaxe",
      description = toolranks.create_description("Octu Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("octu:axe_octu", {
      original_description = "Octu Axe",
      description = toolranks.create_description("Octu Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("octu:shovel_octu", {
      original_description = "Octu Shovel",
      description = toolranks.create_description("Octu Shovel", 0, 1),
      after_use = toolranks.new_afteruse})

  end



-- Titanium support


  if minetest.get_modpath("titanium") then

    minetest.override_item("titanium:pick", {
      original_description = "Titanium Pickaxe",
      description = toolranks.create_description("Titanium Pickaxe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("titanium:axe", {
      original_description = "Titanium Axe",
      description = toolranks.create_description("Titanium Axe", 0, 1),
      after_use = toolranks.new_afteruse})

    minetest.override_item("titanium:shovel", {
      original_description = "Titanium Shovel",
      description = toolranks.create_description("Titanium Shovel", 0, 1),
      after_use = toolranks.new_afteruse})

  end

end


Vince
Member
Posts: 12
Joined: Fri May 20, 2016 02:58
GitHub: vaggrippino
IRC: Vince
In-game: Vince

Re: [MOD] Tool ranks [toolranks]

by Vince » Post

Thank you TenPlus1 for fixing this and Tikilou for (re?) posting the fixed fork by TenPlus1!

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

Re: [MOD] Tool ranks [toolranks]

by ShadMOrdre » Post

I've created a "fork" of this mod, that includes the WIP c-t-m mod. The c-t-m mod provides on_crafted modifiers to the tool_caps group, so your tools will not necessarily be what you expect. It's a nice addition to toolranks. I've also asked the author of c-t-m to create modifiers for armor, so that tools and armor will get both toolranks and the c-t-m modifiers applied at craft time.

Currently I have this working for both tools and armor. Toolranks are applied to armor, and toolranks and the c-t-m modifiers are applied to all tools that are registered according to the toolranks definition.

What you get is like this:
Image
Image
Image

The toolranks namespace is preserved in this mod, so should be a drop in replacement.

SOURCE and DOWNLOAD: lib_trm

Enjoy!

Shad
Attachments
screenshot_20190820_203316.jpg
(146.77 KiB) Not downloaded yet
screenshot_20190820_203152.jpg
(186.88 KiB) Not downloaded yet
screenshot_20190820_203307.jpg
(146.12 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
Hamlet
Member
Posts: 716
Joined: Sat Jul 29, 2017 21:09
GitHub: h4ml3t
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [MOD] Tool ranks [toolranks]

by Hamlet » Post

Is this mod still being maintained?
GitLab ContentDB VanessaE's Basic-plus Server (-1122.0, 19.5, -2438.0)

User avatar
TenPlus1
Member
Posts: 2717
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [MOD] Tool ranks [toolranks]

by TenPlus1 » Post

Sharm0rdre and myself both have a fork of toolranks to keep it up and active :)

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

Re: [MOD] Tool ranks [toolranks]

by ShadMOrdre » Post

My fork is more than just Toolranks.

It also includes, from the WIP mod section, c-t-m mod. This mod add "Terraria" like modifiers to the tools as they are crafted.

Here is the link to the forum post: lib_trm

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

User avatar
Hamlet
Member
Posts: 716
Joined: Sat Jul 29, 2017 21:09
GitHub: h4ml3t
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [MOD] Tool ranks [toolranks]

by Hamlet » Post

@TenPlus1 @ShadMOrdre

Good to know that this mod is being kept alive, please consider adding compatibility with "recycleage": here's a post where I'm explaining why they are currently incompatible: [link].

By the way, given that now Minetest supports localization it would be nice to add that feature as well - at least for the warning message.
GitLab ContentDB VanessaE's Basic-plus Server (-1122.0, 19.5, -2438.0)

Stronk
Member
Posts: 13
Joined: Sat Jul 20, 2019 08:13

Re: [MOD] Tool ranks [toolranks]

by Stronk » Post

Is this the mod in the contentDB? The one you download from in-game? It breaks a lot of mods just by running it if so.

User avatar
TenPlus1
Member
Posts: 2717
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [MOD] Tool ranks [toolranks]

by TenPlus1 » Post

this is why i forked the mod so it would work well with dependencies, try my version at notabug. org/tenplus1/toolranks .. you can also find moreores that works well with it there also.

User avatar
bosapara
Member
Posts: 574
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
Contact:

Re: [MOD] Tool ranks [toolranks]

by bosapara » Post

TenPlus1 wrote:Toolrank swords will still count it's uses when hitting mobs redo mobs :) not just digging leaves etc.

What is version of toolranks works correctly with swords and hoes?

On gif bellow punch with sword don't crash your sword, the same with hoe on_use.

Toolranks counts punch and use, but prevent any wear.

Image

_______________________________________________________________

Solved, creative is a reason.

Post Reply

Who is online

Users browsing this forum: runs and 5 guests