[MOD] Tool ranks [toolranks]

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

[MOD] Tool ranks [toolranks]

by lisacvuk » Mon Jul 10, 2017 11:20

Tool ranks
Thanks to Nathan Salapat for his review of my mod here. 'Lisac' is a Serbian word, and as all Serbian words it is read exactly as it is written. :)
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.
So, what is the point of this mod?
How many times have you repaired a tool in Minetest?
If you are me, the number is close to none. The reason being, there is really no point to do so.
With this, you'll tend to keep your tools alive, by repairing them.
In order to keep the count of digs, place the tool on the first slot in the grid on the repair recipe.
You've convinced me, how do I get this mod?
It's simple!
Github
Direct link
And now the fancy screenshots!
Image
Image
How does this calculate the new wear?
Code: Select all
wear = digparams.wear / (1 + level / 4)

I simply brute-forced the above code. No idea how it works, but it seems about right in-game.
Dependencies:
default
Licence:
Code: LGPLv2.1+
Tool level sound: CC BY 3.0
Last edited by lisacvuk on Mon Oct 16, 2017 16:19, edited 4 times in total.
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
azekill_DIABLO
Member
 
Posts: 6530
Joined: Wed Oct 29, 2014 20:05
Location: Inside the Box
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
SaKeL
Member
 
Posts: 249
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: [MOD] Tool ranks [toolranks]

by SaKeL » Mon Jul 10, 2017 15:54

Realy nice idea..agree..this should be considered in default game
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

User avatar
azekill_DIABLO
Member
 
Posts: 6530
Joined: Wed Oct 29, 2014 20:05
Location: Inside the Box
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [MOD] Tool ranks [toolranks]

by azekill_DIABLO » Mon Jul 10, 2017 16:49

SaKeL wrote:..agree..

you must define the variable before concatenation
 

User avatar
the_raven_262
Member
 
Posts: 267
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: the_raven_262 Raven262 Corvus262 corvus
In-game: the_raven_262 Raven262 Nevermore
 

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

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Mon Jul 10, 2017 17:09

I should also add some ranks for swords, ex. '20 players killed', '25500 nodes dug'
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. :)
 

twoelk
Member
 
Posts: 1134
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany

Re: [MOD] Tool ranks [toolranks]

by twoelk » Mon Jul 10, 2017 17:25

could imagine many uses for this.

lisacvuk wrote:I should also add some ranks for swords, ex. '20 players killed', '25500 nodes dug'


might be of interest what was hit ;-)
For example on a non PvP server for a sword, if you hit a mob the rank goes up but if you hit a player the rank goes down. Of course there could be many other uses of blunting a tool or weapon beyond wear.
 

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

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Mon Jul 10, 2017 17:27

twoelk wrote:could imagine many uses for this.

lisacvuk wrote:I should also add some ranks for swords, ex. '20 players killed', '25500 nodes dug'


might be of interest what was hit ;-)
For example on a non PvP server for a sword, if you hit a mob the rank goes up but if you hit a player the rank goes down. Of course there could be many other uses of blunting a tool or weapon beyond wear.

Wouldn't do that. If someone wants to enforce no-PvP it shouldn't be through lowering weapon rank.
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
Napiophelios
Member
 
Posts: 900
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [MOD] Tool ranks [toolranks]

by Napiophelios » Wed Jul 12, 2017 08:52

This is a neat mod, however, after some time I receive an error that abruptly crashes game.
And I cannot rejoin without removing the mod.
Image
Instead of the repair grid I have been using the anvil from cottages mod to repair tools,
maybe this is the culprit, IDK.

Code: Select all
2017-07-12 04:20:28: ACTION[Server]: singleplayer digs default:stone at (342,-35,1)
2017-07-12 04:20:28: WARNING[Server]: Assignment to undeclared global "level" inside a function at ...minetest_game\mods\toolranks\init.lua:57.
2017-07-12 04:20:28: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'default' in callback ScriptApiNode::node_on_dig(): ...minetest_game\mods\toolranks\init.lua:59: attempt to compare number with nil
2017-07-12 04:20:28: ERROR[Main]: stack traceback:
2017-07-12 04:20:28: ERROR[Main]:    ...minetest_game\mods\toolranks\init.lua:59: in function 'after_use'
2017-07-12 04:20:28: ERROR[Main]:    D:\Games\MineTest_04160\bin\..\builtin\game\item.lua:483: in function <D:\Games\MineTest_04160\bin\..\builtin\game\item.lua:453>
2017-07-12 04:20:28: ACTION[Server]: singleplayer leaves game. List of players:

screenshot.png
(3.86 KiB) Not downloaded yet
 

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

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Wed Jul 12, 2017 11:46

Napiophelios wrote:This is a neat mod, however, after some time I receive an error that abruptly crashes game.
And I cannot rejoin without removing the mod.
Image
Instead of the repair grid I have been using the anvil from cottages mod to repair tools,
maybe this is the culprit, IDK.

Code: Select all
2017-07-12 04:20:28: ACTION[Server]: singleplayer digs default:stone at (342,-35,1)
2017-07-12 04:20:28: WARNING[Server]: Assignment to undeclared global "level" inside a function at ...minetest_game\mods\toolranks\init.lua:57.
2017-07-12 04:20:28: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'default' in callback ScriptApiNode::node_on_dig(): ...minetest_game\mods\toolranks\init.lua:59: attempt to compare number with nil
2017-07-12 04:20:28: ERROR[Main]: stack traceback:
2017-07-12 04:20:28: ERROR[Main]:    ...minetest_game\mods\toolranks\init.lua:59: in function 'after_use'
2017-07-12 04:20:28: ERROR[Main]:    D:\Games\MineTest_04160\bin\..\builtin\game\item.lua:483: in function <D:\Games\MineTest_04160\bin\..\builtin\game\item.lua:453>
2017-07-12 04:20:28: ACTION[Server]: singleplayer leaves game. List of players:

screenshot.png

I'm looking into the issue right now, sorry for experiencing it. I probably haven't tested the mod enough before releasing it
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
lisacvuk
Member
 
Posts: 255
Joined: Sat Jul 19, 2014 11:52
Location: Serbia, Užice
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Wed Jul 12, 2017 12:05

Bug is solved; please download the latest version!
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
Napiophelios
Member
 
Posts: 900
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [MOD] Tool ranks [toolranks]

by Napiophelios » Thu Jul 13, 2017 00:19

lisacvuk wrote:Bug is solved; please download the latest version!

Awesome, thanks for the quick fix :)
Image

Maybe you can add Moreores mod?
Code: Select all
--
--Moreores
--

if minetest.get_modpath('moreores') then
minetest.override_item("moreores:pick_mithril", {
  original_description = "Mithril Pickaxe",
  description = create_description("Mithril Pickaxe", 0, 1),
  after_use = new_afteruse,
})
minetest.override_item("moreores:axe_mithril", {
  original_description = "Mithril Axe",
  description = create_description("Mithril Axe", 0, 1),
  after_use = new_afteruse,
})
minetest.override_item("moreores:shovel_mithril", {
  original_description = "Mithril Shovel",
  description = create_description("Mithril Shovel", 0, 1),
  after_use = new_afteruse,
})
minetest.override_item("moreores:pick_silver", {
  original_description = "Silver Pickaxe",
  description = create_description("Silver Pickaxe", 0, 1),
  after_use = new_afteruse,
})
minetest.override_item("moreores:axe_silver", {
  original_description = "Silver Axe",
  description = create_description("Silver Axe", 0, 1),
  after_use = new_afteruse,
})
minetest.override_item("moreores:shovel_silver", {
  original_description = "Silver Shovel",
  description = create_description("Silver Shovel", 0, 1),
  after_use = new_afteruse,
})
end


Would be better if other mods could register their own tools
instead of adding them all to ToolRanks mod init file though.

screenshot.png
(3.9 KiB) Not downloaded yet
 

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

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Thu Jul 13, 2017 13:16

I moved all functions to toolranks table. Mod developers can now support toolranks if they so wish :)
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
texmex
Member
 
Posts: 590
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [MOD] Tool ranks [toolranks]

by texmex » Thu Jul 13, 2017 15:56

Hi! Great game mechanic here. Like you say, it creates good incentive to repair existing tools.

One thing I found incoherent is that you can level up any tool by digging any node. I'd much more like if the tool leveled up based on the number of nodes dug that would normally add wear to it. For example, axes used on dirt doesn't wear them. Perhaps you just need to exclude nodes with group var oddly_breakable_by_hand from adding to the node dug count.
Taking a break from Minetest.
Mods Commons, Sling, hbSprint, Floodables, item_drop⑂, Telemosaic⑂, Herbs⑂.
Texturepacks Good Morning Craft
 

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

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Thu Jul 13, 2017 17:34

texmex wrote:Hi! Great game mechanic here. Like you say, it creates good incentive to repair existing tools.

One thing I found incoherent is that you can level up any tool by digging any node. I'd much more like if the tool leveled up based on the number of nodes dug that would normally add wear to it. For example, axes used on dirt doesn't wear them. Perhaps you just need to exclude nodes with group var oddly_breakable_by_hand from adding to the node dug count.

Or maybe only count a node if it damages the tool to dig it. Will look into it.
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
lisacvuk
Member
 
Posts: 255
Joined: Sat Jul 19, 2014 11:52
Location: Serbia, Užice
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Thu Jul 13, 2017 17:46

Only counts the nodes that spend the tool now. Enjoy. :)
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
texmex
Member
 
Posts: 590
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [MOD] Tool ranks [toolranks]

by texmex » Thu Jul 13, 2017 19:59

Yes, that's what I meant. Great, thanks!
Taking a break from Minetest.
Mods Commons, Sling, hbSprint, Floodables, item_drop⑂, Telemosaic⑂, Herbs⑂.
Texturepacks Good Morning Craft
 

User avatar
cx384
Member
 
Posts: 388
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: [MOD] Tool ranks [toolranks]

by cx384 » Sat Jul 15, 2017 09:46

The idea of this mod is not bad, but I think it is not good to use "minetest.override_item()" for such things ( you don't have to ), because this makes it difficult to add toolranks to all tool. Moreover, the new/changed description should dependence on the previous meta description, to avoid mod incompatibilities.
Can your read this?
 

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

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Sat Jul 15, 2017 13:20

cx384 wrote:The idea of this mod is not bad, but I think it is not good to use "minetest.override_item()" for such things ( you don't have to ), because this makes it difficult to add toolranks to all tool. Moreover, the new/changed description should dependence on the previous meta description, to avoid mod incompatibilities.

Alright, how would you do it then? I'm interested. I cannot edit the definitions of default tools, which only leaves me override_item.
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
lisacvuk
Member
 
Posts: 255
Joined: Sat Jul 19, 2014 11:52
Location: Serbia, Užice
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Sat Jul 15, 2017 13:22

I could of course use register_on_dignode, but I'm not sure that would be a better method, because it would be called for every dig, not just the ones with the right tool.
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
cx384
Member
 
Posts: 388
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: [MOD] Tool ranks [toolranks]

by cx384 » Sat Jul 15, 2017 14:56

Yeah, thats what I think you should use.
Can your read this?
 

ABJ
Member
 
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.
GitHub: ABJ-MV
In-game: ABJ
 

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

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Tue Jul 25, 2017 18:56

I doubt they would accept it, comrade. But I can probably try.
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
lisacvuk
Member
 
Posts: 255
Joined: Sat Jul 19, 2014 11:52
Location: Serbia, Užice
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk

Re: [MOD] Tool ranks [toolranks]

by lisacvuk » Thu Jul 27, 2017 11:38

New feature: Will notify the player if tool is about to break.
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
TenPlus1
Member
 
Posts: 2087
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [MOD] Tool ranks [toolranks]

by TenPlus1 » Thu Jul 27, 2017 14:42

Sweeeeeeeeeet, gonna add this to Xanadu :)
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 5 guests