[Mod] Throwing Redo [throwing]

Post Reply
User avatar
Palige
Member
Posts: 105
Joined: Sun Nov 23, 2014 14:39
GitHub: paly2
IRC: Upsilon
In-game: Upsilon
Contact:

[Mod] Throwing Redo [throwing]

by Palige » Post

A new implementation of throwing with a cleaner code and providing an API in order to be extendable.

Throwing mod by PilzAdam
Throwing mod by Jeija

This mod is able to replace both throwing mods above without issues (if you name its directory throwing, the itemstrings remain the same).

This mod is actively tested on the Eurythmia server.

GitHub repository (includes issue tracker)

Download
(Also available in .tar.gz)

Configuration and API documentation

Dependencies: default and farming (both included in the minetest game, you don't need to install them)
License for code: MPL-2.0
License for textures: Same as for the textures of the throwing mod by PilzAdam (WTFPL).


Bows:
  • Wooden Bow
  • Stone Bow
  • Steel Bow
  • Bronze Bow
  • Mese Bow
  • Diamond Bow
Arrows:
  • Arrow
  • Golden Arrow
  • Dig Arrow
  • Admin Dig Arrow
  • Teleport Arrow
  • Torch Arrow
  • Build Arrow
  • Drop Arrow
Last edited by Palige on Mon Jun 12, 2017 09:18, edited 6 times in total.
Sorry for my english : I am french...

Some of my minetest stuff:
MoreMesecons
Throwing Redo
PvP-Plus
A few other things

I'm hosting the Eurythmia server

User avatar
yzelast
Member
Posts: 54
Joined: Sun Oct 02, 2016 01:18
GitHub: yzelast
In-game: yzelast
Location: Far Far Away

Re: [Mod] Throwing Redo [throwing]

by yzelast » Post

Interesting.But when i get hitted by an arrow the game crashes with the following error:

init.lua 66: attempt to call method "get_player_name" (a nil value)
Last edited by yzelast on Sat Jan 07, 2017 18:15, edited 1 time in total.
G84mU6AQ9dKaNhxn6dq8P5C0y5r8NssE

User avatar
Palige
Member
Posts: 105
Joined: Sun Nov 23, 2014 14:39
GitHub: paly2
IRC: Upsilon
In-game: Upsilon
Contact:

Re: [Mod] Throwing Redo [throwing]

by Palige » Post

yzelast wrote:Interesting.But when i het hitted by an arrow the game crashes with the following error:

init.lua 66: attempt to call method "get_player_name" (a nil value)
Sorry for this bug ! Now fixed ;-)
Thank you for testing !
Sorry for my english : I am french...

Some of my minetest stuff:
MoreMesecons
Throwing Redo
PvP-Plus
A few other things

I'm hosting the Eurythmia server

Martno
Member
Posts: 80
Joined: Thu May 28, 2015 07:09
Location: Hungary

Re: [Mod] Throwing Redo [throwing]

by Martno » Post

I tested it a little, and it seems working great with mods redo. Cool.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Throwing Redo [throwing]

by texmex » Post

Nice mod! Some bugs though:

• Arrows are placeable. Becomes black and not digable.
• Torch arrow puts all torches upside down, regardless of landing surface direction. Minetest 0.4.15 with new 3d torches.
• Teleport arrow sometimes crash the client (but not the server). Sorry for no log this time.

User avatar
Palige
Member
Posts: 105
Joined: Sun Nov 23, 2014 14:39
GitHub: paly2
IRC: Upsilon
In-game: Upsilon
Contact:

Re: [Mod] Throwing Redo [throwing]

by Palige » Post

texmex wrote:Nice mod! Some bugs though:

• Arrows are placeable. Becomes black and not digable.
• Torch arrow puts all torches upside down, regardless of landing surface direction. Minetest 0.4.15 with new 3d torches.
• Teleport arrow sometimes crash the client (but not the server). Sorry for no log this time.
Thank you very much for these reports!

The first bug is now fixed. A new setting has been added (defaulting to false): throwing.allow_arrow_placing. If it's true, the arrow can be placed as a normal node (now diggable and coloured). If it's false, the arrow cannot be placed.

The second bug looks really hard to fix. I have replaced minetest.set_node by minetest.place_node, so that the torch is now placed vertically. However, now, it can only be placed if there is a non-air node under it, because it's an attached node (if it cannot be placed in non-creative mode, of course the torch goes back to your inventory).

I tried to reproduce the last bug, but the teleport arrow never crashes for me...
Sorry for my english : I am french...

Some of my minetest stuff:
MoreMesecons
Throwing Redo
PvP-Plus
A few other things

I'm hosting the Eurythmia server

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Throwing Redo [throwing]

by texmex » Post

Sweet!

The teleport arrow bug could possibly have been triggered by moving fast and shooting the arrow into unloaded territory…

User avatar
Palige
Member
Posts: 105
Joined: Sun Nov 23, 2014 14:39
GitHub: paly2
IRC: Upsilon
In-game: Upsilon
Contact:

Re: [Mod] Throwing Redo [throwing]

by Palige » Post

texmex wrote:The teleport arrow bug could possibly have been triggered by moving fast and shooting the arrow into unloaded territory…
No crash for me :/
Sorry for my english : I am french...

Some of my minetest stuff:
MoreMesecons
Throwing Redo
PvP-Plus
A few other things

I'm hosting the Eurythmia server

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Throwing Redo [throwing]

by texmex » Post

Palige wrote:No crash for me :/
Perhaps a freak event :)

I wonder, could this mod be made to extend player's item drop feature? So that you may throw items longer, to a buddy on another cliff perhaps.

User avatar
Palige
Member
Posts: 105
Joined: Sun Nov 23, 2014 14:39
GitHub: paly2
IRC: Upsilon
In-game: Upsilon
Contact:

Re: [Mod] Throwing Redo [throwing]

by Palige » Post

texmex wrote:I wonder, could this mod be made to extend player's item drop feature? So that you may throw items longer, to a buddy on another cliff perhaps.
Yeah, definitely, this can be done in 15 lines using the mod API ! And that's a great idea, I'm implementing it
Sorry for my english : I am french...

Some of my minetest stuff:
MoreMesecons
Throwing Redo
PvP-Plus
A few other things

I'm hosting the Eurythmia server

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Throwing Redo [throwing]

by texmex » Post

Palige wrote:Yeah, definitely, this can be done in 15 lines using the mod API ! And that's a great idea, I'm implementing it
That's great! Because one should be able to…
Spoiler
Image

User avatar
Palige
Member
Posts: 105
Joined: Sun Nov 23, 2014 14:39
GitHub: paly2
IRC: Upsilon
In-game: Upsilon
Contact:

Re: [Mod] Throwing Redo [throwing]

by Palige » Post

texmex wrote:I wonder, could this mod be made to extend player's item drop feature? So that you may throw items longer, to a buddy on another cliff perhaps.
Done (in 20 lines)!
The dropped item is the item next to the arrow in the inventory.
The drop arrow can be crafted using a copper ingot (because I had no better idea...)
Last edited by Palige on Tue Jan 17, 2017 20:11, edited 1 time in total.
Sorry for my english : I am french...

Some of my minetest stuff:
MoreMesecons
Throwing Redo
PvP-Plus
A few other things

I'm hosting the Eurythmia server

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Throwing Redo [throwing]

by texmex » Post

Tested it. The feature I hade in mind would extend the native Q key drop function. Perhaps throwing it longer the longer keypress before release. But I wasn't very clear at all, and drop arrow is cool and useful too!

User avatar
Palige
Member
Posts: 105
Joined: Sun Nov 23, 2014 14:39
GitHub: paly2
IRC: Upsilon
In-game: Upsilon
Contact:

Re: [Mod] Throwing Redo [throwing]

by Palige » Post

texmex wrote:Tested it. The feature I hade in mind would extend the native Q key drop function. Perhaps throwing it longer the longer keypress before release. But I wasn't very clear at all, and drop arrow is cool and useful too!
Unfortunately, this is not possible, because the Minetest API does not provide any way to know whether a player is pressing the Q key (the only keys that the API can tell about are these ones).
Last edited by Palige on Mon Apr 03, 2017 19:09, edited 2 times in total.
Sorry for my english : I am french...

Some of my minetest stuff:
MoreMesecons
Throwing Redo
PvP-Plus
A few other things

I'm hosting the Eurythmia server

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Throwing Redo [throwing]

by texmex » Post

Palige wrote:Unfortunately, this is not possible, because the Minetest API does not provide any way to know whether a player is pressing the Q key (the only keys that the API can tell are those).
Oh, i see. Well, at least I can start of my sneak key based mod based on this information.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Throwing Redo [throwing]

by texmex » Post

Built my Sling mod with this API. Good stuff!

User avatar
Steamed_Punk
Member
Posts: 156
Joined: Sat Aug 10, 2019 13:31
GitHub: steamed-punk

Re: [Mod] Throwing Redo [throwing]

by Steamed_Punk » Post

I just thought i would let you know that your mod README.lua states that:
* throw_itself (optional): whether the bow should throw itself instead of the arrow next to it in the inventory.
If present, allow_shot is ignored.
Default is false.
*Warning*: this field is not known to be currently used by a mod. If you encounter bugs using it, please open
an issue!
This is no longer the case. My mod contains a Tomahawk that can be thrown using the "throw_self" option.
Even if i wasn't the first to use this option i would still like to say "Merci"! Your mod works and does exactly what i need. This could be used for spears, rocks and why not water fights :D the possibilities are almost endless.
The sky is not the limit - It's my playground

User avatar
Palige
Member
Posts: 105
Joined: Sun Nov 23, 2014 14:39
GitHub: paly2
IRC: Upsilon
In-game: Upsilon
Contact:

Re: [Mod] Throwing Redo [throwing]

by Palige » Post

Steamed_Punk wrote:This is no longer the case. My mod contains a Tomahawk that can be thrown using the "throw_self" option.
Even if i wasn't the first to use this option i would still like to say "Merci"! Your mod works and does exactly what i need. This could be used for spears, rocks and why not water fights :D the possibilities are almost endless.
Thanks! I've updated the README.md, and added mention of your mod :D
Sorry for my english : I am french...

Some of my minetest stuff:
MoreMesecons
Throwing Redo
PvP-Plus
A few other things

I'm hosting the Eurythmia server

User avatar
Steamed_Punk
Member
Posts: 156
Joined: Sat Aug 10, 2019 13:31
GitHub: steamed-punk

Re: [Mod] Throwing Redo [throwing]

by Steamed_Punk » Post

Palige wrote:
Steamed_Punk wrote:This is no longer the case. My mod contains a Tomahawk that can be thrown using the "throw_self" option.
Even if i wasn't the first to use this option i would still like to say "Merci"! Your mod works and does exactly what i need. This could be used for spears, rocks and why not water fights :D the possibilities are almost endless.
Thanks! I've updated the README.md, and added mention of your mod :D
Thanks for the mention i really appreciate it, although it wasn't necessary.
The sky is not the limit - It's my playground

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 18 guests