ranguli / boomstick Goto Github PK
View Code? Open in Web Editor NEWMinetest mod that adds boomsticks and other weapons.
Home Page: https://ranguli.github.io/boomstick/
License: GNU Lesser General Public License v2.1
Minetest mod that adds boomsticks and other weapons.
Home Page: https://ranguli.github.io/boomstick/
License: GNU Lesser General Public License v2.1
Projectiles currently don't drop due to gravity.
This should check for an item group instead of a single projectile.
boomstick/boomstick_api/projectile.lua
Line 115 in 1859278
I believe projectile.lua:140: bad argument #1 to 'punch' (userdata expected, got nil)
is occurring because whatever userdata was supposed to be passed to punch before the crash is now nil. The function that calls punch should return early if userdata is nil.
AsyncErr: Lua: Runtime error from mod 'boomstick' in callback luaentity_Step(): ...ua/.minetest/mods/boomstick/boomstick_api/projectile.lua:140: bad argument #1 to 'punch' (userdata expected, got nil)
stack traceback:
[C]: in function 'punch'
...ua/.minetest/mods/boomstick/boomstick_api/projectile.lua:140: in function 'do_damage'
...ua/.minetest/mods/boomstick/boomstick_api/projectile.lua:178: in function <...ua/.minetest/mods/boomstick/boomstick_api/projectile.lua:166>
Weapons should either emit light temporarily when fired, or have a % chance to emit light.
Add a node that will return damage dealt to the player when shot.
Certain nodes, particularly glass or wooden doors, should either break or have a % chance of breaking when hit with a projectile.
Settings should be added such that server owners would have the option to:
The smoke amount (either size or quantity of particles) should be a configurable attribute of the weapon so that things like Muskets can create larger plumes of smoke.
The code is ๐
Hey, just thought I would let you know some spots where you could improve your code.
-- boomstick_api/weapon.lua line=175
function boomstick_api.create_new_category(name, base, category)
-- Inherit any default values from a base, if one is provided.
if base ~= nil then
Reorder optional parameters to the end:
I'm using
{...}
to indicate a table with values, just to show how it will look
-- Not inheriting from base with current code
boomstick_api.create_new_category("test", nil, {...})
-- Changing the ordering so base is at the end becomes
boomstick_api.create_new_category("test", {...})
-- Or if we were to inherit defaults from base...
boomstick_api.create_new_category("test", {...}, {...})
Why reorder? Currently the code demands that optional field to be filled in, either by a table or nil, reordering it so it's at the end allows it to become a proper optional field. (Of course if you had multiple optional fields then you'd still have to put the nil as a spacer)
Change:
-- boomstick_api/weapon.lua line=175
function boomstick_api.create_new_category(name, category, base)
-- Inherit any default values from a base, if one is provided.
if base ~= nil then
This should not produce any known issues.
(Current code which uses this might need to change it's order too)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.