[Mod] Flags [1.1] [flags]

User avatar
Rehlgamer101
Member
Posts: 19
Joined: Thu Aug 22, 2013 22:01
Location: I'm there when you blink!
Contact:

by Rehlgamer101 » Post

Bas080 wrote:
Rehlgamer101 wrote:Doesn't work with the carpet mod
What seems to be the issue?
Well it first, doesn't pop up in inventory, in creative. (without crafting) and when I try to craft a flag, it comes up with carpet instead. I think that the both mods are too similar to each-other to work on the same server.
Super Mario!!! Need I say more? I think not!!

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

by Bas080 » Post

Rehlgamer101 wrote:
Bas080 wrote:
Rehlgamer101 wrote:Doesn't work with the carpet mod
What seems to be the issue?
Well it first, doesn't pop up in inventory, in creative. (without crafting) and when I try to craft a flag, it comes up with carpet instead. I think that the both mods are too similar to each-other to work on the same server.
It should be able to work. The only thing is that both mods have the same craft. Btw, don;t forget to install unifieddyes and flowers mod. That could explain why the flags do not show up in the creative inventory. I'll post if the craft conflict is fixed.

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

by mimilus » Post

15:07:11: ERROR[main]: ========== ERROR FROM LUA ===========
15:07:11: ERROR[main]: Failed to load and run script from
15:07:11: ERROR[main]: /home/mimilus/.minetest/mods/flags/init.lua:
15:07:11: ERROR[main]: /home/mimilus/.minetest/mods/flags/init.lua:48: attempt to index global 'HUES' (a nil value)
15:07:11: ERROR[main]: stack traceback:
15:07:11: ERROR[main]: /home/mimilus/.minetest/mods/flags/init.lua:48: in main chunk
15:07:11: ERROR[main]: ======= END OF ERROR FROM LUA ========
15:07:11: ERROR[main]: Server: Failed to load and run /home/mimilus/.minetest/mods/flags/init.lua
15:07:11: ERROR[main]: ModError: ModError: Failed to load and run /home/mimilus/.minetest/mods/flags/init.lua


Minetest 0.4.9
minetest 0.4.9
Ubuntu 12.04

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

mimilus wrote:/home/mimilus/.minetest/mods/flags/init.lua:48: attempt to index global 'HUES' (a nil value)

Code: Select all

local HUES = {
    "red",
    "orange",
    "yellow",
    "lime",
    "green",
    "aqua",
    "cyan",
    "skyblue",
    "blue",
    "violet",
    "magenta",
    "redviolet"
}

local HUES2 = {
    "Red",
    "Orange",
    "Yellow",
    "Lime",
    "Green",
    "Aqua",
    "Cyan",
    "Sky-blue",
    "Blue",
    "Violet",
    "Magenta",
    "Red-violet"
}
Copy/paste above code in the init.lua and then save it. It looks likes it works as supposed.

I think the HUES and HUES2 were once global instead of local (in the dependency unified dyes).

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Post

Topywo wrote: I think the HUES and HUES2 were once global instead of local (in the dependency unified dyes).
Sounds very likely. I hit the same problem with the tulips mod and had to edit it.
A list of my mods can be found here.

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

by Bas080 » Post

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
Location: France

by mimilus » Post

Thx it works now
minetest 0.4.9
Ubuntu 12.04

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

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

by texmex » Post

Anyone got black flag creation working? Crafting guide says white flag + unknown. White flag + black dye doesn't work. Other colors are fine.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

KCoombes
Member
Posts: 412
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

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

by KCoombes » Post

Replace the init.lua file with this:

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
Developer
Posts: 4589
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

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

by Krock » Post

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 :)
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

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

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

by texmex » Post

That was quick! It works just fine now.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

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

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

by texmex » Post

Hey Krock, since the PR never was accepted (developer abandoned it?), would you consider writing it so that it uses one PNG template and the [colorize function instead? I'm only asking because it's beyond my skills. It would certainly make retexturing easier… :)
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

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

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

by TumeniNodes » Post

Krock wrote: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 :)
Krock, will you rewrite this mod now to use the new coloring code which is added to the new release?
Place flag, then punch when holding dye to color it?
Just asking.

sorry, I think this is what Tex just asked. My bad, brain is fuzzy today
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am

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

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

by texmex » Post

TumeniNodes wrote: the new coloring code which is added to the new release?
This is not the same as the [colorize function?
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

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

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

by TumeniNodes » Post

I think we are referring to the same function texmex. I hit submit on accident before I re-read what you asked.
It was a brain-fart on my end basically.
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am

Starbeamrainbowlabs
Member
Posts: 61
Joined: Sat May 26, 2018 11:25
GitHub: sbrl
Location: Nowhere, Everywhere, and Somewhere inbetween
Contact:

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

by Starbeamrainbowlabs » Post

The images aren't displaying for me. Here's what I see: https://imgur.com/ofYiIba

Does anyone have any screenshots of this mod?

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

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

by Stix » Post

Starbeamrainbowlabs wrote:The images aren't displaying for me. Here's what I see: https://imgur.com/ofYiIba

Does anyone have any screenshots of this mod?
Hmm i dont but i could make one maybe.
Hey, what can i say? I'm the bad guy.

Starbeamrainbowlabs
Member
Posts: 61
Joined: Sat May 26, 2018 11:25
GitHub: sbrl
Location: Nowhere, Everywhere, and Somewhere inbetween
Contact:

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

by Starbeamrainbowlabs » Post

Thanks :D

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests