Post your modding questions here

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Post your modding questions here

by azekill_DIABLO » Thu Sep 29, 2016 19:16

chech chair mods on forum
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

Nyarg
Member
 
Posts: 144
Joined: Sun May 15, 2016 04:32

Re: Post your modding questions here

by Nyarg » Thu Sep 29, 2016 19:29

ulla wrote:
ulla wrote:... now i need a little help for add simple function sit or lay on_rightclick ,
but I found nothing on internet,

some help?

Find like here may be useful )
+ Spoiler
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Post your modding questions here

by orwell » Thu Sep 29, 2016 21:03

ulla wrote:
ulla wrote:Hi all and thanks advance , i make my new mod named summer i have put :
big umrella open and closed ,deckshair, lobster, big ballon ,air mattress etc...
now i need a little help for add simple function sit or lay on_rightclick ,
but but I found nothing on internet,
i have see beds but can only sleep, and boat are mixed with driver function , i have registered a node and i want the player can lay on the node with right click pls Help
sorry for my bad english

some help?

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
--state=true: lay, state=false: stand up
local function lay_down(player, pos, state)
   local name = player:get_player_name()
   if not player or not name then
      return
   end

   -- stand up
   if state ~= nil and not state then

      -- physics, eye_offset, etc
      player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
      player:set_look_yaw(math.random(1, 180) / 100)
      default.player_attached[name] = false
      player:set_physics_override(1, 1, 1)
      default.player_set_animation(player, "stand" , 30)

   -- lay down
   else
      player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0})
      local yaw, param2 = get_look_yaw(bed_pos)
      player:set_look_yaw(yaw) <you still need to implement that function that tells you in which direction the player should look when laying>
      local dir = minetest.facedir_to_dir(param2)
      local p = <position where the lay-thing is>
      player:set_physics_override(0, 0, 0)
      player:setpos(p)
      default.player_attached[name] = true
      default.player_set_animation(player, "lay" , 0) --that does the trick with laying the player down
   end
end

These are the relevant lines from beds mod. You need to add some stuff yourself.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Post your modding questions here

by orwell » Thu Sep 29, 2016 21:06

pithy wrote:
ManElevation wrote:how do you make a mod topic

You can only post in the WIP mods section.

read that post:
viewtopic.php?f=11&t=1271
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

Icalasari
Member
 
Posts: 17
Joined: Tue Sep 23, 2014 05:29
IRC: Icalasari
In-game: Icalasari

Re: Post your modding questions here

by Icalasari » Fri Sep 30, 2016 03:45

Is it possible to have a node that consists of two blocks each referencing their own textures? e.g. a jar that is x1=-4,y1=-8,z1=-4,x2=4,y2=2,z2=4 and is like the drawtype glasslike, with an inside that is x1=-3,y1=-7,z1=-3,x2=3,y2=1,z2=3 and is like the drawtype liquid (using NodeBoxEditor hence the 16x16x16 coords)? Or would the inherent nature of NodeBox make it not work?
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Post your modding questions here

by kaeza » Fri Sep 30, 2016 06:25

Icalasari wrote:Is it possible to have a node that consists of two blocks each referencing their own textures? e.g. a jar that is x1=-4,y1=-8,z1=-4,x2=4,y2=2,z2=4 and is like the drawtype glasslike, with an inside that is x1=-3,y1=-7,z1=-3,x2=3,y2=1,z2=3 and is like the drawtype liquid (using NodeBoxEditor hence the 16x16x16 coords)? Or would the inherent nature of NodeBox make it not work?

If you want that kind of "complex" shape, you will need to create a model for it using e.g. Blender, and use the "mesh" drawtype.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: Post your modding questions here

by DS-minetest » Fri Sep 30, 2016 18:24

ulla wrote:
ulla wrote:Hi all and thanks advance , i make my new mod named summer i have put :
big umrella open and closed ,deckshair, lobster, big ballon ,air mattress etc...
now i need a little help for add simple function sit or lay on_rightclick ,
but but I found nothing on internet,
i have see beds but can only sleep, and boat are mixed with driver function , i have registered a node and i want the player can lay on the node with right click pls Help
sorry for my bad english

some help?

you could make something like
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_right_click = function(clicker)
if sitter then
sitter:set_animation(stand)
else
sitter = clicker
sitter:set_animation(sit)
end
end

(its not really correct, i think...)
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
ulla
Member
 
Posts: 35
Joined: Wed Feb 04, 2015 09:22
GitHub: IIIullaIII
IRC: ulla
In-game: ulla

Re: Post your modding questions here

by ulla » Fri Sep 30, 2016 19:55

orwell wrote:
ulla wrote:
ulla wrote:Hi all and thanks advance , i make my new mod named summer i have put :
big umrella open and closed ,deckshair, lobster, big ballon ,air mattress etc...
now i need a little help for add simple function sit or lay on_rightclick ,
but but I found nothing on internet,
i have see beds but can only sleep, and boat are mixed with driver function , i have registered a node and i want the player can lay on the node with right click pls Help
sorry for my bad english

some help?

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
--state=true: lay, state=false: stand up
local function lay_down(player, pos, state)
   local name = player:get_player_name()
   if not player or not name then
      return
   end

   -- stand up
   if state ~= nil and not state then

      -- physics, eye_offset, etc
      player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
      player:set_look_yaw(math.random(1, 180) / 100)
      default.player_attached[name] = false
      player:set_physics_override(1, 1, 1)
      default.player_set_animation(player, "stand" , 30)

   -- lay down
   else
      player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0})
      local yaw, param2 = get_look_yaw(bed_pos)
      player:set_look_yaw(yaw) <you still need to implement that function that tells you in which direction the player should look when laying>
      local dir = minetest.facedir_to_dir(param2)
      local p = <position where the lay-thing is>
      player:set_physics_override(0, 0, 0)
      player:setpos(p)
      default.player_attached[name] = true
      default.player_set_animation(player, "lay" , 0) --that does the trick with laying the player down
   end
end

These are the relevant lines from beds mod. You need to add some stuff yourself.
TY but how i use whit on_rightclick?
 

User avatar
ulla
Member
 
Posts: 35
Joined: Wed Feb 04, 2015 09:22
GitHub: IIIullaIII
IRC: ulla
In-game: ulla

Re: Post your modding questions here

by ulla » Fri Sep 30, 2016 20:12

Nyarg wrote:
ulla wrote:
ulla wrote:... now i need a little help for add simple function sit or lay on_rightclick ,
but I found nothing on internet,

some help?

Find like here may be useful )
+ Spoiler

TY
on_rightclick is used only in entity? i have a node ,need register entity?
 

zing269
Member
 
Posts: 19
Joined: Sat Apr 30, 2016 19:10

Re: Post your modding questions here

by zing269 » Sat Oct 01, 2016 00:25

ulla wrote:
ulla wrote:Hi all and thanks advance , i make my new mod named summer i have put :
big umrella open and closed ,deckshair, lobster, big ballon ,air mattress etc...
now i need a little help for add simple function sit or lay on_rightclick ,
but but I found nothing on internet,
i have see beds but can only sleep, and boat are mixed with driver function , i have registered a node and i want the player can lay on the node with right click pls Help
sorry for my bad english

some help?


Sokomine's Cottages mod, https://forum.minetest.net/viewtopic.php?id=5120, has a bench and a couple of beds that allow sitting or laying on right click.
 

Icalasari
Member
 
Posts: 17
Joined: Tue Sep 23, 2014 05:29
IRC: Icalasari
In-game: Icalasari

Re: Post your modding questions here

by Icalasari » Sat Oct 01, 2016 05:04

Well I'm starting to get the hang of things (decided to leave meshwork for later and go a different style route for the node), but I hit a snag

Can nodeboxes have animated textures? Because I tried, with this being the intended result

Instead I got this jar of nope (which I am definitely going to recreate - Planning on two focuses that would split into mod packs, one being a magic and potions mod pack)

Trying to figure out where I went horribly, horribly wrong. Can somebody look at it and see where things are glitching out, please?

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("mindeca_bugs:firefly_jar", {
   description = "Firefly in a Jar",
   light_source = 5,
   tiles = {
      {
         name = {"mindeca_firefly_top.png",
         "mindeca_firefly_bottom.png",
         "mindeca_firefly_side_animated.png",
         "mindeca_firefly_side_animated.png",
         "mindeca_firefly_side_animated.png",
         "mindeca_firefly_side_animated.png"},
         animation = {
            type = "vertical_frames",
            aspect_w = 16,
            aspect_h = 16,
            length = 2.0,
            },
      },
   },
   drawtype = "nodebox",
   paramtype = "light",
   sunlight_propogates = true,
   groups = {dig_immediate = 3, falling_node = 1},
   node_box = {
      type = "fixed",
      fixed = {
         {-0.1875, -0.5, -0.1875, 0.1875, 0.4375, 0.1875}, -- Central
         {-0.25, -0.4375, -0.25, 0.25, 0.0625, 0.25}, -- Middle
         {-0.3125, -0.375, -0.3125, 0.3125, -0.0625, 0.3125}, -- Edge
         {-0.25, 0.25, -0.25, 0.25, 0.375, 0.25}, -- Cork
      }
   },
   selection_box = {
      type = "fixed",
         fixed = {-0.3125, -0.5, -0.3125, 0.3125, 0.4375, 0.3125},
   }
})
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: Post your modding questions here

by DS-minetest » Sat Oct 01, 2016 07:37

@Icalasari:
you have to do it like this:
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("mindeca_bugs:firefly_jar", {
       description = "Firefly in a Jar",
       light_source = 5,
       tiles = {
        "mindeca_firefly_top.png",
        "mindeca_firefly_bottom.png",
        {
             name = "mindeca_firefly_side_animated.png",
             animation = {
                type = "vertical_frames",
                aspect_w = 16,
                aspect_h = 16,
                length = 2.0,
                   },
                  },
       },
       drawtype = "nodebox",
       paramtype = "light",
       sunlight_propogates = true,
       groups = {dig_immediate = 3, falling_node = 1},
       node_box = {
          type = "fixed",
          fixed = {
             {-0.1875, -0.5, -0.1875, 0.1875, 0.4375, 0.1875}, -- Central
             {-0.25, -0.4375, -0.25, 0.25, 0.0625, 0.25}, -- Middle
             {-0.3125, -0.375, -0.3125, 0.3125, -0.0625, 0.3125}, -- Edge
             {-0.25, 0.25, -0.25, 0.25, 0.375, 0.25}, -- Cork
          }
       },
       selection_box = {
          type = "fixed",
             fixed = {-0.3125, -0.5, -0.3125, 0.3125, 0.4375, 0.3125},
       }
})


ps: nice texture!
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

Icalasari
Member
 
Posts: 17
Joined: Tue Sep 23, 2014 05:29
IRC: Icalasari
In-game: Icalasari

Re: Post your modding questions here

by Icalasari » Sat Oct 01, 2016 22:03

@DS-mintest

Thanks - Still wondering how it screwed up the texture to that degree. Glad to also find out I can cut repeating that three additional times for the same texture

And also thanks on the compliment - I used to do a lot of sprite art, and got a lot of practice when I did the Harvestmooncraft texture pack. Trying a cel shaded style to go with these mods I'm making
 

Icalasari
Member
 
Posts: 17
Joined: Tue Sep 23, 2014 05:29
IRC: Icalasari
In-game: Icalasari

Re: Post your modding questions here

by Icalasari » Sun Oct 02, 2016 03:39

Is there a way to include more information in the tooltip? Looking it up seems to point to no, but I could be missing something
 

User avatar
AnxiousInfusion
Member
 
Posts: 146
Joined: Sun Aug 02, 2015 05:43
GitHub: AnxiousInfusion[GitLab]
IRC: AnxiousInfusion
In-game: AnxiousInfusion

Re: Post your modding questions here

by AnxiousInfusion » Mon Oct 03, 2016 03:26

How do you register a tool (sword) and give it an on_use function without overriding it's original function as a sword?
 

User avatar
D00Med
Member
 
Posts: 712
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med

Re: Post your modding questions here

by D00Med » Mon Oct 03, 2016 05:22

^I'm interested to learn that too
Look! I have a signature :]
My subgame: https://forum.minetest.net/viewtopic.php?f=15&t=14051#p207242
dmobs2 is coming...
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Post your modding questions here

by azekill_DIABLO » Mon Oct 03, 2016 20:15

look at farming mod: the hoe does same.
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: Post your modding questions here

by BirgitLachner » Tue Oct 04, 2016 11:58

I have two questions:

1.) Where do I get all the name of the default object from? Where do I have to look?

2.) Any hint how to use an object like a bucket? I only found a group for a filled bucket.
 

red-001
Member
 
Posts: 126
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

Re: Post your modding questions here

by red-001 » Tue Oct 04, 2016 15:43

BirgitLachner wrote:I have two questions:

1.) Where do I get all the name of the default object from? Where do I have to look?

2.) Any hint how to use an object like a bucket? I only found a group for a filled bucket.


1. default object?
2. take a look at https://github.com/minetest/minetest_ga ... t/init.lua
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: Post your modding questions here

by BirgitLachner » Tue Oct 04, 2016 16:02

Ah, yes ... a "s" is missing. I mean default-objects, like stone, sand ...
 

PlanetKiller
Member
 
Posts: 14
Joined: Mon Nov 23, 2015 22:50

Re: Post your modding questions here

by PlanetKiller » Tue Oct 04, 2016 18:10

Since I got help here with my air rosin, I thought I'd post the finished code for everyone; as a thanks.

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

--matblox tools
-- should clear out nodes without crashing
-- no guarantee
-- use as you see fit.
minetest.register_tool("matblox:air_rod", {
   description = "Air Rosin",
   inventory_image = "matblox_air_rod.png",

   on_use = function(itemstack, user, pointed_thing)
      if pointed_thing.under then -- check if it is a node/exists (needed)
      
         -- keep this low, the bigger the # the longer the loop
         local final = 3 -- size of area to delete (+-3 in all directions)
         
         local target = minetest.get_node(pointed_thing.under) -- target node to delete
         local pos = pointed_thing.under -- position of pointed node, centralizes the love
         -- triple direction pos/neg loop
         for a=-final,final,1 do
            for b=-final,final,1 do
               for c=-final,final,1 do
                  -- target node to delete
                  local newnode = minetest.get_node({x = pos.x+a, y = pos.y+b, z = pos.z+c})
                  -- I only want this to delete target nodes
                  if target.name == newnode.name then
                     -- swaps the node with air
                     minetest.remove_node({x = pos.x+a, y = pos.y+b, z = pos.z+c})
                  end   
               end
            end
         end
      end
   end-- so many ends, the plot thickens.
})


I've tested that it works, just need an image and a mod folder. It clears out nodes nicely, great for deleting forests. Haven't packaged it into a mod because I'm working on a modpack with scripts for specific things. I'm sure you guys are smart enough to either use it, or learn from it.

Questions:
I have a node that gives copper lumps when right-clicked, unless you are holding copper lumps. What would cause that to happen?
How would I drop an item stack entity that could be picked up?
([noun].. " tried to " ..[verb]..[noun].. " at protected position "..[noun].. " with a bucket")
 

Havocado
New member
 
Posts: 2
Joined: Tue Oct 04, 2016 21:04

Re: Post your modding questions here

by Havocado » Tue Oct 04, 2016 21:47

Is there a way to make an item that drops itself when broken by hand, but drops a different item when broken with the proper tool?
 

PlanetKiller
Member
 
Posts: 14
Joined: Mon Nov 23, 2015 22:50

Re: Post your modding questions here

by PlanetKiller » Tue Oct 04, 2016 23:00

Havocado wrote:Is there a way to make an item that drops itself when broken by hand, but drops a different item when broken with the proper tool?


use get_wielded_item()

if it = a specific item, drop one item
else, drop another.

Not sure how it would exactly work, but that's the best I can find with my skill.

Trying it, but getting errors.

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_dig = function(pos, node, digger)
   print(digger)
   print(digger.get_wielded_item(digger).name)
end


Tends to either print nil or userdata: 0x00f84510
Tried using .name and .get_name and several crashy variations.
(the block keeps reloading when I break it, but I'm missing a drop so...)
([noun].. " tried to " ..[verb]..[noun].. " at protected position "..[noun].. " with a bucket")
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: Post your modding questions here

by taikedz » Wed Oct 05, 2016 01:07

PlanetKiller wrote:Since I got help here with my air rosin, I thought I'd post the finished code for everyone; as a thanks.

I've tested that it works, just need an image and a mod folder. It clears out nodes nicely, great for deleting forests.


I know I am late to this.... but I think you might have just wanted one of the default minetest functions 'minetest.get_nodes_in_area": http://dev.minetest.net/minetest.find_nodes_in_area

I actually made a similar tool which I use for clearing large swathes... and it's very useful for putting out fires that have spread over a forest area for a while....

https://github.com/taikedz/vivarium/blob/master/staffmagic/init.lua#L335-L351
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: Post your modding questions here

by everamzah » Wed Oct 05, 2016 02:26

Havocado wrote:Is there a way to make an item that drops itself when broken by hand, but drops a different item when broken with the proper tool?


minetest.handle_node_drops

If the node is what you want, parse the drops and give to player appropriate item per currently wielded item? (get_wielded_item)
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: Post your modding questions here

by everamzah » Wed Oct 05, 2016 02:30

AnxiousInfusion wrote:How do you register a tool (sword) and give it an on_use function without overriding it's original function as a sword?


If I remember correctly, this is not possible. I only say that because I tried it myself first, before giving up and using minetest.register_on_dignode instead. In my mind, I would think it possible, but cannot imagine how.

Edit: I think I meant minetest.register_on_punchnode!

Edit2: I assume only defining on_use would be a problem, and that on_secondary_use, or on_rightclick can be used instead, if that would suit your needs.
 

User avatar
AnxiousInfusion
Member
 
Posts: 146
Joined: Sun Aug 02, 2015 05:43
GitHub: AnxiousInfusion[GitLab]
IRC: AnxiousInfusion
In-game: AnxiousInfusion

Re: Post your modding questions here

by AnxiousInfusion » Wed Oct 05, 2016 06:00

Thanks, even though that is sad news. I got 90% of the way through making a sword with dynamic sound effects only to get snagged on the on_use override. Maybe I can have it set_hp() if pointed_thing is an object ... object.is_player() ... ?

I really wish the engine had some sort of register-damage function.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: Post your modding questions here

by Byakuren » Wed Oct 05, 2016 08:19

AnxiousInfusion wrote:Thanks, even though that is sad news. I got 90% of the way through making a sword with dynamic sound effects only to get snagged on the on_use override. Maybe I can have it set_hp() if pointed_thing is an object ... object.is_player() ... ?

I really wish the engine had some sort of register-damage function.

If the pointed_thing holds an ObjectRef (and you call it obj), call obj:punch in your on_use (documented on line 2580 of lua_api.txt, I think?) to simulate the original punching that a sword does. This will still prevent you from digging with the sword, though. I think this mod had some examples of punching from on_use: viewtopic.php?f=11&t=14937
Every time a mod API is left undocumented, a koala dies.
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: Post your modding questions here

by taikedz » Wed Oct 05, 2016 09:02

AnxiousInfusion wrote:How do you register a tool (sword) and give it an on_use function without overriding it's original function as a sword?


I've been trying to do this too; unfortunately it does not look possible.

What are you trying to achieve, maybe we can look into that?
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: Post your modding questions here

by Byakuren » Wed Oct 05, 2016 09:34

taikedz wrote:
AnxiousInfusion wrote:How do you register a tool (sword) and give it an on_use function without overriding it's original function as a sword?


I've been trying to do this too; unfortunately it does not look possible.

What are you trying to achieve, maybe we can look into that?

If you don't care about digging functionality, I described how you might retain punching functionality in my previous post. If you want to be able to dig though, you could use a register_on_punchplayer callback for your punch effects instead, though it wouldn't your special stuff if you punch a lua entity rather than a player.
Every time a mod API is left undocumented, a koala dies.
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 8 guests

cron