edited out the authors
parent
a71eacd0b9
commit
bfc85b4b9e
76
Home.md
76
Home.md
|
@ -3,32 +3,80 @@ Welcome to the Wiki.
|
|||
This is a place to store knowledge about modding and/in minetest/voxelibre.
|
||||
|
||||
## Random tickspeed in Voxelibre:
|
||||
hi folks! came here to ask a question but first: everyone who plays this game and those who help develop it are saints in my book. Just wanted to get that out there.
|
||||
hi folks! came here to ask a question but firsteveryone who plays this game and those who help develop it are saints in my book. Just wanted to get that out there.
|
||||
That said, I feel like random tick speed is pretty high. Everything grows insanely fast and although I appreciate not waiting a ton, it might get old. Anyone know how to change that?
|
||||
|
||||
marinerdev: mods/ITEMS/mcl_farming/shared_functions.lua
|
||||
mods/ITEMS/mcl_farming/shared_functions.lua
|
||||
|
||||
marinerdev: function mcl_farming:add_plant
|
||||
function mcl_farming:add_plant
|
||||
|
||||
marinerdev: well function mcl_farming:add_plant(identifier, full_grown, names, interval, chance)
|
||||
well function mcl_farming:add_plant(identifier, full_grown, names, interval, chance)
|
||||
|
||||
marinerdev: it passes in interval and chance to the abm it creates
|
||||
it passes in interval and chance to the abm it creates
|
||||
|
||||
marinerdev: so chance is 1 in chance. if you pass 2, it'll happen 50% of the time, 4 and 25% of the time
|
||||
so chance is 1 in chance. if you pass 2, it'll happen 50% of the time, 4 and 25% of the time
|
||||
|
||||
marinerdev: interval is how frequently that chance is attempted
|
||||
interval is how frequently that chance is attempted
|
||||
|
||||
marinerdev: as we don't really have a random tick speed under the cover
|
||||
as we don't really have a random tick speed under the cover
|
||||
|
||||
marinerdev: we've kind of chosen to keep faster growth speeds, but it is customisable this way
|
||||
we've kind of chosen to keep faster growth speeds, but it is customisable this way
|
||||
|
||||
marinerdev: so in carrots.lua, are the bottom, you have: mcl_farming:add_plant("plant_carrot", "mcl_farming:carrot",
|
||||
so in carrots.lua, are the bottom, you havemcl_farming:add_plant("plant_carrot", "mcl_farming:carrot",
|
||||
{"mcl_farming:carrot_1", "mcl_farming:carrot_2", "mcl_farming:carrot_3", "mcl_farming:carrot_4", "mcl_farming:carrot_5", "mcl_farming:carrot_6", "mcl_farming:carrot_7"}, 25, 20)
|
||||
|
||||
marinerdev: so, it's a 1 in 20 chance, every 25 seconds
|
||||
so, it's a 1 in 20 chance, every 25 seconds
|
||||
|
||||
marinerdev: of course, you could just modify the add_plant, and multiply the chance by 0.75 for 25% slower growth
|
||||
of course, you could just modify the add_plant, and multiply the chance by 0.75 for 25% slower growth
|
||||
|
||||
marinerdev: chance = chance * 0.75,
|
||||
chance = chance * 0.75,
|
||||
|
||||
marinerdev: for everything
|
||||
for everything
|
||||
|
||||
## About general modding in voxelibre
|
||||
|
||||
One thing I will mention is that when I need large amounts of Lapis Lazuli for enchanting, I find a village and get a cleric. They have lapis as a trade.
|
||||
|
||||
There is also an open issue for the rarity of lapis orehttps://git.minetest.land/VoxeLibre/VoxeLibre/issues/3561
|
||||
|
||||
Though it looks like you already commented on that issue.
|
||||
|
||||
Du> <@:matrix.org> Though it looks like you already commented on that issue.
|
||||
|
||||
I did. right now I just want to do a quick fix with a mod so people can go on with their lives until the fix is pulled. :)
|
||||
|
||||
Ducan you maybe point me in the right direction? I feel like redefining the enchantments is obsolete, no?
|
||||
|
||||
I think there should be a way to not have to duplicate the enchanting code. Let me have a look at our code.
|
||||
|
||||
I can't devote a lot of time on it right now, unfortunately.
|
||||
|
||||
I suspect you can utilize mcl_enchanting and have your own formspec and inventory handling that uses redstone instead of lapis.
|
||||
|
||||
Relevant code starts at https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/mods/ITEMS/mcl_enchanting/engine.lua#L497
|
||||
|
||||
You can either make copies of those functions for your version of the enchanting table or override them with versions that use redstone.
|
||||
|
||||
Adding mcl_enchanting to your dependencies will force it to load before your code runs.
|
||||
|
||||
Dudo you happen to have an example somewhere how to "piggiback" on another mod? like what to leave out and what to put in?
|
||||
|
||||
I don't think I do. Closest I think I have is dependencies and overriding registered nodes.
|
||||
|
||||
I think that later one is done with minetest.override_item()
|
||||
|
||||
Du> <@:matrix.org> I don't think I do. Closest I think I have is dependencies and overriding registered nodes.
|
||||
|
||||
okay. I will try and redo the whole thing in a much more reduced version with the tips you gave me. I'm very thankful!
|
||||
|
||||
Btw. this game is so awesome. I love playing it and its insane how advanced it is. Especially considering the FOSS nature of it.
|
||||
|
||||
See https://api.minetest.net/minetest-namespace-reference/
|
||||
|
||||
Just don't throw away your old code. You never know if or when it will come in handy for reference purposes.
|
||||
|
||||
And thanks.
|
||||
|
||||
That is the API reference for the minetest engine that VoxeLibre runs on, so I end up having that open in a tab or two constantly.
|
||||
|
||||
We use our own APIs where possible, but someone has to write those APIs amd to do that you have to talk to minetest engine.
|
Loading…
Reference in a new issue