Page 1 of 2

[Mod] Spears [3.1] [spears]

Posted: Thu Oct 08, 2015 21:36
by Echoes91

Spears

This mod adds spears to Minetest games. They are versatile weapons that can be used to attack like a normal sword, even if slower, or safely thrown to the bad ones from the distance.
These are the spears introduced within throwing enhanced, now improved, and here is where I'll continue their development.

Image

Download from content DB - Minetest version 5.4.0 required

Run git clone https://gitlab.com/echoes91/spears.git from mods folder to clone the repository. Beware, mess in progress :)

Browse the code and report bugs

Dependencies: default

License:
Code under LGPLv2.1
Textures and sounds under CC-BY 3.0
Spoiler
  • Spears can be thrown using right mouse button, they either hurt someone or stick where they land on; damage depends on speed and material, flight trajectory is ballistic with (unrealistic) drag.
  • Spears can be used to fight, but are slower and weaker than swords.
  • Spears can be used to dig, but are slower and weaker and pickaxes.
  • If you miss the target it's your fault, the spear is fine.
  • You can grab a spear on the fly (or maybe wait until it falls?).
  • You can stick a spear into a block, but if you remove the block then the spear falls (obviously).
  • If you feel clever, throw a spear right above you and look at it to see what happens.
  • You can even throw a spear from above down to your foes, it's easier to hit.
  • Someone once reported to have hit its own foot but it takes practice to do that
  • This mod contains the word "spear" more than 100 times, if you want the exact number count them yourself.
Spoiler
All recipes work also horizontally mirrored. Any member of the same group can be used.

Image Stone spear: Lowest damage and resistance, easiest and cheapest to craft.
| | | stone |
| | stick | |
| stick | | |

Image Steel spear: Good damage and resistance, like steel tools.
| | | Steel ingot |
| | stick | |
| stick | | |

Image Copper spear: Softer than the steel one, but lasts longer.
| | | Copper ingot |
| | stick | |
| stick | | |

Image Bronze spear: Like bronze tools, it's as powerful as steel and lasts longer.
| | | Bronze ingot |
| | stick | |
| stick | | |

Image Obsidian spear: It deals the same damage of a diamond spear but last as long as a steel spear.
| | | Obsidian |
| | stick | |
| stick | | |

Image Diamond spear: Best damage and resistance, like diamond tools.
| | | Diamond |
| | stick | |
| stick | | |

Image Golden spear: A golden-plated celebratory spear, soft like copper but lasting as long as diamond.
| | | Gold ingot |
| | stick | |
| stick | | |
Spoiler
Version 3.0
  • First attempt to detect collisionboxes
  • Implemented settings through settingtypes.txt, deprecating "spears.conf"
Version 2.4
  • Functions rewrite, fixed many vector/variable declarations and unknown node handling
  • Added pigiron support
Version 2.3
  • Updated to Minetest 5.6.0 API
  • Changed receipts to avoid being confused with arrows
  • Various cleansing and fixes
Version 2.2
  • "Hit detection" based on spearhead position
  • Spears go through buildable_to nodes (snow)
  • Ugly fix to not collide in air above slabs (works only if slabs are not rotated)
Version 2.1
  • Spears ding hard blocks (cracky < 3)
  • Fixed stick-into-node position to avoid spears turning black (#2467)
  • Player velocity added to throw (it's physics baby)
Version 2.0
  • Cleaner, streamlined code without deprecated functions
  • Spears hurt players
  • Spears animated in flight
  • Spears stick into nodes
  • New textures
  • New sound when hitting flesh
  • New receipt to fit with default tools
  • Drag depends on fluid
  • Improved instructions
  • New gold-plated spear to celebrate
1.1
  • Update to make use of new API, requires Minetest version 5.2.0
1.0
  • First stable release
Spoiler
    • Spear stick into air if blocks have collision box smaller than 1x1x1
    • Spears fly through mobs meshes if passing too far from entity origin
    • Summing up, we need some way to detect collision boxes
Have fun!

Re: [Mod] Spears [alpha1] [spears]

Posted: Fri Oct 09, 2015 11:53
by Don
+1

Re: [Mod] Spears [alpha2] [spears]

Posted: Tue Oct 13, 2015 20:03
by Echoes91
Added screenshot and fixed a bug causing spears that hit a mob and a node at the same time to duplicate.

Re: [Mod] Spears [alpha2] [spears]

Posted: Tue Oct 13, 2015 20:09
by Don
Looks awesome. If you don't mind I am going to use this in my subgame.

Re: [Mod] Spears [alpha2] [spears]

Posted: Wed Oct 14, 2015 15:14
by Echoes91
Don wrote:Looks awesome. If you don't mind I am going to use this in my subgame.
Have fun!

Re: [Mod] Spears [alpha2] [spears]

Posted: Wed Oct 14, 2015 17:56
by Desour
the mod looks interesting

Re: [Mod] Spears [alpha3] [spears]

Posted: Fri Oct 16, 2015 18:13
by Echoes91
Fixed spears that used to self repair while being thrown after reaching maximum wear. Reorganized code files for better visualization.
DS-minetest wrote:the mod looks interesting
I hope so :)

Re: [Mod] Spears [alpha3] [spears]

Posted: Fri Oct 16, 2015 21:00
by Krock
Why did I not see this mod earlier?!
The throw function works fine but I would like to throw them using the LMB, like with snowballs and shuriken.

Re: [Mod] Spears [alpha3] [spears]

Posted: Sat Oct 17, 2015 09:42
by Echoes91
Krock wrote:Why did I not see this mod earlier?!
The throw function works fine but I would like to throw them using the LMB, like with snowballs and shuriken.
Because it appeared few days ago :) they were introduced within my older mod but it was turning into a big mess.
Assigning a function to the LMB would remove the tool's capabilities (dig and melee attack), while at the RMB would work only if pointing at something (close enough to get a selected target). These are API limitations.

Re: [Mod] Spears [alpha3] [spears]

Posted: Sat Oct 17, 2015 09:50
by Napiophelios
I made some 32px textures for this awhile back if you want to use them
spears_textures_32px.zip
License:WTFPL
(3.42 KiB) Downloaded 168 times

Image
spearz32.png
spearz32.png (7.12 KiB) Viewed 3096 times

Re: [Mod] Spears [alpha3] [spears]

Posted: Sat Oct 17, 2015 18:46
by Minetestforfun
Napiophelios wrote:I made some 32px textures for this awhile back if you want to use them
spearz32.png
We also made our 32px textures https://github.com/MinetestForFun/serve ... s/textures
Feel free to re-used them.

Re: [Mod] Spears [alpha3] [spears]

Posted: Sat Oct 17, 2015 18:57
by Echoes91
Napiophelios wrote:I made some 32px textures for this awhile back if you want to use them
spears_textures_32px.zip

Image
spearz32.png
Nice! I prefer to keep it as coherent as possible with default game, using 16x16 textures with similar look and feel, however of course everybody must feel free to replace them, you just have to give them the same names and put them into the texture folder.
Minetestforfun wrote:
Napiophelios wrote:I made some 32px textures for this awhile back if you want to use them
spearz32.png
We also made our 32px textures https://github.com/MinetestForFun/serve ... s/textures
Feel free to re-used them.
OMG you have the earliest snapshot, where i didn't even finish to rewrite the README.txt XD. I'd really suggest you to upgrade to the latest release since there was quite some mess that has been fixed.

Re: [Mod] Spears [alpha3] [spears]

Posted: Sun Oct 18, 2015 17:31
by Minetestforfun
Echoes91 wrote: OMG you have the earliest snapshot, where i didn't even finish to rewrite the README.txt XD. I'd really suggest you to upgrade to the latest release since there was quite some mess that has been fixed.
Yes, as you can see here https://github.com/MinetestForFun/serve ... issues/304 we planned to update the mod but we haven't updated the mod for the moment.

My earlier post wasn't for your advice on our updates cycle, but was on the 32px textures we made/use and we want to share with you. ;)

Re: [Mod] Spears [alpha3] [spears]

Posted: Mon Oct 19, 2015 03:38
by swordpaint12
I believe I use your throwing mod. Kind of a shame they aren't being developed together anymore, but kind of makes sense. +1

Re: [Mod] Spears [alpha3] [spears]

Posted: Mon Oct 19, 2015 11:15
by Echoes91
Minetestforfun wrote:My earlier post wasn't for your advice on our updates cycle, but was on the 32px textures we made/use and we want to share with you. ;)
Of course, but I felt quite guilty for having published such an unpolished snapshot so I'm hoping for any of its tracks to disappear as soon as possible...
swordpaint12 wrote:I believe I use your throwing mod. Kind of a shame they aren't being developed together anymore, but kind of makes sense. +1
Actually i split them because i noticed that developing one set of features (like spears) wasn't bringing improvements to the others anymore, but just increasing the mess. I thought that spears would have been similar to arrows but now they don't share a single function anymore.
Once all of its sets will be functional and polished as themselves, so that one can concentrate testing and development easily on one without breaking any other, throwing enhanced will probably survive as a modpack.

Re: [Mod] Spears [alpha3] [spears]

Posted: Mon Oct 19, 2015 12:14
by swordpaint12
Yes. That makes lots of sense. Maybe eventually you'll upgrade it to a weapons modpack. I dunno. Best of luck!

Re: [Mod] Spears [alpha3] [spears]

Posted: Sun Oct 25, 2015 09:13
by npx
Amazing! I love your work!

Re: [Mod] Spears [1.0] [spears]

Posted: Wed Jan 06, 2016 21:32
by Echoes91
Updated to 1.0
Since I've not been able to animate spear's flight any better through using API, this first stable version won't bring any drastic change.
However, apart of knowing that everything works good, this release brings a small buff to spears' speed and, consequently, damage at range, two new spears were added and inventory images now are oriented like all the other default's tools.
I've been testing for some hours now, also hosting (and playing) multiplayer, no issue have emerged so far.

Re: [Mod] Spears [1.0] [spears]

Posted: Sun Feb 14, 2016 21:06
by Dalethejr
`

Re: [Mod] Spears [1.0] [spears]

Posted: Sun Feb 14, 2016 21:09
by Dalethejr
`

Re: [Mod] Spears [1.0] [spears]

Posted: Mon Feb 15, 2016 09:48
by Echoes91
Dalethejr wrote:Sorry for copying your mod dude, I hadn't seen this before... I'll put a link in my mod so ppl can come see this one
Dalethejr wrote:Also, would you like to combine our mods? viewtopic.php?f=9&t=14044
If you had not seen this one you can't have copied it, so your work is totally yours. Spears are a really ancient weapon so nobody can't patent such an idea :)
I have not enough time to develop mods right now, however i released them as free software (see the licence) which means that anybody can look at the code, modify it and publish it again as long as is under the same licence (and possibly with some credits to the author).
If you would like to improve my work or merge some features into yours you're welcome, surely it's better to join forces instead of developing something redundant.
I see that your mod has more features other than spears and since mines are older (so probably more refined) you could create a modpack containing my repo cloned among with your new weapons.

Re: [Mod] Spears [1.0] [spears]

Posted: Mon Feb 15, 2016 15:43
by Dalethejr
`

Re: [Mod] Spears [1.1] [spears]

Posted: Sat Apr 18, 2020 14:06
by Echoes91
I'm glad to announce that in Update 1.1 spears can be finally thrown using right mouse button!

This thanks to new API -> It requires Minetest version 5.2.0 or newer

Re: [Mod] Spears [2.0] [spears]

Posted: Sat Apr 25, 2020 15:37
by Echoes91
Version 2.0 has arrived and it's a pretty big update. It has:
  • - Cleaner, streamlined code without deprecated functions
    - Spears hurt players
    - Spears animated in flight
    - Spears stick into nodes
    - New textures
    - New sound when hitting flesh
    - New receipt to fit with default tools
    - Drag now depends on fluid
    - Rewritten instructions
    - New gold-plated spear to celebrate
Please report bugs and have fun!

Re: [Mod] Spears [2.0] [spears]

Posted: Sat Apr 25, 2020 17:22
by Bastrabun
I'm going to test that mod for my server :)

Are you planning on submitting it to content db?