[Mod] Flags [1.1] [flags]

User avatar
Bas080
Member
 
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080

by Bas080 » Mon Mar 31, 2014 03:05

Added the variables to the init.lua. Thnx for letting me know.
 

User avatar
mimilus
Member
 
Posts: 75
Joined: Thu Mar 06, 2014 09:08
GitHub: mimilus
IRC: Mimilus

by mimilus » Mon Mar 31, 2014 07:46

Thx it works now
minetest 0.4.9
Ubuntu 12.04
 

User avatar
texmex
Member
 
Posts: 226
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Flags [1.1] [flags]

by texmex » Tue Jul 26, 2016 21:08

Anyone got black flag creation working? Crafting guide says white flag + unknown. White flag + black dye doesn't work. Other colors are fine.
I spend all my days going down to the mines. Under the ground where the sun never shines. Breaking my back I put heat in your house. I’ve got the roar of a digtron, the breath of a mouse.
 

KCoombes
Member
 
Posts: 278
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt or Rudilyn

Re: [Mod] Flags [1.1] [flags]

by KCoombes » Tue Jul 26, 2016 21:40

Replace the init.lua file with 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
--make variables local
local HUES = {
  "red",
  "orange",
  "yellow",
  "lime",
  "green",
  "aqua",
  "cyan",
  "skyblue",
  "blue",
  "violet",
  "magenta",
  "redviolet"
  "black"
}

local HUES2 = {
  "Red",
  "Orange",
  "Yellow",
  "Lime",
  "Green",
  "Aqua",
  "Cyan",
  "Sky-blue",
  "Blue",
  "Violet",
  "Magenta",
  "Red-violet"
  "Black"
}

--Nodes and crafts
minetest.register_craft( {
  output = "flags:white 16",
  recipe = {
    {"wool:white", "wool:white", "wool:white"},
    {"wool:white", "wool:white", "wool:white"},
  },
})
--Register flag function
register_flag = function(hue, hue2)
  minetest.register_craft( {
    type = "shapeless",
    output = "flags:" .. hue,
    recipe = {
      "flags:" .. "white",
      "unifieddyes:" .. hue,
    },
   })
  minetest.register_node("flags:"..hue, {
    description = hue2 .. " flag",
    drawtype = "torchlike",
    inventory_image = "flags_item_"..hue..".png",
    wield_image = "flags_item_"..hue..".png",
    tiles = {
      {name="flags_"..hue..".png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.0}},
      {name="flags_"..hue..".png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.0}},
      {name="flags_"..hue..".png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.0}}
    },
    paramtype = "light",
    paramtype2 = "wallmounted",
    sunlight_propagates = true,
    walkable = false,
    selection_box = {
    type = "wallmounted",
      wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1},
      wall_bottom = {0, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
      wall_side = {-0.5, -0.3, -0.1, 0.5, 0.3, 0.1},
    },
    groups = {dig_immediate=3, attached=1},
    legacy_wallmounted = true,
    sounds = default.node_sound_defaults(),
  })
end
--Register Flags
register_flag("black", "Black")
register_flag("white", "White")
for i = 1, 13 do
  local hue = HUES[i]
  local hue2 = HUES2[i]
  register_flag(hue, hue2)
end
print("[Flags] Loaded!")
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Flags [1.1] [flags]

by Krock » Wed Jul 27, 2016 10:46

I spent some time in rewriting the whole mod and fixed the black flag bug on the fly.
Here is the new version: https://github.com/SmallJoker/flags
The same change are now pending as a pull request. I hope it gets merged :)
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
texmex
Member
 
Posts: 226
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Flags [1.1] [flags]

by texmex » Wed Jul 27, 2016 17:39

That was quick! It works just fine now.
I spend all my days going down to the mines. Under the ground where the sun never shines. Breaking my back I put heat in your house. I’ve got the roar of a digtron, the breath of a mouse.
 

Previous

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 9 guests

cron