[Mod] X Bows [x_bows]
- SaKeL
- Member
- Posts: 743
- Joined: Tue Apr 14, 2015 18:39
- GitHub: JurajVajda
- IRC: SaKeL
- In-game: SaKeL
[Mod] X Bows [x_bows]
Bow and Arrows [x_bows]
Adds bow and arrows to Minetest. The goal of this Mod is to make most complete single bow with arrow what will work with MTG damage system, time from last punch as simple as possible. Eventually due to the damage tiers in MTG additional arrows were added.
Thank you for all Mod creators of bow mods for inspiring this Mod.
Video
Features
* bow will force you sneak when loaded (optional dep. playerphysics)
* loaded bow will slightly adjust the player FOV
* bow uses minetest tool capabilities - if the bow is not loaded for long enough (time from last puch) the arrow will fly shorter range
* charged bow in inventory will discharge and give back the arrow when not selected
* arrow uses raycast
* arrow has chance of critical shots/hits (only on full punch interval)
* arrow uses minetest damage calculation (including 3d_armor) for making damage (no hardcoded values)
* arrows stick to nodes, players and entitites
* arrows remove them self from the world after some time
* arrows remove them self if there are already too many arrows attached to node, player, entity
* arrow continues to fly downwards when attached node is dug
* arrow flies under water for short period of time and then sinks
* arrows adjusts pitch when flying
* arrows can be picked up again after stuck in solid nodes
* registers only one entity reused for all arrows
* target block reduces fall damage by -30
* quiver for more arrow storage (can hold only arrows)
* quiver perks when in inventory (faster arrows, more arrow damage...)
* quiver shows temporarily its inventory in HUD overlay when loading or shooting (quickview)
* quiver item shows its content in infotext (hover over the item)
* X Bows API for creating custom shooters and projectiles
* 3d quiver shown in 3rd person view (compatible with 3d armor)
How To
Bow
With the bow selected in hotbar and in your hand, press right click on mouse (PC) or the same action as when placing blocks, to load the bow.
For bow to be loaded you have to have arrows in the arrow/quiver inventory - there should be extra tab in your inventory MOD to show arrow and quiver inventory slots.
Arrows and quivers in the players main inventory don't count and will not be used.
You have to have arrows and/or quiver in dedicated arrow/quiver inventory slots in order to charge the bow.
Charging bow will have slight sound effect and can be fired at any time with left click (PC)
or the same action as when you are digging a block. Waiting for full charge of the bow is recommended
as it will give the arrow full speed (maximum shooting distance) and chance for critical arrow (double damage).
There are few indications on how to know when the bow is fully charged:
* there is a distinct "click" sound
* each arrow has "charge time" in the description
* after shooting, arrow will have particle trail
There are few indications on how to know when the arrow is a critical arrow:
* there is a distinct arrow flying sound
* after shooting, arrow will have red particle trail
If you shoot the arrow before the bow is fully charged the speed/distance will be lower and no arrow particle trail will be shown (also no chance for critical arrow).
Changing the selection in hotbar will unload the bow and give you back arrow from the unloaded bow - this applies also when login in to the game (bow will be discharged and arrow will be returned to inventory) and also when you drop the charged arrow (discharged bow will be dropped with arrow item).
If you have `playerphysics` or `player_monoids` mod installed, charged bow will slow you down until you release the arrow.
Quiver
Quiver item can hold inventory of arrows. When player has quiver in his/hers quiver inventory slot - there should be extra tab in your inventory MOD to show arrow and quiver inventory slots, bow can take arrows from quiver, otherwise arrows outside of the quiver are used to load the bow.
Though, if arrows from quiver are used to load the bow, the arrows have additional speed and damage.
If we are loading/shooting arrows from quiver, there is temporary quickview HUD overlay shown, peeking in to the quivers inventory from which the arrow was taken. Arrows used from quiver will be faster only when the bow is fully charged - see "How To - Bow" for more information on how to know when bow is fully charged.
There are few indications on how to know when the bow shot arrow from quiver:
* there is temporary HUD overview shown peeking in to the quiver inventory
* after shooting, arrow will have blue/purple particle trail (if bow was fully charged)
Dependencies
* none
Optional Dependencies
- default (recipes)
- farming (bow and target recipes)
- 3d_armor (calculates damage including the armor)
- mesecons (target can be used to trigger mesecon signal)
- playerphysics (force sneak when holding charged bow)
- player_monoids (force sneak when holding charged bow)
- wool (quiver recipe)
- i3
- unified_inventory
- simple_skins
- u_skins
- wardrobe
- sfinv
- skinsdb
- player_api (shows 3d quiver)
License
Code
GNU Lesser General Public License v2.1 or later (see included LICENSE file)
Adds bow and arrows to Minetest. The goal of this Mod is to make most complete single bow with arrow what will work with MTG damage system, time from last punch as simple as possible. Eventually due to the damage tiers in MTG additional arrows were added.
Thank you for all Mod creators of bow mods for inspiring this Mod.
Video
Features
* bow will force you sneak when loaded (optional dep. playerphysics)
* loaded bow will slightly adjust the player FOV
* bow uses minetest tool capabilities - if the bow is not loaded for long enough (time from last puch) the arrow will fly shorter range
* charged bow in inventory will discharge and give back the arrow when not selected
* arrow uses raycast
* arrow has chance of critical shots/hits (only on full punch interval)
* arrow uses minetest damage calculation (including 3d_armor) for making damage (no hardcoded values)
* arrows stick to nodes, players and entitites
* arrows remove them self from the world after some time
* arrows remove them self if there are already too many arrows attached to node, player, entity
* arrow continues to fly downwards when attached node is dug
* arrow flies under water for short period of time and then sinks
* arrows adjusts pitch when flying
* arrows can be picked up again after stuck in solid nodes
* registers only one entity reused for all arrows
* target block reduces fall damage by -30
* quiver for more arrow storage (can hold only arrows)
* quiver perks when in inventory (faster arrows, more arrow damage...)
* quiver shows temporarily its inventory in HUD overlay when loading or shooting (quickview)
* quiver item shows its content in infotext (hover over the item)
* X Bows API for creating custom shooters and projectiles
* 3d quiver shown in 3rd person view (compatible with 3d armor)
How To
Bow
With the bow selected in hotbar and in your hand, press right click on mouse (PC) or the same action as when placing blocks, to load the bow.
For bow to be loaded you have to have arrows in the arrow/quiver inventory - there should be extra tab in your inventory MOD to show arrow and quiver inventory slots.
Arrows and quivers in the players main inventory don't count and will not be used.
You have to have arrows and/or quiver in dedicated arrow/quiver inventory slots in order to charge the bow.
Charging bow will have slight sound effect and can be fired at any time with left click (PC)
or the same action as when you are digging a block. Waiting for full charge of the bow is recommended
as it will give the arrow full speed (maximum shooting distance) and chance for critical arrow (double damage).
There are few indications on how to know when the bow is fully charged:
* there is a distinct "click" sound
* each arrow has "charge time" in the description
* after shooting, arrow will have particle trail
There are few indications on how to know when the arrow is a critical arrow:
* there is a distinct arrow flying sound
* after shooting, arrow will have red particle trail
If you shoot the arrow before the bow is fully charged the speed/distance will be lower and no arrow particle trail will be shown (also no chance for critical arrow).
Changing the selection in hotbar will unload the bow and give you back arrow from the unloaded bow - this applies also when login in to the game (bow will be discharged and arrow will be returned to inventory) and also when you drop the charged arrow (discharged bow will be dropped with arrow item).
If you have `playerphysics` or `player_monoids` mod installed, charged bow will slow you down until you release the arrow.
Quiver
Quiver item can hold inventory of arrows. When player has quiver in his/hers quiver inventory slot - there should be extra tab in your inventory MOD to show arrow and quiver inventory slots, bow can take arrows from quiver, otherwise arrows outside of the quiver are used to load the bow.
Though, if arrows from quiver are used to load the bow, the arrows have additional speed and damage.
If we are loading/shooting arrows from quiver, there is temporary quickview HUD overlay shown, peeking in to the quivers inventory from which the arrow was taken. Arrows used from quiver will be faster only when the bow is fully charged - see "How To - Bow" for more information on how to know when bow is fully charged.
There are few indications on how to know when the bow shot arrow from quiver:
* there is temporary HUD overview shown peeking in to the quiver inventory
* after shooting, arrow will have blue/purple particle trail (if bow was fully charged)
Dependencies
* none
Optional Dependencies
- default (recipes)
- farming (bow and target recipes)
- 3d_armor (calculates damage including the armor)
- mesecons (target can be used to trigger mesecon signal)
- playerphysics (force sneak when holding charged bow)
- player_monoids (force sneak when holding charged bow)
- wool (quiver recipe)
- i3
- unified_inventory
- simple_skins
- u_skins
- wardrobe
- sfinv
- skinsdb
- player_api (shows 3d quiver)
License
Code
GNU Lesser General Public License v2.1 or later (see included LICENSE file)
- Attachments
-
- screenshot.4.png (136.62 KiB) Viewed 3430 times
-
- screenshot-1280.png (802.36 KiB) Viewed 3979 times
Last edited by SaKeL on Thu Nov 10, 2022 16:05, edited 12 times in total.
Re: [Mod] X Bows [x_bows]
This mod uses items from the default mod for crafting. So I think you should at least add default to the optional dependencies like you did with farming. Otherwise great mod, I like the sounds.
Can your read this?
- SaKeL
- Member
- Posts: 743
- Joined: Tue Apr 14, 2015 18:39
- GitHub: JurajVajda
- IRC: SaKeL
- In-game: SaKeL
Re: [Mod] X Bows [x_bows]
Ah you are correct good catch. 👍
Re: [Mod] X Bows [x_bows]
Finally good bow mod with working arrows.
Great work.
Great work.
Re: [Mod] X Bows [x_bows]
this mod is fantastic, thanks XD
Re: [Mod] X Bows [x_bows]
That's exactly what I wanted. Nice! You even thought of arrows losing strength under water :)
Is it on purpose that you can have multiple loaded bows in the inventory?
Is it on purpose that you can have multiple loaded bows in the inventory?
Whatever I say is CC0
- SaKeL
- Member
- Posts: 743
- Joined: Tue Apr 14, 2015 18:39
- GitHub: JurajVajda
- IRC: SaKeL
- In-game: SaKeL
Re: [Mod] X Bows [x_bows]
If you mean multiple loaded bows in multiple inventory slots then yes.
Re: [Mod] X Bows [x_bows]
I ran across an interesting bug, when using the anvil mod it duplicates the wooden
bow when I go to repair it.
bow when I go to repair it.
- SaKeL
- Member
- Posts: 743
- Joined: Tue Apr 14, 2015 18:39
- GitHub: JurajVajda
- IRC: SaKeL
- In-game: SaKeL
Re: [Mod] X Bows [x_bows]
@Jackknife this sound like issue in the anvil mod you are using, can you send the link to the anvil mod?
- SaKeL
- Member
- Posts: 743
- Joined: Tue Apr 14, 2015 18:39
- GitHub: JurajVajda
- IRC: SaKeL
- In-game: SaKeL
Re: [Mod] X Bows [x_bows]
@Jackknife fixed in x_bows mod, this should not be an issue after you update the mod. Thank you for pointing out this bug.
Re: [Mod] X Bows [x_bows]
Works great now
-
- New member
- Posts: 1
- Joined: Tue Jul 13, 2021 08:11
- In-game: ViniProTheBro
Re: [Mod] X Bows [x_bows]
Since i dont know where if there even is a github for this i will just ask it here, Is there a fix for the crashes when a player is hit and if yes where can i get it?
- SaKeL
- Member
- Posts: 743
- Joined: Tue Apr 14, 2015 18:39
- GitHub: JurajVajda
- IRC: SaKeL
- In-game: SaKeL
Re: [Mod] X Bows [x_bows]
Source code and issue tracker can be found on ContentDB here (link also in the description above) https://content.minetest.net/packages/SaKeL/x_bows/ViniProTheBro wrote: ↑Tue Jul 13, 2021 08:17Since i dont know where if there even is a github for this i will just ask it here, Is there a fix for the crashes when a player is hit and if yes where can i get it?
You are the first who is mentioning such a crash. I can have a look in to it if I can reproduce it but could you in the meanwhile share the stack trace error when the crash happens?
Re: [Mod] X Bows [x_bows]
this package requires 5.4 or greater. https://bitbucket.org/minetest_gamers/x ... #lines-435 which is from https://github.com/minetest/minetest/pull/10480
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o
- SevenRichieWhite
- New member
- Posts: 9
- Joined: Fri Jun 05, 2020 00:25
- IRC: SevenRichieWhite
- In-game: SevenRichieWhite
- Location: Germany
Re: [Mod] X Bows [x_bows]
is there a way to register another bows? :)
-
- Member
- Posts: 177
- Joined: Mon Dec 07, 2020 01:04
- GitHub: ronoaldo
- IRC: ronoaldo
- In-game: RonoaldoKakashi
- Location: São Paulo, Brasil
- Contact:
Re: [Mod] X Bows [x_bows]
One player reported that, after using the bow, the binoculars don't work. I tested and it says that the zoom is disabled by a mod, right after using the bow, but not before.
I was looking at the source code and it looks like the logic in the global step is not resetting the FOV, but instead, keeping it replaced:
At line 343 in the source code (https://bitbucket.org/minetest_gamers/x ... #lines-343), it says player:set_fov(1, true, 0.4) but I believe that it should be set to zero according to this: https://minetest.gitlab.io/minetest/cla ... er-objects
I was looking at the source code and it looks like the logic in the global step is not resetting the FOV, but instead, keeping it replaced:
At line 343 in the source code (https://bitbucket.org/minetest_gamers/x ... #lines-343), it says player:set_fov(1, true, 0.4) but I believe that it should be set to zero according to this: https://minetest.gitlab.io/minetest/cla ... er-objects
Code: Select all
-- sneak, fov adjustments when bow is charged
minetest.register_globalstep(function(dtime)
bow_charged_timer = bow_charged_timer + dtime
if bow_charged_timer > 0.5 then
for _, player in ipairs(minetest.get_connected_players()) do
local name = player:get_player_name()
local stack = player:get_wielded_item()
local item = stack:get_name()
if not item then
return
end
if not x_bows.player_bow_sneak[name] then
x_bows.player_bow_sneak[name] = {}
end
if item == 'x_bows:bow_wood_charged' and not x_bows.player_bow_sneak[name].sneak then
if minetest.get_modpath('playerphysics') then
playerphysics.add_physics_factor(player, 'speed', 'x_bows:bow_wood_charged', 0.25)
end
x_bows.player_bow_sneak[name].sneak = true
player:set_fov(0.9, true, 0.4)
elseif item ~= 'x_bows:bow_wood_charged' and x_bows.player_bow_sneak[name].sneak then
if minetest.get_modpath('playerphysics') then
playerphysics.remove_physics_factor(player, 'speed', 'x_bows:bow_wood_charged')
end
x_bows.player_bow_sneak[name].sneak = false
player:set_fov(1, true, 0.4)
end
end
bow_charged_timer = 0
end
end)
-
- Member
- Posts: 177
- Joined: Mon Dec 07, 2020 01:04
- GitHub: ronoaldo
- IRC: ronoaldo
- In-game: RonoaldoKakashi
- Location: São Paulo, Brasil
- Contact:
Re: [Mod] X Bows [x_bows]
I can confirm that changing that particular line to zero fixes the interaction with the binoculars (zoom).
Re: [Mod] X Bows [x_bows]
I have come across an issue. I'm using the latest version of Minetest.
2022-03-10 17:13:36: ACTION[Server]: singleplayer uses x_bows:bow_wood_charged, pointing at [nothing]
2022-03-10 17:13:36: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'x_bows' in callback item_OnUse(): Invalid float vector dimension range 'x' (expected -2.14748e+06 < x < 2.14748e+06 got -5.6633e+06).
2022-03-10 17:13:36: ERROR[Main]: stack traceback:
2022-03-10 17:13:36: ERROR[Main]: [C]: in function 'set_velocity'
2022-03-10 17:13:36: ERROR[Main]: ...wnloads\minetest-5.5.0-win64\bin\..\mods\x_bows\init.lua:214: in function <...wnloads\minetest-5.5.0-win64\bin\..\mods\x_bows\init.lua:157>
2022-03-10 17:13:36: ACTION[Server]: singleplayer uses x_bows:bow_wood_charged, pointing at [nothing]
2022-03-10 17:13:36: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'x_bows' in callback item_OnUse(): Invalid float vector dimension range 'x' (expected -2.14748e+06 < x < 2.14748e+06 got -5.6633e+06).
2022-03-10 17:13:36: ERROR[Main]: stack traceback:
2022-03-10 17:13:36: ERROR[Main]: [C]: in function 'set_velocity'
2022-03-10 17:13:36: ERROR[Main]: ...wnloads\minetest-5.5.0-win64\bin\..\mods\x_bows\init.lua:214: in function <...wnloads\minetest-5.5.0-win64\bin\..\mods\x_bows\init.lua:157>
Re: [Mod] X Bows [x_bows]
that's what i need
Re: [Mod] X Bows [x_bows]
Is this mod still being developed?
Re: [Mod] X Bows [x_bows]
2022-04-19 15:18:30: ACTION[Server]: singleplayer uses x_bows:bow_wood_charged, pointing at [nothing]
2022-04-19 15:18:30: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'x_bows' in callback item_OnUse(): Invalid float vector dimension range 'x' (expected -2.14748e+06 < x < 2.14748e+06 got 1.1469e+07).
2022-04-19 15:18:30: ERROR[Main]: stack traceback:
2022-04-19 15:18:30: ERROR[Main]: [C]: in function 'set_velocity'
2022-04-19 15:18:30: ERROR[Main]: ...wnloads\minetest-5.5.0-win64\bin\..\mods\x_bows\init.lua:214: in function <...wnloads\minetest-5.5.0-win64\bin\..\mods\x_bows\init.lua:157>
2022-04-19 15:18:30: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'x_bows' in callback item_OnUse(): Invalid float vector dimension range 'x' (expected -2.14748e+06 < x < 2.14748e+06 got 1.1469e+07).
2022-04-19 15:18:30: ERROR[Main]: stack traceback:
2022-04-19 15:18:30: ERROR[Main]: [C]: in function 'set_velocity'
2022-04-19 15:18:30: ERROR[Main]: ...wnloads\minetest-5.5.0-win64\bin\..\mods\x_bows\init.lua:214: in function <...wnloads\minetest-5.5.0-win64\bin\..\mods\x_bows\init.lua:157>
Re: [Mod] X Bows [x_bows]
This happens when you load an arrow, keep the bow loaded, then stop the server, restart the server and then immediately fire the arrow. We had that, too:
https://gitea.your-land.de/your-land/bu ... ssues/1251
https://gitea.your-land.de/your-land/bu ... ssues/1251
Whatever I say is CC0
Re: [Mod] X Bows [x_bows]
It only acted up on one of my worlds but not the others. That’s the one thing I couldn’t figure out. I thought it was another mod causing it to crash
Re: [Mod] X Bows [x_bows]
Is there a chance for crossbows to be added at a later update?
Who is online
Users browsing this forum: No registered users and 27 guests