Page 1 of 7

[Mod] Farming [0.1.8]

PostPosted: Wed Dec 21, 2011 08:11
by sapier
Hello

Farming mod adds farming as in minecraft. You can convert dirt/grass nodes into plowed land and plant seeds. Seeds will grow while beeing in full sunlight and finaly get harvestable.

Usage:

-create a hoe (same reciep as in minecraft)
wood wood
none stick
none stick
Image

-plow dirt with grass to get seed

-place seed on plowed dirt

-wait some time for wheat to grow (it only grows when it has enough light)

-harvest using hoe

Depends on flowers mod included in nature_pack
nature_pack

License: GPLv2+

Link:
Version 0.0.2
Version 0.0.3
Version 0.0.4
Version 0.0.5
Version 0.0.6
Version 0.0.7
Version 0.0.8
Version 0.0.9
Version 0.1.0
Version 0.1.1
Version 0.1.2
Version 0.1.3
Version 0.1.4
Version 0.1.5
Version 0.1.6
Version 0.1.8

Changes 0.0.3:
-Added stone and steel hoe
-added rhy

Changes 0.0.4:
-major code cleanup
-initial inteface for other mods to add own crops
-add water dependent grow / dry of seed
(It's not a bug, seeds without water but without sun won't dry out, but not grow either)

Changes 0.0.5
-get seeds from jungle grass, tallgrass, and seldom from grass on dirt
-added potatoes
-improoved graphics

Changes 0.0.6
-fixed bug discovered by dannydark, crash on hiting crop with pure hand

Changes 0.0.7
-harvestable crop is now a node instead of entity so at least those will be there after deleting objects
-added straw, you always get straw when harvesting, but only crop and seed if using a hoe!

Changes 0.0.8
-fixed bug not having any chance to get rhy seed

Changes 0.0.9
-added corn

Changes 0.1.0
-improved api to support textures saved within external mod folder

Changes 0.1.1
-added mese hoe
-plowed land reverts to dirt within at max 5 minutes

Changes 0.1.2
-improoved plowed land -> dirt algorithm (thanks to Hackeridze)

Changes 0.1.3
-major code reorganization removing some possible performance problems

Changes 0.1.4
-added workaround to fix crops growing on dirt/grassland when entities disappeared for some time

Changes 0.1.5
-fixed hoe's not beeing damaged
-added missing mesehoe texture

Changes 0.1.6
-updated to new item system

Changes 0.1.8
-fixed plowed dirt got diggable with last version
-fixed plowed dirt reverting on crop was harvestable


Graphics:
Obviously the Graphics are really ugly so if anyone can supply better graphics, you're welcome ;-)
By the way you may use graphics from minecraft as I do in private but as I don't have copyrights for them I can't provide those ones ;-(

Screenshot fields
Image

Screenshot with mc textures (wheat only rhy isn't available in mc)
http://www.mediafire.com/i/?oqv5dhl2k8z7a2c

PostPosted: Wed Dec 21, 2011 08:51
by darket
Where is screenshots?

PostPosted: Wed Dec 21, 2011 11:49
by darket

PostPosted: Wed Dec 21, 2011 12:23
by Jordach
sapier wrote:Hello

I've created a farming mod, currently only with wood hue and wheat, but it's planed to make tools more generic and add other growing things too.

Usage:

-create a hue (same reciep as in minecraft)
wood stick
none stick
none stick

-plow dirt with grass to get seed

-place seed on plowed dirt

-wait some time for wheat to grow (it only grows when it has enough light)

-harvest using hue


Link:

http://d01.megashares.com/dl/97f3661/farming-0.0.1.zip

Graphics:
If anyone can supply better graphics, you're welcome ;-)


Planed features:
-make growing dependent of water nearby
-fix bug hue not weared out on use (does anyone know why


It's hoes, not hues.

PostPosted: Wed Dec 21, 2011 13:02
by Calinou
First, please add screenshots - 90% of people will not download some content (mod/texturepack/whatever) without a screenshot, sometimes assuming the download would be a virus.

Secondly, the recipe in Minecraft is more like this:
http://minecraftwiki.net/wiki/Hoe

Also, avoid using that hosting site - try http://mediafire.com or http://omploader.org instead.

PostPosted: Wed Dec 21, 2011 13:14
by sapier
First of all thanks for your suggestions

I haven't played mc for a while I'll fix the hoe reciep.

And upload to another source (just took the first file sharing site google found).
And add screenshots.

I've already fixed hoes in my first post ;-)

PostPosted: Wed Dec 21, 2011 18:23
by Hackeridze
I made a wheat mod, but without hoe, so may I steal it from your mod?

PostPosted: Wed Dec 21, 2011 19:27
by MrThebuilder3
i like it:)

PostPosted: Wed Dec 21, 2011 19:43
by sapier
Of course you may use the hoe, but you can use my mod too ;-)

I'm going to add some other crops soon. I intended it to be a base for either improove baking mod or write a new one.

PostPosted: Thu Dec 22, 2011 07:17
by Hackeridze
Nemo08 make hoes for me, here they are
dl.dropbox.com/u/28862246/hoe.zip

But thanks)

You may steal all-that-you-want from my code) I will add growing dependent of water nearby in next version)
http://c55.me/minetest/forum/viewtopic.php?id=574 here you can download rtmmp and find wheat in "wheat" dirrectory

PostPosted: Thu Dec 22, 2011 19:00
by sapier
I've been first ;-), already added water dependent grow in 0.0.4 ;-)

What about joining forces rather than start a feature race?

PostPosted: Fri Dec 23, 2011 18:54
by dannydark
Great mod! ^_^ only issue I do have is if someone uses the /clearobjects command it also clears all crops :(

EDIT: Also it would be nice to have the crops drawn plantlike (crossed) if thats possible?

EDIT 2: I've just found a bug, when you hit crops with your fist it crashes the server:
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
20:16:10: ERROR[ServerThread]: ERROR: An unhandled exception occurred: LuaError: error running function 'on_punch': ...home/minetest/bin/../data/mods/farming/init.lua:174: attempt to index local 'tool' (a nil value)
20:16:10: ERROR[ServerThread]: stack traceback:

In thread 7ff96b548700:
/home/minetest/source/src/server.cpp:99: virtual void* ServerThread::Thread(): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 7ff96b548700:
#0  virtual void* ServerThread::Thread()
(Leftover data: #1  void Server::Receive())
(Leftover data: #2  void Server::ProcessData(irr::u8*, irr::u32, irr::u16))
(Leftover data: #3  RemoteClient* Server::getClient(irr::u16))
(Leftover data: #4  void BlockEmergeQueue::addBlock(irr::u16, v3s16, irr::u8))
DEBUG STACK FOR THREAD 7ff96d351720:
#0  int main(int, char**)
#1  void dedicated_server_loop(Server&, bool&)
(Leftover data: #2  void Server::step(float))

PostPosted: Fri Dec 23, 2011 20:23
by sapier
I'm sorry but I think by now I can't fix either of the problems you mentioned.
I think both depend on the same thing.

1) All crops growing are luaentitys. I think cleanobjects removes all entitys so crops are gone

2) entities currently do only have two visual modes: cube(without any transparency) or sprite(the one used by now)

Probably it would be a nice feature request to add drawing visual "plant"

PostPosted: Fri Dec 23, 2011 21:28
by dannydark
hmmmm.... that makes sense, maybe there is another way to do crops other than using entities?

Also what about my 2nd edit with regards to the bug that crashes the server on punching crops with fists?

PostPosted: Fri Dec 23, 2011 21:41
by sapier
Already fixed in 0.0.6

The problem is i use "on_step" to grow the crops and two internal variables. One to decide if it's time to grow and one to decide time to dry.

Nodes neither do have an on_step hook nor is it possible to add own variables.

To solve this problem I would have to use the global on_step and store all data in global data structures.
Thats possible... but in my opinon ugly and most likely to be buggy.

PostPosted: Fri Dec 23, 2011 21:49
by dannydark
ah ok fair enough ^_^, thanks for the fix updated to 0.0.6 now.

Also only a minor thing but the mod loaded string that gets printed to the console has a typo.

PostPosted: Fri Dec 23, 2011 22:03
by sapier
ooops :-) fixed the typo localy but won't release a new version by now ;-)

I do hope entities get (at least) a new draw mode plantlike in a later minetest versions ;-)

PostPosted: Fri Dec 23, 2011 22:51
by dannydark
and maybe a way to exclude them from the /clearobjects command ^_^

PostPosted: Sat Dec 24, 2011 09:59
by Hackeridze
In my wheat mod i use nodes, and it's looks and work flawlessly. But no on_step.

PostPosted: Sat Dec 24, 2011 11:48
by sapier
It's just a matter of personal preference.

As I expected the changes in minetest are really small to support plantlike entities:

Image

For the brave ones you need this patches:

texture transparency patch for entities
http://www.mediafire.com/?8xxzdcvxs56ze3z

plant visual mode patch
http://ompldr.org/vYndhMw

And you have to change visual for the entities from "sprite" to "plant" in init.lua


@Hackeridze
You neither do use fixed intervals for growing nor do you have a hoe ;-). And of course no potatoes ;)

PostPosted: Sat Dec 24, 2011 14:19
by Hackeridze
Hoe is in 0,4 with random wheat growing :P

PostPosted: Sat Dec 24, 2011 17:10
by sapier
By now it's a "will be" for 0.4.
What about a christmas release? ;-)

PostPosted: Sat Dec 24, 2011 17:25
by Hackeridze
sapier wrote:By now it's a "will be" for 0.4.
What about a christmas release? ;-)

It "will be" on monday, for now i have no computer with internet and forking for mods documentation.

PostPosted: Sat Dec 24, 2011 22:24
by sapier
@dannydark found a partial solution for your delete objects problem
Harvestable crops don't need an on_step action anymore therefore those can be nodes.

The caveeat is to force users to use the hoe for harvesting I had to add straw ... at least you can burn it ;-)

PostPosted: Sun Dec 25, 2011 01:03
by dannydark
@sapier nice one mate just updated on my server works great, I don't tend to use the /clearobjects too often anyway but at least if I do now it won't remove peoples harvest-able crops ^_^ also I like the straw idea.

Happy Christmas.

PostPosted: Mon Dec 26, 2011 01:35
by sapier
Sorry to all of you desperatly looking for rhy seed, due to a bug in randomization you didn't have any chance in getting it in 0.0.7.

PostPosted: Thu Dec 29, 2011 00:37
by sapier
Added corn too ;-)

PostPosted: Thu Dec 29, 2011 02:24
by Hackeridze
sapier wrote:Added corn too ;-)
Hey! You steal my idea! In RTMMP corn is ready coming with 0.4.1

PostPosted: Thu Dec 29, 2011 03:28
by sapier
@Hackeridze thought you already had it?

By the way adding another crop is as simple as adding a line and drawing some textures in farming mod. Probably you might consider switching rtmmp to mod farming for crops with staged growing ;-)

pumkins and crops like them still would need to be handled separatly.

PostPosted: Thu Dec 29, 2011 05:22
by Hackeridze
sapier wrote:@Hackeridze thought you already had it?

By the way adding another crop is as simple as adding a line and drawing some textures in farming mod. Probably you might consider switching rtmmp to mod farming for crops with staged growing ;-)

pumkins and crops like them still would need to be handled separatly.

Yes i had it. in 0.4 it is experimental added, but yesterday i finished the release version of it with recipes and it comes inRTMMP 0.4.1