[mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby davidthecreator » Wed Aug 29, 2018 9:54 pm

casp3r wrote:
davidthecreator wrote:
casp3r wrote:just the best weapon mod

shot the player and mobs (redo or c.m.e ) (love that), and explosive destroying map , sounds amazing, new texture just incredible,
(but black plastic sheet recipe was better with "plastic sheet"(technic) and not "tree" ?)
really good work i adopt it
but conflict with "explosives" mod : viewtopic.php?t=14720

can you fix it please i really want have the two mod together i don't know how to do that
(or better integred it pleeeeeaaaase)

and it was just perfect :)


I Will keep the plastic sheet recipe the same, as I don't want the mod to depend on techinc, just so players could craft a material for making guns...

And in what way exactly does this mod conflict with "explosives" mod?

I checked the mod out along with rangedweapons, and they both seemed to work just fine...


when i start with ranged weapon + explosives activated
i have this :
2018-08-29 23:48:02: ACTION[Main]: MOD: Explosives loading...
2018-08-29 23:48:02: ERROR[Main]: ModError: Failed to load and run script from D:\minetest-0.4.16\bin\..\mods\explosives\init.lua:
2018-08-29 23:48:02: ERROR[Main]: D:\minetest-0.4.16\bin\..\mods\explosives\init.lua:12: attempt to index global 'explosives' (a boolean value)
2018-08-29 23:48:02: ERROR[Main]: stack traceback:
2018-08-29 23:48:02: ERROR[Main]: D:\minetest-0.4.16\bin\..\mods\explosives\init.lua:12: in main chunk
2018-08-29 23:48:02: ERROR[Main]: Voir debug.txt pour plus d'informations.

and if i disable explosives all work fine


Tryed using minetest 0.4.17 ?
davidthecreator
Member
 
Posts: 302
Joined: Mon Aug 18, 2014 7:48 pm
GitHub: daviddoesminetest
In-game: DavidDoesMinetest

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby casp3r » Thu Aug 30, 2018 2:18 pm

ok that's work thanks (really basic solution are the best sometime) so go to 0.4.17.1 XD
casp3r
Member
 
Posts: 21
Joined: Sat Nov 11, 2017 10:38 am

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby Isja Krass » Thu Aug 30, 2018 9:37 pm

is one of the best weapons mods I have seen in this forum.
Isja Krass
Member
 
Posts: 39
Joined: Sat Aug 18, 2018 7:30 pm
In-game: init.lua

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby Minetest4Life » Wed Oct 31, 2018 7:32 pm

This mod is awesome. I don't believe I experienced any real issues with it, and I've been using it as a standard in any of my worlds going forward. Very nice! You can kill mobs with the guns, and nothing beats crafting your own bullets and from resources in the ground.

I did notice that I cannot kill mobs sometimes while I'll I'm moving, so I have to stop and stand still in order for the shots to hurt them. Not sure if this can be fixed, but it's only a minor issue.
Minetest4Life
Member
 
Posts: 14
Joined: Fri Oct 24, 2014 11:42 pm

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby Edgy1 » Sat Nov 17, 2018 5:19 am

I have problems with the mod. I have tested on 0.4.16 and 0.4.17.1. In both releases, shooting a player on the head does not kill them, but shooting them in the feet OR shooting the block below them kills them. This has even been tested with no other mods installed.
Edgy1
Member
 
Posts: 153
Joined: Thu Nov 24, 2016 4:29 pm
GitHub: JamesTobin
In-game: Trump

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby Chem871 » Sat Nov 17, 2018 8:14 pm

That sounds like a Minetest issue I've heard about, where the player's nodebox is shifted down by 1 node.
Chem871
Member
 
Posts: 901
Joined: Sat Aug 19, 2017 9:49 pm
GitHub: Chemguy99
In-game: Nyx Serris

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby Edgy1 » Sat Nov 17, 2018 8:15 pm

That started in 0.4.17 and I think it was fixed. This problem occurred in 0.4.16 as well, I tried downgrading my server.
Edgy1
Member
 
Posts: 153
Joined: Thu Nov 24, 2016 4:29 pm
GitHub: JamesTobin
In-game: Trump

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby Diamond knight » Wed Nov 21, 2018 8:28 pm

Hm, idea: maybe add an ignores protection flag to the api, so faction server owners can make weapons that can damage stuff in claims (like a mortar "gun")
Diamond knight
Member
 
Posts: 451
Joined: Sun Apr 19, 2015 7:50 pm
GitHub: Diamondknight
In-game: Ferrumprinceps

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby ratmix » Thu Feb 14, 2019 4:31 pm

Hi davidthecreator. Thank you for the hard work that went into this fantastic mod! I will be using on my server soon once a major variation to Ruben Wardy's CTF game mode is complete.

I have a suggestion to enhance this mod. Currently your bullets are essentially spawned entities with no owner. By assigning an owner to the bullet, you can give kill credit to the owner. I modified your code to achieve this goal. This allows a kill to be credited to the shooter for kill messages and player stats. I have not yet found a way to do this with blast weapons, because TNT is a bit more complicated. This has only been tested on the Desert Eagle, but it should work for most guns in your mod.

Here is what I changed in deagle.lua:

Just below local obj = minetest.add_entity(pos, "rangedweapons:deagleshot"), I added...
Code: Select all
local entity = obj:get_luaentity()
entity.owner = user:get_player_name()


I also needed to add these lined within the on_step call in deagle.lua after if self.timer > 0.065 then...
Code: Select all
if not self.owner then return end
local shooter = self.owner
local owner = minetest.get_player_by_name(shooter)


And then finally, each instance of obj:punch(self.object, 1.0, {... was changed to obj:punch(owner, 1.0,{...

These changes will make this mod compatible with Ruben's game mode and several other kill message mods, as well as make is possible to avoid team killing in team based game modes.

Also, I have tested Ranged Weapons with minetest 5.0.0-dev and have not come across any issue apart from the previous mentioned inability to shoot a player above the waist.
ratmix
Member
 
Posts: 162
Joined: Mon May 01, 2017 7:45 pm
In-game: ratmix

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby Honeypot » Fri Mar 08, 2019 4:07 pm

Excellent mod!!
Honeypot
Member
 
Posts: 11
Joined: Sat Mar 02, 2019 10:58 am
In-game: Crackpot

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby AlexD975 » Thu Mar 21, 2019 3:22 pm

This is super awesome mod, and it makes minetest gameplay really cool!

But I have question, is this possible to make somehow see weapons with hands likw normal FPS shooter? Maybe change tools and items to 3D models? Or use animated sprites like doom?!
AlexD975
Member
 
Posts: 59
Joined: Mon Dec 04, 2017 9:24 pm
In-game: SeriousSasha

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby Lone_Wolf » Thu Mar 21, 2019 4:08 pm

AlexD975 wrote:This is super awesome mod, and it makes minetest gameplay really cool!

But I have question, is this possible to make somehow see weapons with hands likw normal FPS shooter? Maybe change tools and items to 3D models? Or use animated sprites like doom?!

I think changing them to 3d_models would be the only solution. Have to stop players from placing the guns everywhere though lol
Lone_Wolf
Member
 
Posts: 2138
Joined: Sun Apr 09, 2017 5:50 am
GitHub: LoneWolfHT
In-game: Lone_Wolf

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby davidthecreator » Thu Mar 21, 2019 7:33 pm

Lone_Wolf wrote:
AlexD975 wrote:This is super awesome mod, and it makes minetest gameplay really cool!

But I have question, is this possible to make somehow see weapons with hands likw normal FPS shooter? Maybe change tools and items to 3D models? Or use animated sprites like doom?!

I think changing them to 3d_models would be the only solution. Have to stop players from placing the guns everywhere though lol


The latest version that I am working on, will require all guns to be reloaded, as I'm adding clip sizes...

And reloading will occupy "Secondary_use" ...

So eventually, when I'm done with the most important parts of the mod, I could work on 3D edition or so.
davidthecreator
Member
 
Posts: 302
Joined: Mon Aug 18, 2014 7:48 pm
GitHub: daviddoesminetest
In-game: DavidDoesMinetest

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby AlexD975 » Thu Mar 21, 2019 7:56 pm

davidthecreator wrote:
Lone_Wolf wrote:
AlexD975 wrote:This is super awesome mod, and it makes minetest gameplay really cool!

But I have question, is this possible to make somehow see weapons with hands likw normal FPS shooter? Maybe change tools and items to 3D models? Or use animated sprites like doom?!

I think changing them to 3d_models would be the only solution. Have to stop players from placing the guns everywhere though lol


The latest version that I am working on, will require all guns to be reloaded, as I'm adding clip sizes...

And reloading will occupy "Secondary_use" ...

So eventually, when I'm done with the most important parts of the mod, I could work on 3D edition or so.


That great, but I wanna change tools from sprite view to 3D models by my own skills... But I no have any idea how to change item draw type...
AlexD975
Member
 
Posts: 59
Joined: Mon Dec 04, 2017 9:24 pm
In-game: SeriousSasha

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby Stix » Fri Mar 22, 2019 1:54 pm

@AlexD975 AFAIK its impossible to have items as meshes, so you would have to register it as a node (which would give the appearence you want when held in hand), this might help: https://rubenwardy.com/minetest_modding ... .html#mesh
Stix
Member
 
Posts: 1364
Joined: Fri Aug 04, 2017 2:19 pm
In-game: Stix [+alts]

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby AlexD975 » Sat Mar 23, 2019 8:44 am

Stix wrote:@AlexD975 AFAIK its impossible to have items as meshes, so you would have to register it as a node (which would give the appearence you want when held in hand), this might help: https://rubenwardy.com/minetest_modding ... .html#mesh


Ugh, so bad... Well, maybe in next versions of minetest this function appears...
AlexD975
Member
 
Posts: 59
Joined: Mon Dec 04, 2017 9:24 pm
In-game: SeriousSasha

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby disconnected » Sat Mar 23, 2019 4:57 pm

@davidthecreator: We fixed the problem with only being able to shoot a player below their waist on our King of the Hill server. You need to also look for a player object 1 block below the bullet entity. This is because the player object only occupies one node, despite their larger hit box size. We did this by using the code below. This is an example from the AWP. It also show an accuracy improvement accomplished by adjusting the node search radius...

Code: Select all
      local objs2 = minetest.get_objects_inside_radius({x = pos.x, y = pos.y-0.6, z = pos.z}, 1.5)
      local objs = minetest.get_objects_inside_radius({x = pos.x, y = pos.y, z = pos.z}, 1.1)

      for i=1,#objs2 do
        objs[#objs+1] = objs2[i]
      end
disconnected
Member
 
Posts: 15
Joined: Mon Mar 11, 2019 3:45 am
GitHub: discon-nected
In-game: disconnected

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby davidthecreator » Sat Mar 23, 2019 5:24 pm

disconnected wrote:@davidthecreator: We fixed the problem with only being able to shoot a player below their waist on our King of the Hill server. You need to also look for a player object 1 block below the bullet entity. This is because the player object only occupies one node, despite their larger hit box size. We did this by using the code below. This is an example from the AWP. It also show an accuracy improvement accomplished by adjusting the node search radius...

Code: Select all
      local objs2 = minetest.get_objects_inside_radius({x = pos.x, y = pos.y-0.6, z = pos.z}, 1.5)
      local objs = minetest.get_objects_inside_radius({x = pos.x, y = pos.y, z = pos.z}, 1.1)

      for i=1,#objs2 do
        objs[#objs+1] = objs2[i]
      end


I kinda found a solution already, with the bonus of headshots... Which I will be realasing whenever I finish 0.4...


But thanks anyway.
davidthecreator
Member
 
Posts: 302
Joined: Mon Aug 18, 2014 7:48 pm
GitHub: daviddoesminetest
In-game: DavidDoesMinetest

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby disconnected » Sat Mar 23, 2019 6:06 pm

Great. Hope you can implement this in 0.4 as well.
disconnected
Member
 
Posts: 15
Joined: Mon Mar 11, 2019 3:45 am
GitHub: discon-nected
In-game: disconnected

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby davidthecreator » Sat Mar 23, 2019 6:47 pm

disconnected wrote:Great. Hope you can implement this in 0.4 as well.


Yep, I sure will...

So, for those who wonder, for 0.4, I'm implementing the following:

*Fix for bullet collision with players + headshots for players
*Bullet "ownership"
*A block that prevents the use of guns in 10 node radius
*Cleaning up the code a bit
*Some cosmetic improvements
*Clip sizes for guns
*More ammo types and craftable magazines, that will allow to change the type of ammo the gun uses, for some guns.
*Gun skills (shooting a gun will have a chance to improve your efficiency with that type of guns)
*Extras for 3d_armor (ability to increase shooting damage, ability to reduce damage taken, specifically from rangedweapons™, ability to give you a chance of not consuming ammo)

And maybe something else...
But the above, is probably the most important upcoming features.
davidthecreator
Member
 
Posts: 302
Joined: Mon Aug 18, 2014 7:48 pm
GitHub: daviddoesminetest
In-game: DavidDoesMinetest

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby disconnected » Sat Mar 23, 2019 7:27 pm

Sounds like a big upgrade. Let us know if you need any help.
disconnected
Member
 
Posts: 15
Joined: Mon Mar 11, 2019 3:45 am
GitHub: discon-nected
In-game: disconnected

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby disconnected » Sat Mar 23, 2019 7:44 pm

We were also able to assign kill credit + hit sounds when using blast weapons. This required editing the default TNT mod to allow an additional parameter, the tnt owner, when calling tnt.boom().

For example, the M79 spawns an he_grenade entity. We assign an owner to this entity, the same as with bullets, then in explosives.lua we do this...
Code: Select all
   if self.timer >= 0.4 then
      if not self.owner then return end
      local shooter = self.owner
   local objs = minetest.get_objects_inside_radius({x = pos.x, y = pos.y, z = pos.z}, 1.5)
      for k, obj in pairs(objs) do
      if obj:get_luaentity() ~= nil then
      if obj:get_luaentity().name ~= "rangedweapons:he_grenade" and obj:get_luaentity().name ~= "__builtin:item" then
      if minetest.is_protected(pos, shooter) then
         local airnode =   minetest.find_node_near(pos, 4, "air")
         if airnode == nil then
            tnt.boom(pos, rocket_boom, shooter)
         else
            print(airnode)
            tnt.boom(airnode, rocket_boom, shooter)
         end
      else
      tnt.boom(pos, rocket_boom, shooter)
   end
      self.object:remove()
         end
      end
   end
end


This code also avoids destroying protected nodes that are directly hit by the entity via placing the tnt.boom() at the nearest air node, rather than replacing the protected node.

Then, as mentioned, the TNT mod needs to be changed to accept the shooter parameter. I have uploaded our modified TNT init.lua file

init.lua.zip


I suppose the TNT function could be overwritten via your mod so that editing the default TNT mod is not needed, but not sure how to do that.
disconnected
Member
 
Posts: 15
Joined: Mon Mar 11, 2019 3:45 am
GitHub: discon-nected
In-game: disconnected

Re: [mod]ranged weapons[2018.08.22] [0.3] [rangedweapons]

Postby disconnected » Sat Mar 30, 2019 7:08 pm

We are trying to reduce lag on our server which we see when 10+ player are connected. We suspect ranged weapons is the issue. Each weapon does this...
Code: Select all
minetest.register_globalstep(function(dtime, player)
    timer = timer + dtime;
    if timer >= 0.001 then
    for _, player in pairs(minetest.get_connected_players()) do
        local inv = player:get_inventory()
        local controls = player:get_player_control()
        if player:get_wielded_item():get_name() == "rangedweapons:milkor_uld"
        and inv:contains_item("main", "rangedweapons:40mm")then
        if controls.RMB then .....

This is called for each of around 45 weapons. I am assuming this would take a considerable (and noticeable) amount of resource once there are a dozen or so players. Is there a way to optimize this?

Could you put all the guns in a table and loop through them once for each player? Also, doing this in addition to reducing the step to 0.3 or so would reduce the number of loops from 4,900 to 30 (for 10 players)...

Warr1024 wrote:simplest thing to do is to just have a single globalstep that checks all the players, tracks a "holding RMB since" stat, and possibly runs a list of hooks.
basically make a unified api out of it.
disconnected
Member
 
Posts: 15
Joined: Mon Mar 11, 2019 3:45 am
GitHub: discon-nected
In-game: disconnected



Return to WIP Mods



Who is online

Users browsing this forum: Bing Bot [Bot] and 0 guests