Page 9 of 9

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Fri Sep 18, 2015 16:21
by Exilyth
Can a gun be made to switch between different fire modes, e.g. single shot, semi automatic, burst, automatic?

Slightly related: what about modifications installed on a gun like e.g. an assault rifle with underbarrel grenadelauncher/shotgun/flamethrower? (modifications could be just a different fire mode, e.g. cycle semi, full, underbarrel, back to semi)

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Thu Nov 19, 2015 22:05
by rubenwardy
This mod doesn't work. You can shoot someone at point blank range with an M9 pistol, and it doesn't hit or damage them. The M9 does damage, but very inefficiently.

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Fri Nov 20, 2015 16:56
by rubenwardy

Code: Select all

2015-11-20 11:48:24: ERROR[Main]: ServerError: Runtime error from mod 'firearmslib' in callback environment_Step(): .../rubenwardy/.minetest/mods/mt-firearms/firearmslib/bullet.lua:20: attempt to compare nil with number
2015-11-20 11:48:24: ERROR[Main]: stack traceback:
2015-11-20 11:48:24: ERROR[Main]: 	.../rubenwardy/.minetest/mods/mt-firearms/firearmslib/bullet.lua:20: in function 'is_inside'
2015-11-20 11:48:24: ERROR[Main]: 	.../rubenwardy/.minetest/mods/mt-firearms/firearmslib/bullet.lua:72: in function 'find_collision_point'
2015-11-20 11:48:24: ERROR[Main]: 	.../rubenwardy/.minetest/mods/mt-firearms/firearmslib/bullet.lua:110: in function 'on_step'
2015-11-20 11:48:24: ERROR[Main]: 	....minetest/mods/mt-firearms/firearmslib/pureluaentity.lua:45: in function '__do_step'
2015-11-20 11:48:24: ERROR[Main]: 	....minetest/mods/mt-firearms/firearmslib/pureluaentity.lua:197: in function <....minetest/mods/mt-firearms/firearmslib/pureluaentity.lua:194>
2015-11-20 11:48:24: ERROR[Main]: 	/usr/local/share/minetest/builtin/game/register.lua:355: in function </usr/local/share/minetest/builtin/game/register.lua:335>

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Sat Nov 21, 2015 04:28
by rubenwardy
I've done some debugging. Here is the crashing function in firearmslib, with added debug output:

Code: Select all

local function is_inside(px, py, pz, x1, y1, z1, x2, y2, z2)
        --print(("*** DEBUG: Is inside? p=(%f,%f,%f), minp=(%f,%f,%f), maxp=(%f,%f,%f)"):format(px, py, pz, x1, y1, z1, x2, y2, z2))
        if px and py and pz and x1 and y1 and z1 and x2 and y2 and z2 then
                return (
                        (px >= x1) and (px <= x2)
                        and (py >= y1) and (py <= y2)
                        and (pz >= z1) and (pz <= z2)
                )
        else
                print("Error: " .. dump({ px=px, py=py, pz=pz, x1=x1, y1=y1, z1=z1, x2=x2, y2=y2, z2=z2 }))
                return false
        end
end
here is the code that calls it (see comment for exact position):

Code: Select all

local function find_collision_point(objtype, pos, node_or_obj)
        -- TODO:
        -- This should return the actual point where the bullet
        -- "collided" with it's target, or nil if it did not "hit".
        if objtype == "node" then
                local boxes
                local def = minetest.registered_nodes[node_or_obj.name]
                if not (def and def.walkable) then return end
                if (def.drawtype == "nodebox") and def.node_box and def.node_box.fixed then
                        boxes = def.node_box.fixed
                else
                        boxes = full_box
                end
                local px, py, pz =
                        pos.x - math.floor(pos.x) + 0.5,
                        pos.y - math.floor(pos.y) + 0.5,
                        pos.z - math.floor(pos.z) + 0.5
                if type(boxes[1]) == "number" then
                        local x1, y1, z1, x2, y2, z2 = unpack(boxes)
                        if is_inside(px, py, pz, x1, y1, z1, x2, y2, z2) then
                                return pos
                        end
                else
                         for _, box in ipairs(boxes) do
                                local x1, y1, z1, x2, y2, z2 = unpack(box)
                                if is_inside(px, py, pz, x1, y1, z1, x2, y2, z2) then
                                        return pos
                                end
                        end
                end
        elseif objtype == "object" then
                local objpos = node_or_obj:getpos()
                local px, py, pz =
                        pos.x - objpos.x,
                        pos.y - objpos.y,
                        pos.z - objpos.z
                local x1, y1, z1, x2, y2, z2
                if node_or_obj:is_player() then
                         x1, y1, z1, x2, y2, z2 = -0.25, -0.5, -0.25, 0.25, 1.25, 0.25
               else
                        local e = node_or_obj:get_luaentity()
                        if not (e and e.collisionbox) then
                                return
                        end
                        x1, y1, z1, x2, y2, z2 = unpack(e.collisionbox)
                end
                -- this is where it is called from:
                if is_inside(px, py, pz, x1, y1, z1, x2, y2, z2) then
                        return pos
                end
        end
end
The output is:

Code: Select all

Error: {
	pz = -1.8512248349521,
	px = 0.52047790073571,
	py = 1.0474177973035
}
Which means that x1, y1, z1, x2, y2, z2 = nil

It's probably time for me to sleep now, but I'll investigate more tomorrow.

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Sun May 01, 2016 23:15
by anuser
First I must say that this mod is awesome. I like all the guns, bullets and the counter. But there is only one thing wrong - this not work with mobs! Any suggestion what to do? I would like to use it with mobs redo...

I know that this is not new mod, many things could change in game engine and other modes since the firearms last update, but maybe it is any chance to use firearms now?

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Sat Jun 25, 2016 02:12
by TheReaperKing
I believe what has to happen is that the damage groups have to be set up like fleshy, etc. I'm testing out different stuff and hopefully I can figure it out!

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Fri Jul 22, 2016 23:38
by Teen_Miner
which mobs do they damage other than players?

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Sat Jul 23, 2016 12:48
by TheReaperKing
They don't damage anything.

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Thu Aug 04, 2016 17:29
by DS-minetest
found a bug:
Image
use the night vision on day, instead of deactivating scroll in hotbar, everything seems to be dark

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Sat Dec 10, 2016 19:56
by Diamond knight
suggestion: make a setting for using entities as the line of sight is even more buggy then entities right now but line of sight should still stay in and be fixed

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Mon May 08, 2017 07:10
by Christian9
Quick Question, may I use the api for a project of mine?

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Mon May 08, 2017 17:56
by azekill_DIABLO
TheReaperKing wrote:They don't damage anything.
FAlse they damage mila mobs.

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Fri Dec 01, 2017 19:24
by IanniPowerup!!!
I AM IMPRESED !! This is amazing . Tho it doesn't look exactly like the image . Anyway all this would need is sound

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Fri Dec 01, 2017 19:31
by rubenwardy
IanniPowerup!!! wrote:I AM IMPRESED !! This is amazing . Tho it doesn't look exactly like the image . Anyway all this would need is sound
This mod is quite broken and crashes quite a lot. I suggest trying shooter or ranged weapons

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Fri Dec 01, 2017 20:11
by azekill_DIABLO
rubenwardy wrote: This mod is quite broken and crashes quite a lot.
Well, I use it on 4.16 and it has no pb. It even works with CME.
I suggest trying shooter or ranged weapons
Well, simple shooter doesn't even work minetest 0.4.16... but the other looks very nice, will try it out!

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Sat Dec 02, 2017 01:02
by rubenwardy
azekill_DIABLO wrote:Well, simple shooter doesn't even work minetest 0.4.16... but the other looks very nice, will try it out!
Works perfectly fine on CTF

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Sat Dec 02, 2017 10:42
by azekill_DIABLO
oh. this mod. okay. last time I tried it crashed. anyway firewarms still works fine!

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Sat Dec 02, 2017 21:23
by IanniPowerup!!!
azekill_DIABLO wrote:
TheReaperKing wrote:They don't damage anything.
FAlse they damage mila mobs.
and? Why not all entities ?

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Sun Dec 03, 2017 12:50
by azekill_DIABLO
I only had tried with them at the time I said this. Actually they seems to damage everything!

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Fri Dec 22, 2017 14:17
by ProxyAble
I might have encountered a bug... Or an issue. I'm not really sure if this is caused on my part but-

After enabling the mod through a freshly created world (No others mods), it spews out this error "2017-12-22 22:00:02: ERROR[Main]: generateImage(): Could not load image "firearms_medkit_inv.png" while building texture; Creating a dummy image" and as you might have guessed, the med-kit item doesn't have a texture, I checked the textures folder and it exist, but for some reason it can't render it in-game.

EDIT: Also no sounds and I'm using 0.4.16

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Fri Dec 22, 2017 18:35
by azekill_DIABLO
actually, there's a small typo in the name of the texture. For sounds, i don't know. I have them. (btw: i have no hud for aiming or reticle like I aways had, is this normal?)

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Tue Oct 01, 2019 07:23
by xeno
nice mod !
but when i shoot the bazooka it makes me crash

and i cant find the sniper

but nice mod !

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Tue Oct 01, 2019 07:27
by xeno
and when any explosions happen it makes me chrash

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Tue Oct 01, 2019 07:38
by xeno
when i make an explosin grenade/bazooka makes me crash the screen shot :
http://zupimages.net/viewer.php?id=19/40/sy4c.png
and
http://zupimages.net/viewer.php?id=19/40/9yvr.png

Re: [Mod] Firearms [0.2.0] [firearms]

Posted: Tue Oct 01, 2019 08:29
by rubenwardy
This mod is very broken. I suggest using "shooter" by stujones