Page 1 of 1

[Mod] Fertiliser [0.1.6] [fertiliser]

PostPosted: Fri Nov 29, 2013 04:48
by minermoder27
Fertiliser mod for minetest.

punch anything from farming plus and farming or punch cactus and papyrus to grow it 1 "level". Trees take a few clicks, but will grow (Trees will never have apples).

Crafting

L = Leaves
A = Apple
D = Dirt
. = nothing

. L .
L A L
D D D

or (on older versions)

Craft 1 bone block to make 9 bones.
craft 8 dirt with 1 bone in the center to make 9 fertiliser.

Compadibility
Moretrees trees
Farming Plus trees
Vanilla cacti/papyrus
Vanilla pine and oak trees
Vanilla wheat/cotton

Downloads
Github: https://github.com/minermoder27/minetest-fertiliser
Download: https://github.com/minermoder27/minetest-fertiliser/archive/master.zip

Depends
default
farming (comes by default)
farming_plus

LICENCE
Apache License

CREDITS
MTDad - debugging on newer versions of Minetest
Esteban - new crafting recipie

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Wed Oct 01, 2014 09:46
by balthazariv
Hello,

I have this error

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
11:42:11: ERROR[main]: ========== ERROR FROM LUA ===========
11:42:11: ERROR[main]: Failed to load and run script from
11:42:11: ERROR[main]: L:\Minetest\minetest - Copie\bin\..\mods\fertiliser\init.lua:
11:42:11: ERROR[main]: ...inetest\minetest - Copie\bin\..\mods\fertiliser\init.lua:26: unexpected symbol near '<'
11:42:11: ERROR[main]: ======= END OF ERROR FROM LUA ========

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Wed Oct 01, 2014 14:41
by Xanthin
Interesting, faster grow of plants and trees :)

I tested it and deleted this three lines in the init.lua:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
<<<<<<< HEAD
=======
>>>>>>> origin/master


Now it works but not for jungletrees. With jungletree saplings I get an error about "deprecated use of default.grow_jungletree".
I havent tested it yet with moretrees.

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Wed Oct 01, 2014 21:46
by balthazariv
Hello, i deleted this three lines but it not works.
No item in my inventory (in creative mode) and when i want to craft

"Craft 1 bone block to make 9 bones.
craft 8 dirt with 1 bone in the center to make 9 fertiliser"
i have no item for fertiliser and no bones

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Thu Oct 02, 2014 03:10
by Xanthin
Yes, I got this too at my first try. The mod has a hard dependency on farming_plus and only works if you enable it too.
Funny: you can use the fertiliser on papyrus to grow it on every soil (dirt, sand, stone) no matter how near to water and as high as you want. If you add "climbable = true," to papyrus you can play "Jack and the papyrusstalk". :)

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Sat Oct 11, 2014 20:02
by minermoder27
Sorry about three lines, it was a problem with my use of git.
This is now fixed.

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Mon Oct 13, 2014 21:54
by balthazariv
Hello,

I Have this error with your mod and [Modpack] [farming_plusplus][1.03] farming_plus fork

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
23:47:55: ERROR[main]: ServerError: ...etest\bin\..\mods\farming_plusplus\farming_plus\init.lua:56: attempt to perform arithmetic on field 'y' (a nil value)
23:47:55: ERROR[main]: stack traceback:
23:47:55: ERROR[main]:    ...etest\bin\..\mods\farming_plusplus\farming_plus\init.lua:56: in function 'generate_tree'
23:47:55: ERROR[main]:    L:\Minetest\minetest\bin\..\mods\fertiliser\init.lua:6: in function <L:\Minetest\minetest\bin\..\mods\fertiliser\init.lua:4>
23:47:55: ERROR[main]:    L:\Minetest\minetest\bin\..\mods\fertiliser\init.lua:164: in function <L:\Minetest\minetest\bin\..\mods\fertiliser\init.lua:154>

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Tue Oct 14, 2014 17:39
by MTDad
balthazariv, it comes down to a ":" vs a "."

line 6 of the fertiliser/init.lua
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
         farming:generate_tree(pos, def[4][1], def[4][2], def[4][3], def[4][4])

change it to
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
         farming.generate_tree(pos, def[4][1], def[4][2], def[4][3], def[4][4])

and it works.
Do that and it will no longer work for older versions of farming/farming_plus that used the ":" version.

Fun little mod to play with, but it didn't work on moretrees or jungle trees for me. No crash, just no fertiliser application (no removal from the stack). I'm not sure about the recipe, I'd think about changing it to bones from the animals mod and tree leaves or something renewable like that. How do you get bones:bones anyways? I resorted to a giveme.

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Tue Oct 14, 2014 17:49
by Esteban
MTDad wrote: How do you get bones:bones anyways? I resorted to a giveme.


The bones in the default game are obtained when you die. In vanilla Minetest, when you die, your items are left inside the bones in the exact position where you died.

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Tue Oct 14, 2014 18:37
by MTDad
Esteban wrote:
MTDad wrote: How do you get bones:bones anyways? I resorted to a giveme.


The bones in the default game are obtained when you die. In vanilla Minetest, when you die, your items are left inside the bones in the exact position where you died.


Right, but that doesn't give you a bones item you can use to craft the small bones this mod uses, at least it doesn't for me.

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Tue Oct 14, 2014 18:42
by Esteban
minermoder27 wrote:...
Craft 1 bone block to make 9 bones.

craft 8 dirt with 1 bone in the center to make 9 fertiliser.
...


I took a look at the code to see if there was a mistake:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_craft({
output = 'fertiliser:fertiliser 9',
recipe = {
{'default:dirt',   'default:dirt',   'default:dirt'},
{'default:dirt',   'bones:single_bone',   'default:dirt'},
{'default:dirt',   'default:dirt',   'default:dirt'},
},
})
minetest.register_craft({
output = 'bones:bones',
recipe = {
{'bones:single_bone', 'bones:single_bone', 'bones:single_bone'},
{'bones:single_bone', 'bones:single_bone', 'bones:single_bone'},
{'bones:single_bone', 'bones:single_bone', 'bones:single_bone'},
},
})
minetest.register_craft({
type = 'shapeless',
output = 'bones:single_bone 9',
recipe = {'bones:bones'},
})


But I don't see anything wrong...

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Tue Oct 14, 2014 18:58
by balthazariv
MTDad wrote:balthazariv, it comes down to a ":" vs a "."

line 6 of the fertiliser/init.lua
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
         farming:generate_tree(pos, def[4][1], def[4][2], def[4][3], def[4][4])

change it to
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
         farming.generate_tree(pos, def[4][1], def[4][2], def[4][3], def[4][4])

and it works.


Thanks now it works

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Wed Oct 15, 2014 12:23
by Xanthin
MTDad wrote:[...] but it didn't work on moretrees or jungle trees for me. No crash, just no fertiliser application (no removal from the stack).

Seems like the support for jungle trees and the moretrees mod was removed from the mod with the latest update.

MTDad wrote:How do you get bones:bones anyways? I resorted to a giveme.

Like Esteban said, but in singleplayer you don´t get bones when your character dies.

MTDad wrote:I'm not sure about the recipe [...]

Yes, I also changed the recipe, not only because of the limitation in singleplayer to get the bones, just don´t like the idea to use bones for food :) I prefere a compost with
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
        {'',            'group:leaves',                  ''},
        {'group:leaves',   'default:apple',      'group:leaves'},
        {'default:dirt',   'default:dirt',         'default:dirt'},
.

And thank you for your fix.

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Wed Oct 15, 2014 15:13
by MTDad
This is all very puzzling to me, maybe something's changed in bones recently, or my version of minetest or bones doesn't work right. Singleplayer or Server (we have a family server we play together on), if you die, yes bones appear on the map, where you died, containing your items. When you collect those bones, you get no bones as an item in your inventory, you get your items. Oh well.

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Thu Oct 16, 2014 13:30
by Xanthin
Geez! How silly, of course there are bones even in singleplayer. I am so used to have creative mod on when I use the singleplayer. Should have looked into the bones file before. Excuse me.
Now I saw what you mean and found that there was this commit for the bones mod in minetest_game.
I commented lines 80-82. Now, if you punch at the bones you instantely get all your items back in your inventory and the bones stay, so you can pick them up.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
      --[[ remove bones if player emptied them
      if has_space then
         minetest.remove_node(pos)
      end]]
   end,

But if you take item per item out of the bones they still dissapear. I commented lines 52-57 and they stay.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
   --[[on_metadata_inventory_take = function(pos, listname, index, stack, player)
      local meta = minetest.get_meta(pos)
      if meta:get_inventory():is_empty("main") then
         minetest.remove_node(pos)
      end
   end,]]


Oh, and maybe you want to look at this removed line. I dont no why it was removed, it seems to me practical to get a chat message with the coordinates where you died.

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Thu Oct 16, 2014 23:17
by minermoder27
IDK why they got rid of it. Will have to look into a workaround for the bones.

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Sun May 31, 2015 11:51
by Damien
Sorry for the necro bump,I meant to ask:
Does this fertiliser also enchance the growth of grass and flowers?Also,what about the bone block?In the vanilla game it isn't obtainable if not through commands and creative,is it available in this or the farming_plus modification?

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Thu Jun 11, 2015 07:26
by minermoder27
MTDad wrote:balthazariv, it comes down to a ":" vs a "."

line 6 of the fertiliser/init.lua
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
         farming:generate_tree(pos, def[4][1], def[4][2], def[4][3], def[4][4])

change it to
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
         farming.generate_tree(pos, def[4][1], def[4][2], def[4][3], def[4][4])

and it works.
Do that and it will no longer work for older versions of farming/farming_plus that used the ":" version.

Fixed.

Xanthin wrote:
MTDad wrote:I'm not sure about the recipe [...]

Yes, I also changed the recipe, not only because of the limitation in singleplayer to get the bones, just don´t like the idea to use bones for food :) I prefere a compost with
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
        {'',            'group:leaves',                  ''},
        {'group:leaves',   'default:apple',      'group:leaves'},
        {'default:dirt',   'default:dirt',         'default:dirt'},
.

Damien wrote:Also,what about the bone block?In the vanilla game it isn't obtainable if not through commands and creative,is it available in this or the farming_plus modification?

Added Xanthin's craft recipie by default, because of the new bone logic.

Re: [Mod] Fertiliser [0.1] [fertiliser]

PostPosted: Sun Jun 14, 2015 02:52
by minermoder27
Xanthin wrote:
MTDad wrote:[...] but it didn't work on moretrees or jungle trees for me. No crash, just no fertiliser application (no removal from the stack).

Seems like the support for jungle trees and the moretrees mod was removed from the mod with the latest update.


Moretrees support has been re-added in the latest version.
The reason why I removed it to start with was that there are no hooks in plant_life that support growing of trees. This meant that I wrote my own hooks, but then there were updates, and so it got ugly. It now scans through minetest.registered_abms to find the functions it needs.