Page 1 of 2

[MOD] Fishing! [v0.2][fishing]

PostPosted: Tue Jan 08, 2013 20:51
by wulfsdad
Image

Includes:
a fish (can be cooked or eaten raw),
fishing poles,
worm (bait),
sushi

To get worms for bait you must dig in dirt (without grass) by hand. There is a default 30% chance that you will find one. This can be configured in init.lua, as well as the chance of catching a fish. Or, you can use "/giveme fishing:bait_worm".

To catch a fish, use a baited fishing pole on a water node.

Depends:
To craft a fishing pole: (or you can use "/giveme fishing:pole")
ropes or moreblocks or farming
I suggest using my modified version of ropes. Get it here.
This also modifies moreblocks:rope to be used as ropes:rope -- which is really handy.
To craft sushi: (or you can use "/giveme fishing:sushi")
plantlife

Download:
[v0.1]
[v02p

Recipes:
Image

Image

Image

Code:WTFPL
Textures:
<http://www.planetminecraft.com/texture_pack/wolfhound/>

TODO:
item wear,
automatic re-baiting option,
different types of fish/sushi,
sounds,
nets and traps

PostPosted: Tue Jan 08, 2013 20:54
by LorenzoVulcan
+1

PostPosted: Tue Jan 08, 2013 20:58
by wulfsdad
Ropes with my Code Modification: download. But, with original texture--not the one shown in screenshot above.

PostPosted: Tue Jan 08, 2013 21:23
by 4aiman
+1
If only we could see a string...

edit:
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
01:27:32: VERBOSE[main]: error_message = ServerError: LuaError: error: ...ames/minimal (copy)/mods/addin_mods/fishing/init.lua:54: bad argument #1 to 'get_node' (table expected, got nil)
:'(

PostPosted: Tue Jan 08, 2013 23:07
by wulfsdad
4aiman wrote:
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
01:27:32: VERBOSE[main]: error_message = ServerError: LuaError: error: ...ames/minimal (copy)/mods/addin_mods/fishing/init.lua:54: bad argument #1 to 'get_node' (table expected, got nil)
:'(


I'll try to reproduce the error and find a solution. What did you do before getting that error?

PostPosted: Tue Jan 08, 2013 23:12
by 4aiman
Got a rod, got 99 worms, crafted rod with worm and pressed right mouse button on a water block.
Ropes wasnt sufficient so I have both them and moreblocks. Could that be the reason?

PostPosted: Tue Jan 08, 2013 23:36
by wulfsdad
4aiman wrote:Got a rod, got 99 worms, crafted rod with worm and pressed right mouse button on a water block.
Ropes wasnt sufficient so I have both them and moreblocks. Could that be the reason?


No, I have both ropes and moreblocks installed, so that's not the problem. When I right-clicked, I threw the rod into the water. But I did reproduce the error message by left-clicking in the air. I think the problem is when the on_use() function is passed nil for it's pointed_thing parameter. ... Ok, I think I solved the problem by modifying the baited pole's on_use function 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
     on_use = function (itemstack, user, pointed_thing)
        if pointed_thing and pointed_thing.under then
            local node = minetest.env:get_node(pointed_thing.under)
            if string.find(node.name, "default:water") then
                if math.random(1, 100) < FISH_CHANCE then
                    local inv = user:get_inventory()
                    if inv:room_for_item("main", {name="fishing:fish_raw", count=1, wear=0, metadata=""}) then
                        inv:add_item("main", {name="fishing:fish_raw", count=1, wear=0, metadata=""})
                    end
                end
                return {name="fishing:pole", count=1, wear=0, metadata=""}
            end
        end
        return nil
    end,


I'll replace v0.1 in a moment, but you can just copy and paste this instead of downloading it again, if you wish.

---------------------------
I posted a video of the fishing mod in action on YouTube.


EDIT: Upload of bug-fix complete.

PostPosted: Tue Jan 08, 2013 23:56
by 4aiman
Now it's "Ok".
+1 more ;)

Is it possible to not have to "point" at the water node? I mean It would be nice to have a... bobber (or a "float"? I don't know an English equivalent to "поплавок"... Google isn't helping at all too.)
Player can "throw" that using scheme from "throwing" mod and if that lands in water then he need to wait some random time before the bobber goes underwater and then he must pull (rightclick).
If you're up to it I can provide some more details ;)

PostPosted: Wed Jan 09, 2013 00:57
by wulfsdad
4aiman wrote:Is it possible to not have to "point" at the water node? I mean It would be nice to have a... bobber (or a "float"? I don't know an English equivalent to "поплавок"... Google isn't helping at all too.)
Player can "throw" that using scheme from "throwing" mod and if that lands in water then he need to wait some random time before the bobber goes underwater and then he must pull (rightclick).
If you're up to it I can provide some more details ;)


Thanks for helping me find that bug!

Yeah, I think that would be possible. But, It would take me a while to code and I wanted to avoid the necessity of waiting while fishing. If I include it it will be optional so that you can change the way it works back and forth easily.

PostPosted: Wed Jan 09, 2013 02:08
by Josh
Awesome! Just epic, been wondering if a fishing rod would be possible. +1 :D

PostPosted: Wed Jan 09, 2013 02:13
by jojoa1997
maybe if your bobber hits land you could pull yourself there like using the middle button or right-click

PostPosted: Wed Jan 09, 2013 02:54
by 0gb.us
jojoa1997 wrote:maybe if your bobber hits land you could pull yourself there like using the middle button or right-click


Nah, that sounds too much like a grappling hook. Speaking of which, someone might be willing to build a Minetest grappling hook. It probably wouldn't be good for servers, but it might be interesting in single player mode.

PostPosted: Wed Jan 09, 2013 11:53
by 4aiman
Grappling hook you say?.. That reminds me of the Batman 8)
If I remember correctly we can bind entities together since not so long ago... I'll be back soon enough ;)

PS: configurable = awesome!

PostPosted: Fri Jan 11, 2013 00:56
by wulfsdad
4aiman wrote:PS: configurable = awesome!


I agree. Customization is a cornerstone of good software, that's why I love this game and why I use Linux.

I'm about to upload a new version with some small fixes. I forgot to check if other mods were installed before using them so they effectively become dependencies. I fixed that. I also added support for farming mod's strings. Two strings and two sticks will make a fishing pole. I'm just going to double check everything and then upload it. I'll edit this post when its done.

[EDIT:]
Ok v0.2 is up; I also added to ropes to be able to craft them from farming strings. But, I'll upload that some other time... I got lots of homework to do.

PostPosted: Fri Jan 11, 2013 15:02
by batami
Not work for me . Help

PostPosted: Fri Jan 11, 2013 15:59
by wulfsdad
batami wrote:Not work for me . Help


What went wrong?



----------------
I just uploaded the new modified ropes and added a link to the original post.

PostPosted: Mon Feb 11, 2013 19:52
by Sokomine
Help! Rainworms keep to fill up my inventory. Can you make it so that they will disappear when placed on dirt_with_grass or dirt? Living worms ought to try to dig themshelves back in :-)

PostPosted: Tue Feb 12, 2013 16:21
by wulfsdad
Sokomine wrote:Help! Rainworms keep to fill up my inventory. Can you make it so that they will disappear when placed on dirt_with_grass or dirt? Living worms ought to try to dig themshelves back in :-)

Ok, That's a good idea. You can also /destroy them. I'll add that after I finish my homework.

PostPosted: Tue Feb 12, 2013 22:05
by ray8888
this is cool now i want to test it +1

PostPosted: Fri May 24, 2013 20:26
by Mossmanikin
Like it!

PostPosted: Sat May 25, 2013 17:24
by Sokomine
Any progress on the rainworms? Also, it might be nice if fishing took a while, although I don't know how that could be accomplished in a convincing way :-( Maybe "plant" the fishing rod at the shore and make it change color/give it an animated texture once a fish got cought?

PostPosted: Tue Jun 18, 2013 20:10
by ndjdjksisksk
this mod will not run! i tried it and it said that there was an error and it will not let me play the game until i take the mod off. please help.

PostPosted: Tue Jun 18, 2013 20:19
by VanessaE
Post the exact text of the error message.

PostPosted: Wed Jun 19, 2013 21:07
by ndjdjksisksk
VanessaE wrote:Post the exact text of the error message.

how do i do that in a windows 8 cmd command line prompt? i can't copy and past i have tried that.

PostPosted: Wed Jun 19, 2013 21:19
by Mossmanikin
ndjdjksisksk wrote:
VanessaE wrote:Post the exact text of the error message.

how do i do that in a windows 8 cmd command line prompt? i can't copy and past i have tried that.


You can copy it from .../bin/debug.txt

PostPosted: Wed Jun 19, 2013 21:56
by ndjdjksisksk
ok thanks here is the error :

16:34:43: ERROR[main]: ========== ERROR FROM LUA ===========
16:34:43: ERROR[main]: Failed to load and run script from
16:34:43: ERROR[main]: C:\Users\ian\Desktop\minetest-0.4.7-7734717-sounds-win32\bin\..\games\minetest_game\mods\domb\init.lua:
16:34:43: ERROR[main]: ...unds-win32\bin\..\games\minetest_game\mods\domb/domb.lua:365: invalid escape sequence near '"[DOM]DOM_util, use '
16:34:43: ERROR[main]: stack traceback:
16:34:43: ERROR[main]: [C]: in function 'dofile'
16:34:43: ERROR[main]: ...unds-win32\bin\..\games\minetest_game\mods\domb\init.lua:4: in main chunk
16:34:43: ERROR[main]: =======END OF ERROR FROM LUA ========

PostPosted: Wed Oct 23, 2013 02:54
by DaN
You should add a depends.txt.

PostPosted: Wed Oct 23, 2013 10:50
by Evergreen
DaN wrote:You should add a depends.txt.
Try Mossmanikin's fishing mod, he based it off this one, and it is very nice.

Re: [MOD] Fishing! [v0.2][fishing]

PostPosted: Mon Sep 15, 2014 00:07
by RebelD
any of the fishing mods that work for multiplayer cause in multiplayer it doesn't really seem to work :/

Re: [MOD] Fishing! [v0.2][fishing]

PostPosted: Mon Sep 15, 2014 07:57
by TenPlus1
Ethereal mod has a built in fishing feature that's simple and works fine on multiplayer servers...

https://forum.minetest.net/viewtopic.php?f=11&t=7656&start=150#p153693