Post your modding questions here

User avatar
RealGoldenHart
Member
 
Posts: 57
Joined: Fri Dec 23, 2016 23:27
Location: My office.
IRC: GoldenHart
In-game: GoldenHart

Re: Post your modding questions here

by RealGoldenHart » Sun Mar 26, 2017 11:37

Alright thanks guys. I will try a different mod. Thanks for teaching me. I thought if you could move a vehicle around in a vehicles mod, that maybe you could move an air transport or something up. Ttyl
K. I'm bored with signatures.
 

User avatar
orwell
Member
 
Posts: 785
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell

Re: Post your modding questions here

by orwell » Mon Mar 27, 2017 21:50

RealGoldenHart wrote:3. How would I go about generating a realm in the sky? For example, rather than in caverealms where the realms are spawned underground, is it possible to do that in the sky?
Now...I realize this makes the mod impossible for servers to add, because they would have to make a new world for this addition. Is there any alternative that achieves the same goal?

I, personally, have no idea of mapgen stuff of any kind.
- Mapgen v7 has floatlands. they are disabled but can be enabled
- Terrain gets generated in 3d cubes of 80 nodes in diameter, not in 2d chunks like in Minecraft. So, if no one ever flew up to the heights you want the sky realm to be generated, an existing world is no problem, because the sky terrain has not yet been generated.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
cx384
Member
 
Posts: 498
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: Post your modding questions here

by cx384 » Thu Mar 30, 2017 15:46

What is the best way to put the names of all files (folders) which are in one folder into a table?
(I want to get a table which contains the name of all existing texture packs (path = /.minetest/textures ))
Can your read this?
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Sat Apr 01, 2017 07:19

How can I debug lua code? I need to run a code step by step to check variables, but I don't know how. I tried to use player controls (key input), but that doesn't work, however

Code: Select all
local function stepkey()
   local player = minetest.get_player_by_name("singleplayer")
   repeat
   until player:get_player_control().aux1
   repeat
   until not player:get_player_control().aux1
end
 

User avatar
cx384
Member
 
Posts: 498
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: Post your modding questions here

by cx384 » Sat Apr 01, 2017 07:28

You can write print("variable") in every line.
Can your read this?
 

User avatar
orwell
Member
 
Posts: 785
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell

Re: Post your modding questions here

by orwell » Sat Apr 01, 2017 07:29

Can't you use print() instructions to print values after each step?
Minetest is not multithreaded, whenever a event function blocks (such as running an infinite loop) the server can't do anything else, it can't even update the player control status. So you may not wait inside callback functions using loops.
You might achieve something like you want using coroutines, but these are broken inside the callbacks for some reason
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Sat Apr 01, 2017 07:30

cx384 wrote:You can write print("variable") in every line.

That's too fast and too much. I need to stop the code to analyse the data
 

User avatar
orwell
Member
 
Posts: 785
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell

Re: Post your modding questions here

by orwell » Sat Apr 01, 2017 07:37

maybe print just everything...
print(dump(table_of_all_relevant_data))
There is no other way
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Sat Apr 01, 2017 07:43

orwell wrote:maybe print just everything...
print(dump(table_of_all_relevant_data))
There is no other way

As I said, too fast and too much for console output. I write to a file now
 

User avatar
orwell
Member
 
Posts: 785
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell

Re: Post your modding questions here

by orwell » Sat Apr 01, 2017 21:23

Maybe (but only maybe) this is useful for you. It's a simple ring buffer. I used it to debug a problem in my advtrains mod, because I couldn't reproduce the bug but only detect when it was happening, so I needed to let some trains run and let them trigger the dump when some component recognized that something was wrong
Code: Select all
local ringbuflen=200

local ringbufs={}
local ringbufcnt={}

function advtrains.drb_record(tid, msg)
   if not ringbufs[tid] then
      ringbufs[tid]={}
      ringbufcnt[tid]=0
   end
   ringbufs[tid][ringbufcnt[tid]]=msg
   ringbufcnt[tid]=ringbufcnt[tid]+1
   if ringbufcnt[tid] > ringbuflen then
      ringbufcnt[tid]=0
   end
end
function advtrains.drb_dump_and_exit(pts, tid)
   print("Train "..tid.." dumping ringbuffer at pos:", pts)
   local stopcnt=ringbufcnt[tid]
   repeat
      minetest.log("action", ringbufcnt[tid]..ringbufs[tid][ringbufcnt[tid]])
      ringbufcnt[tid]=ringbufcnt[tid]+1
      if ringbufcnt[tid] > ringbuflen then
         ringbufcnt[tid]=0
      end
   until ringbufcnt[tid]==stopcnt
   minetest.log("action", dump(advtrains.trains[tid]))
   error("Successfully dumped stuff")
end
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
burli
Member
 
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Tue Apr 04, 2017 12:24

sofar wrote:
burli wrote:Is voxelmanip always faster than get_node? I noticed that the hopper mod uses voxelmanip just to get two neighbour nodes.

Is this really better?


yes and no. It can sometimes mean only doing a single lua-to-C call, which is likely cheaper than two get_node() calls. But if it's not performance critical, you shouldn't worry too much.


Well, I changed my pathfinder from voxelmanip to get_node. I just can say that get_node is extremely fast. Only for reading some nodes voxelmanip is much to slow since it always loads a whole mapblock

Edit: I measured a time of 7ms for the whole pathfinder run which includes around 3000 get_node calls
 

User avatar
Tmanyo
Member
 
Posts: 196
Joined: Mon Sep 29, 2014 01:20
Location: United States
GitHub: Tmanyo
IRC: Tmanyo
In-game: tmanyo

Re: Post your modding questions here

by Tmanyo » Tue Apr 04, 2017 21:18

I am wondering if it is possible to take a table with player names as keys such as this one:
Code: Select all
{["description"] = {["tmanyo"] = "Really bad", ["cow"] = "Really great server!", ["singleplayer"] = "This server is really bad!"}, ["value"] = {["tmanyo"] = 2.1, ["cow"] = 5, ["singleplayer"] = 2}}

Then formatting each key into a string such as:
Code: Select all
"Rating: " .. value[key] .. "\n\"" .. description[key] .. "\""

Or something like that.
I guess the real question is, What if you don't know the key, how do you index the value and description? Once I have gotten past that roadblock, how do I list these strings one after another in a formspec? I don't want the same person's results to come up every time. I want "tmanyo - value description" \n "cow - value description" \n ect...
Tmanyo
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player
 

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

Re: Post your modding questions here

by Nyarg » Tue Apr 04, 2017 23:44

Tmanyo wrote:I am wondering if it is possible to take a table with player names as keys

If I'm properly understand question so answer is http://dev.minetest.net/minetest.serialize

Tmanyo wrote: What if you don't know the key, how do you index the value and description?

Look into my mod for ptTbl(a,tNm) function. (If I'm properly understand question)
I am a noob. still yet. Not so noob ) [vml] WIP and a little proof for fun PlantedTorch )))
MT Strike 78a36b468554d101e0be3b0d1f587a555f396452 Great! Somebody have found it )
"My english isn't well" I know. I'm sorry )
 

User avatar
Tmanyo
Member
 
Posts: 196
Joined: Mon Sep 29, 2014 01:20
Location: United States
GitHub: Tmanyo
IRC: Tmanyo
In-game: tmanyo

Re: Post your modding questions here

by Tmanyo » Wed Apr 05, 2017 00:03

Nyarg wrote:
Tmanyo wrote:I am wondering if it is possible to take a table with player names as keys

If I'm properly understand question so answer is http://dev.minetest.net/minetest.serialize

Tmanyo wrote: What if you don't know the key, how do you index the value and description?

Look into my mod for ptTbl(a,tNm) function. (If I'm properly understand question)

Thank you for trying, but I know how to use minetest.serialize. The main question is, How does one "iterate" through a table and get all the information to be able to place into individual strings that can then be listed in a form?
Tmanyo
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player
 

User avatar
kaeza
Moderator
 
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Post your modding questions here

by kaeza » Wed Apr 05, 2017 00:12

Tmanyo wrote:The main question is, How does one "iterate" through a table and get all the information to be able to place into individual strings that can then be listed in a form?

From the Lua Manual:
pairs (t)

Returns three values: the next function, the table t, and nil, so that the construction

for k,v in pairs(t) do body end

will iterate over all key–value pairs of table t.

See function next for the caveats of modifying the table during its traversal.


Is that what you want?
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
 

User avatar
Tmanyo
Member
 
Posts: 196
Joined: Mon Sep 29, 2014 01:20
Location: United States
GitHub: Tmanyo
IRC: Tmanyo
In-game: tmanyo

Re: Post your modding questions here

by Tmanyo » Wed Apr 05, 2017 00:46

kaeza wrote:
Tmanyo wrote:The main question is, How does one "iterate" through a table and get all the information to be able to place into individual strings that can then be listed in a form?

From the Lua Manual:
pairs (t)

Returns three values: the next function, the table t, and nil, so that the construction

for k,v in pairs(t) do body end

will iterate over all key–value pairs of table t.

See function next for the caveats of modifying the table during its traversal.


Is that what you want?

Somewhat, I will keep trying new things to see different results. Thank you.
Edit--
I was able to figure out a solution! Thank you to everyone who helped. :)
Tmanyo
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player
 

User avatar
TumeniNodes
Member
 
Posts: 2825
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Thu Apr 06, 2017 22:47

I am so horrible with Lua : (
So, for a while now I have been trying to add the smoke particles from Homedecor's fake fire mod to default torches.
I gave up after a few tries back about a couple months ago.

I decided to try again the other day and still just have not been able to learn/understand Lua enough to achieve this goal.

Could someone look at how I attempted it this time and tell me where I am going wrong?
I'm sorry to keep bugging people, but it is embarrassing for me because I just don't seem to be able to grasp coding at all, and does not help that I have some issues which are making it near impossible for me to try to learn anything new these days

My plan was to at least get the function working first, and then get to redoing the smoke texture to fit for torches. Then apply it to the other torch varients (i.e. wall mount, floor, ceiling etc)
I already added the smoke texture to default textures folder, and the sounds as well to the sounds folder.

But I just have no idea where or how to add the code I copy/pasted, and just edited "chimney" with "torch" : /
I commented out the on_destruct code as it kept throwing errors for me

<edit> I did just realise I commented out at the "end" of the function and edited that to just before on_destruct now. sorry about that mistake. It still throws an error though, because my code is botched.

Here is my circus code :P

Code: Select all
local function start_smoke(pos, node, clicker, torch)
   local this_spawner_meta = minetest.get_meta(pos)
   local id = this_spawner_meta:get_int("smoky")
   local s_handle = this_spawner_meta:get_int("sound")
   local above = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name

   if id ~= 0 then
      if s_handle then
         minetest.after(0, function(handle)
            minetest.sound_stop(handle)
         end, s_handle)
      end
      minetest.delete_particlespawner(id)
      this_spawner_meta:set_int("smoky", nil)
      this_spawner_meta:set_int("sound", nil)
      return
   end

   if above == "air" and (not id or id == 0) then
      id = minetest.add_particlespawner({
         amount = 4, time = 0, collisiondetection = true,
         minpos = {x=pos.x-0.25, y=pos.y+0.4, z=pos.z-0.25},
         maxpos = {x=pos.x+0.25, y=pos.y+5, z=pos.z+0.25},
         minvel = {x=-0.2, y=0.3, z=-0.2}, maxvel = {x=0.2, y=1, z=0.2},
         minacc = {x=0,y=0,z=0}, maxacc = {x=0,y=0.5,z=0},
         minexptime = 1, maxexptime = 3,
         minsize = 4, maxsize = 8,
         texture = "smoke_particle.png",
      })
      if chimney == 1 then
         this_spawner_meta:set_int("smoky", id)
         this_spawner_meta:set_int("sound", nil)
      else
         s_handle = minetest.sound_play("fire_small", {
            pos = pos,
            max_hear_distance = 5,
            loop = true
         })
         this_spawner_meta:set_int("smoky", id)
         this_spawner_meta:set_int("sound", s_handle)
      end
   end
end

local function stop_smoke(pos)
   local this_spawner_meta = minetest.get_meta(pos)
   local id = this_spawner_meta:get_int("smoky")
   local s_handle = this_spawner_meta:get_int("sound")

   if id ~= 0 then
      minetest.delete_particlespawner(id)
   end

   if s_handle then
      minetest.after(0, function(handle)
         minetest.sound_stop(handle)
      end, s_handle)
   end

   this_spawner_meta:set_int("smoky", nil)
   this_spawner_meta:set_int("sound", nil)
end

minetest.register_node("default:torch", {
   description = "Torch",
   drawtype = "mesh",
   mesh = "torch_floor.obj",
   inventory_image = "default_torch_on_floor.png",
   wield_image = "default_torch_on_floor.png",
   tiles = {{
          name = "default_torch_on_floor_animated.png",
          animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
   }},
   paramtype = "light",
   paramtype2 = "wallmounted",
   sunlight_propagates = true,
   walkable = false,
   liquids_pointable = false,
   light_source = 13,
   groups = {choppy=2, dig_immediate=3, flammable=1, attached_node=1, torch=1},
   drop = "default:torch",
   selection_box = {
      type = "wallmounted",
      wall_bottom = {-1/8, -1/2, -1/8, 1/8, 2/16, 1/8},
   },
   sounds = default.node_sound_wood_defaults(),
   on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
         local torch = 1
         start_smoke(pos, node, clicker, torch)
         return itemstack
      --[[end,
      on_destruct = function (pos)
         stop_smoke(pos)]]--
      end
   on_place = function(itemstack, placer, pointed_thing)
      local under = pointed_thing.under
      local node = minetest.get_node(under)
      local def = minetest.registered_nodes[node.name]
      if def and def.on_rightclick and
         ((not placer) or (placer and not placer:get_player_control().sneak)) then
         return def.on_rightclick(under, node, placer, itemstack,
            pointed_thing) or itemstack
      end
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am
 

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

Re: Post your modding questions here

by Nyarg » Fri Apr 07, 2017 02:20

TumeniNodes wrote:I commented out the on_destruct code as it kept throwing errors for me


I replace for example
Code: Select all
minetest.register_node("default:torch
...
in ..\minetest-0.4.14\games\minetest_game\mods\default\nodes.lua

with your code then edit part
Code: Select all
minetest.register_node("default:torch", {
   description = "Torch",
---   drawtype = "mesh",
   drawtype = "torchlike",
---   mesh = "torch_floor.obj",
   inventory_image = "default_torch_on_floor.png",
   wield_image = "default_torch_on_floor.png",
   tiles = {{
          name = "default_torch_on_floor_animated.png",
          animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
   }},
   paramtype = "light",
   paramtype2 = "wallmounted",
   sunlight_propagates = true,
   walkable = false,
   liquids_pointable = false,
   light_source = 13,
   groups = {choppy=2, dig_immediate=3, flammable=1, attached_node=1, torch=1},
   drop = "default:torch",
   selection_box = {
      type = "wallmounted",
      wall_bottom = {-1/8, -1/2, -1/8, 1/8, 2/16, 1/8},
   },
   sounds = default.node_sound_wood_defaults(),

 
   on_destruct = function (pos)

      stop_smoke(pos)   
   end ,


   on_place = function(itemstack, placer, pointed_thing)
      local under = pointed_thing.under
      local node = minetest.get_node(under)
      local def = minetest.registered_nodes[node.name]

      local torch = 1

      start_smoke(pointed_thing.above, node, clicker, torch)
      start_smoke(under, node, clicker, torch)
      
     local stack = ItemStack("default:torch")
     local ret = minetest.item_place(stack, placer, pointed_thing)
     return ItemStack("default:torch " ..
         itemstack:get_count() - (1 - ret:get_count()))      
   end

})


so it works but
Code: Select all
local function stop_smoke(pos)
   local this_spawner_meta = minetest.get_meta(pos)
   local id = this_spawner_meta:get_int("smoky")
   local s_handle = this_spawner_meta:get_int("sound")
   print("======DESTRUCT id + pos  "..id, minetest.serialize(pos))
...
Show me id = 0.
Why ?
I am a noob. still yet. Not so noob ) [vml] WIP and a little proof for fun PlantedTorch )))
MT Strike 78a36b468554d101e0be3b0d1f587a555f396452 Great! Somebody have found it )
"My english isn't well" I know. I'm sorry )
 

User avatar
TumeniNodes
Member
 
Posts: 2825
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Fri Apr 07, 2017 03:09

The code I edited is from 0.4.15 (stable) torch.lua, not sure if that is causing that issue.

But, tried your edit and no luck, no results. Thank you though.

You say the effect is working for you though, editing this into 0.4.14? Well that's pretty cool : )
That is step #1 forward I guess :D
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am
 

User avatar
TumeniNodes
Member
 
Posts: 2825
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Fri Apr 07, 2017 13:40

Nyarg,
I have to apologize.
Your edit does, in fact work. I'm a goof, and had the torches mod enabled, which overrode the code :P
So, I will need to implement this function for that mod as well, to add it to that.

Thank you.

Now I will start tweaking the smoke texture and the particle's size and positions, so they look better with torches.
And to find a better suited sound file for them. : )
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am
 

User avatar
TumeniNodes
Member
 
Posts: 2825
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Sat Apr 15, 2017 00:04

Is there someplace I can add inventory and wield images for various materials in this code?
the self-generated images look horrible.

Code: Select all
function angledglass.register_glass(subname, recipeitem, groups, images, description, sounds)
   groups.glass = 1
minetest.register_node(":angledglass:glass" .. subname, {
   description = description,
   drawtype = "mesh",
   mesh = "angled_glass.obj",
   tiles = images,
   use_texture_alpha = true,
   paramtype = "light",
   sunlight_propogates = true,
   paramtype2 = "facedir",
   is_ground_content = false,
   groups = groups,
   sounds = sounds,
   collision_box = {
      type = "fixed",
      fixed = {
         {0.375, -0.5, 0.375, 0.5, 0.5, 0.5},
         {-0.5, -0.5, -0.5, -0.375, 0.5, -0.375},
         {-0.4375, -0.5, -0.4375, -0.3125, 0.5, -0.3125},
         {0.3125, -0.5, 0.3125, 0.4375, 0.5, 0.4375},
         {0.25, -0.5, 0.25, 0.375, 0.5, 0.375},
         {-0.375, -0.5, -0.375, -0.25, 0.5, -0.25},
         {0.1875, -0.5, 0.1875, 0.3125, 0.5, 0.3125},
         {-0.3125, -0.5, -0.3125, -0.1875, 0.5, -0.1875},
         {0.125, -0.5, 0.125, 0.25, 0.5, 0.25},
         {-0.25, -0.5, -0.25, -0.125, 0.5, -0.125},
         {0.0625, -0.5, 0.0625, 0.1875, 0.5, 0.1875},
         {-0.1875, -0.5, -0.1875, -0.0625, 0.5, -0.0625},
         {0, -0.5, 0, 0.125, 0.5, 0.125},
         {-0.125, -0.5, -0.125, 0, 0.5, 0},
         {-0.0625, -0.5, -0.0625, 0.0625, 0.5, 0.0625},
      }
   },
   on_place = angledglass.angled_place
})
end


-- Register glass types

angledglass.register_glass("_acacia_wood_glass", "default:acacia_wood",
      {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
      {"default_glass.png", "default_acacia_wood.png"},
      "Acacia Wood Glass",
      default.node_sound_glass_defaults())
      
angledglass.register_glass("_acacia_wood_obsidian_glass", "default:acacia_wood",
      {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
      {"default_obsidian_glass.png", "default_acacia_wood.png"},
      "Acacia Wood Obsidian Glass",
      default.node_sound_glass_defaults())
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am
 

User avatar
cx384
Member
 
Posts: 498
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: Post your modding questions here

by cx384 » Sat Apr 15, 2017 07:49

TumeniNodes wrote:Is there someplace I can add inventory and wield images for various materials in this code?
the self-generated images look horrible.

Code: Select all
function angledglass.register_glass(subname, recipeitem, groups, images, description, sounds)
   groups.glass = 1
minetest.register_node(":angledglass:glass" .. subname, {
   description = description,
   drawtype = "mesh",
   mesh = "angled_glass.obj",
   tiles = images,
   use_texture_alpha = true,
   paramtype = "light",
   sunlight_propogates = true,
   paramtype2 = "facedir",
   is_ground_content = false,
   groups = groups,
   sounds = sounds,
   collision_box = {
      type = "fixed",
      fixed = {
         {0.375, -0.5, 0.375, 0.5, 0.5, 0.5},
         {-0.5, -0.5, -0.5, -0.375, 0.5, -0.375},
         {-0.4375, -0.5, -0.4375, -0.3125, 0.5, -0.3125},
         {0.3125, -0.5, 0.3125, 0.4375, 0.5, 0.4375},
         {0.25, -0.5, 0.25, 0.375, 0.5, 0.375},
         {-0.375, -0.5, -0.375, -0.25, 0.5, -0.25},
         {0.1875, -0.5, 0.1875, 0.3125, 0.5, 0.3125},
         {-0.3125, -0.5, -0.3125, -0.1875, 0.5, -0.1875},
         {0.125, -0.5, 0.125, 0.25, 0.5, 0.25},
         {-0.25, -0.5, -0.25, -0.125, 0.5, -0.125},
         {0.0625, -0.5, 0.0625, 0.1875, 0.5, 0.1875},
         {-0.1875, -0.5, -0.1875, -0.0625, 0.5, -0.0625},
         {0, -0.5, 0, 0.125, 0.5, 0.125},
         {-0.125, -0.5, -0.125, 0, 0.5, 0},
         {-0.0625, -0.5, -0.0625, 0.0625, 0.5, 0.0625},
      }
   },
   on_place = angledglass.angled_place
})
end


-- Register glass types

angledglass.register_glass("_acacia_wood_glass", "default:acacia_wood",
      {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
      {"default_glass.png", "default_acacia_wood.png"},
      "Acacia Wood Glass",
      default.node_sound_glass_defaults())
      
angledglass.register_glass("_acacia_wood_obsidian_glass", "default:acacia_wood",
      {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
      {"default_obsidian_glass.png", "default_acacia_wood.png"},
      "Acacia Wood Obsidian Glass",
      default.node_sound_glass_defaults())

You can add:
Code: Select all
wield_image = "myimage.png",

https://github.com/minetest/minetest/bl ... .txt#L3742
Can your read this?
 

User avatar
TumeniNodes
Member
 
Posts: 2825
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Sun Apr 16, 2017 02:59

Thanks cx,
I know of those but, just not where I can place it in this code so it will work

Nothing I have tried has worked.
I have tried using wield_image and inventory_image in both the node registration, and type registration codes.

The problem is, I have used them before but don;t know how when using the subname structure in code
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am
 

User avatar
Lone_Wolf
Member
 
Posts: 2186
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf

Re: Post your modding questions here

by Lone_Wolf » Sun Apr 16, 2017 20:47

I edited the texture for the nyancat sword (nyancatsplus mod) in windows Paint and in the game there's white in the place of the transparent background I was aiming for. I've been able to get transparent backrounds with paint before (Making a skin for MineBlocks). Any suggestions?
 

User avatar
cx384
Member
 
Posts: 498
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: Post your modding questions here

by cx384 » Mon Apr 17, 2017 09:29

Lone_Wolf wrote:I edited the texture for the nyancat sword (nyancatsplus mod) in windows Paint and in the game there's white in the place of the transparent background I was aiming for. I've been able to get transparent backrounds with paint before (Making a skin for MineBlocks). Any suggestions?

Use gimp!
https://www.gimp.org/
Can your read this?
 

PreviousNext

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 2 guests