[Mod] Firearms [0.2.0] [firearms]

Exilyth
Member
Posts: 73
Joined: Sun Jul 28, 2013 18:46
Location: Earth

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

by Exilyth » Post

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)

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

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

by rubenwardy » Post

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.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

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

by rubenwardy » Post

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>
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

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

by rubenwardy » Post

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.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

anuser
Member
Posts: 22
Joined: Sun May 01, 2016 23:07

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

by anuser » Post

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?

User avatar
TheReaperKing
Member
Posts: 531
Joined: Sun Nov 22, 2015 21:36
Contact:

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

by TheReaperKing » Post

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!
Become A Real Life Superhero - http://SuperheroHill.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids

Teen_Miner
Member
Posts: 46
Joined: Fri Jun 03, 2016 18:21
GitHub: LapisWolf
IRC: LapisWolf
In-game: LapisWolf

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

by Teen_Miner » Post

which mobs do they damage other than players?
cdb_yuId0gpEgnYo

User avatar
TheReaperKing
Member
Posts: 531
Joined: Sun Nov 22, 2015 21:36
Contact:

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

by TheReaperKing » Post

They don't damage anything.
Become A Real Life Superhero - http://SuperheroHill.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

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

by Desour » Post

found a bug:
Image
use the night vision on day, instead of deactivating scroll in hotbar, everything seems to be dark
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
Diamond knight
Member
Posts: 475
Joined: Sun Apr 19, 2015 19:50
GitHub: Diamondknight
In-game: Ferrumprinceps
Location: Chilling in Constantinople
Contact:

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

by Diamond knight » Post

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

User avatar
Christian9
Member
Posts: 338
Joined: Fri Sep 19, 2014 20:29
In-game: Christian9
Location: Hell Creek

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

by Christian9 » Post

Quick Question, may I use the api for a project of mine?

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

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

by azekill_DIABLO » Post

TheReaperKing wrote:They don't damage anything.
FAlse they damage mila mobs.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

IanniPowerup!!!
Member
Posts: 100
Joined: Wed Nov 29, 2017 17:33
In-game: IanniPowerup
Contact:

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

by IanniPowerup!!! » Post

I AM IMPRESED !! This is amazing . Tho it doesn't look exactly like the image . Anyway all this would need is sound

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

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

by rubenwardy » Post

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
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

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

by azekill_DIABLO » Post

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!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

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

by rubenwardy » Post

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
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

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

by azekill_DIABLO » Post

oh. this mod. okay. last time I tried it crashed. anyway firewarms still works fine!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

IanniPowerup!!!
Member
Posts: 100
Joined: Wed Nov 29, 2017 17:33
In-game: IanniPowerup
Contact:

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

by IanniPowerup!!! » Post

azekill_DIABLO wrote:
TheReaperKing wrote:They don't damage anything.
FAlse they damage mila mobs.
and? Why not all entities ?

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

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

by azekill_DIABLO » Post

I only had tried with them at the time I said this. Actually they seems to damage everything!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
ProxyAble
New member
Posts: 2
Joined: Fri Dec 22, 2017 13:14

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

by ProxyAble » Post

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

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

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

by azekill_DIABLO » Post

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?)
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

xeno
New member
Posts: 8
Joined: Mon Feb 25, 2019 11:59
In-game: xeno

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

by xeno » Post

nice mod !
but when i shoot the bazooka it makes me crash

and i cant find the sniper

but nice mod !
6qJF0AfOu745Hwbz4uWr9TEmyDB0BQ73

xeno
New member
Posts: 8
Joined: Mon Feb 25, 2019 11:59
In-game: xeno

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

by xeno » Post

and when any explosions happen it makes me chrash
6qJF0AfOu745Hwbz4uWr9TEmyDB0BQ73

xeno
New member
Posts: 8
Joined: Mon Feb 25, 2019 11:59
In-game: xeno

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

by xeno » Post

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
6qJF0AfOu745Hwbz4uWr9TEmyDB0BQ73

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

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

by rubenwardy » Post

This mod is very broken. I suggest using "shooter" by stujones
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests