Page 1 of 1

Can player hold 3d object? (ex:holding gun)

PostPosted: Sat Mar 26, 2016 19:49
by Kevin Tee
I am modelling 3d guns for minetest. I want to know if player can actually hold it or not? Like other fps games.

If the player can, can recoil and flash be add? Thanks.

Re: Can player hold 3d object? (ex:holding gun)

PostPosted: Mon Mar 28, 2016 19:44
by MineYoshi
i don't know you can search in the mods api manual, or in rubenwardy modding book...

Sincerely i don't know it!

Re: Can player hold 3d object? (ex:holding gun)

PostPosted: Thu Mar 31, 2016 09:44
by azekill_DIABLO
it may be possible by hacking 3dwieldview

but it will be laggy.....

Re: Can player hold 3d object? (ex:holding gun)

PostPosted: Thu Mar 31, 2016 15:33
by benrob0329
3D armor includes a modified player model that shows the wielded item.

Re: Can player hold 3d object? (ex:holding gun)

PostPosted: Thu Mar 31, 2016 16:18
by azekill_DIABLO
i was talking of the other mod by stu......

edit: it's the same thing....

Re: Can player hold 3d object? (ex:holding gun)

PostPosted: Wed Apr 06, 2016 22:42
by D00Med
I found a way to do it, but it's not very good for guns because the model moves as if digging.
Just make a node with "mesh" drawtype, and make it shoot with "on_use"
I hope that explanation is clear enough.

Re: Can player hold 3d object? (ex:holding gun)

PostPosted: Sat Apr 09, 2016 08:06
by AiTechEye
It's possible with nodes, i made it in the gravitygun mod... nodes have the on_use and on_place functions like tools / items.

https://forum.minetest.net/viewtopic.php?f=9&t=14056


Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("gravitygun:gun2", {
   description = "Gravitygun",
   range = 10,
   stack_max = 1,
   inventory_image = "gravitygun_gun2.png",
   tiles = {"tiles"},
   groups = {dig_immediate = 3},
   paramtype = "light",
   sunlight_propagates = true,
   drawtype="mesh",
   mesh="gravitygun_gun.obj",
   on_use = function(itemstack, user, pointed_thing)
      return itemstack
   end,
   on_place = function(itemstack, user, pointed_thing)
      return itemstack
   end,
})




Image

Re: Can player hold 3d object? (ex:holding gun)

PostPosted: Sat Apr 09, 2016 17:34
by MineYoshi
UjEdwin wrote:It's possible with nodes, i made it in the gravitygun mod... nodes have the on_use and on_place functions like tools / items.

https://forum.minetest.net/viewtopic.php?f=9&t=14056


Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("gravitygun:gun2", {
   description = "Gravitygun",
   range = 10,
   stack_max = 1,
   inventory_image = "gravitygun_gun2.png",
   tiles = {"tiles"},
   groups = {dig_immediate = 3},
   paramtype = "light",
   sunlight_propagates = true,
   drawtype="mesh",
   mesh="gravitygun_gun.obj",
   on_use = function(itemstack, user, pointed_thing)
      return itemstack
   end,
   on_place = function(itemstack, user, pointed_thing)
      return itemstack
   end,
})




Image



that's a good thing and a good mod, but i think Kevin Tee is talking about "tools" or "craft_items" then i can suggest something, add a mesh instead texture...

Re: Can player hold 3d object? (ex:holding gun)

PostPosted: Sun Apr 10, 2016 12:29
by AiTechEye
1:
I am modelling 3d guns for minetest. I want to know if player can actually hold it or not?


He is talking about models not craft items or tools
If you do a text search on the page, you will find the word "tool" first on my post, and craft / items on your under :P

2: you can use nodes as tools, tools / craft items cant use models so why not use the nodes? the problem will be solved in a simple way.

add "stack_max = 1" to make it work like a tool (can only wear 1 in a slot)

and this to make it unplaceable

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
   on_place=function(itemstack, user, pointed_thing)
      return itemstack
   end,

Re: Can player hold 3d object? (ex:holding gun)

PostPosted: Sun Apr 10, 2016 14:19
by stu
UjEdwin wrote:you can use nodes as tools, tools / craft items cant use models so why not use the nodes?

In a lot of cases this is true, however, nodes do not wear out like tool items do. It would be nice if tool and craft items could also support meshes.

Re: Can player hold 3d object? (ex:holding gun)

PostPosted: Sun Apr 10, 2016 19:34
by MineYoshi
stu wrote:
UjEdwin wrote:you can use nodes as tools, tools / craft items cant use models so why not use the nodes?

In a lot of cases this is true, however, nodes do not wear out like tool items do. It would be nice if tool and craft items could also support meshes.

i think that can be a good feature for the 0.4.15, anyways is better wait, by now the only way is using nodes...