[Mod] Placeable ingots [1.7] [ingots]

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

[Mod] Placeable ingots [1.7] [ingots]

by Skamiz Kazzarch » Post

This mod adds the ability to place ingots in the world and stack them up to 64 per node.
Image
Download: https://github.com/Skamiz/ingots/archiv ... master.zip
Source: https://github.com/Skamiz/ingots
License is LGPL-2.1 for code and CC-BY-SA-4.0 for models/textures.
dependencies: none
optional dependencies: default, moreores, technic, rainbow_ore

Rightclick to place in the world and increase the stack.
You can take ingots from the stacks by punching with the same type of ingot or an empty hand. Alternatively break the node with a pick to retrieve all of your ingots.
Rotate with a screwdriver for humble wall decorations.

Since adding ingot types is trivially easy, feel free to make requests on which mods you would like to see supported.

From now on, for those who think size maters, I present:
Spoiler
BIG INGOTS
Image
Enable big ingots in the minetest settings menu.
Also this adds only 1/8 the amounts of nodes to the game, if that is a concern for you.
To do:
full compatibility with 'creative' - Done!
compatibility with protection mods - Done by 'Nathan.S'!
optimize node count - there doesn't seem to be a way to do it without compromising aesthetics
more detailed textures for big ingots - unless someone wants to make them for me?

Known issues:
weird lighting in corners - FIXED thanks 'Nathan.S'
copper and bronze textures appear to be switched when compared to the 'default' textures - they are not, I took my color pallete directly from photos of those metals and can only speculate how the 'default' textures were made, seeing that this issue changes from texturepack to texturepack I see no need to conform
if you look realy realy close, you can see that the uv mapping looks a little bit off
Last edited by Skamiz Kazzarch on Sat Feb 25, 2023 14:47, edited 14 times in total.

puzzlecube
Member
Posts: 24
Joined: Fri Oct 19, 2018 14:49
GitHub: puzzlecube
IRC: puzzlecube
In-game: puzzlecube KluppingOnion

Re: [Mod] Placeable ingots [1.0] [ingots]

by puzzlecube » Post

Ooh neat idea! Makes me want to build a giant vault! Why not consider making it as an API so that ingot blocks for any mods metals could be done easily. In the meantime it would be great to have technic and moreores support. It will register a ton of nodes though.
Would you believe this came from an autistic guy with low vision? Believe it.
Check this out![url]https:github.com/puzzlecube[/url]
I also make models for 3d printing!

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Placeable ingots [1.0] [ingots]

by Skamiz Kazzarch » Post

It already is kind of an api? I mean, I don't know what is necesary to make my functions accesible to other mods, but if a global table in 'init' containing it is enough, I am set.
As I said, it's trivialy easy. Here is the front end:

Code: Select all

if minetest.registered_items["default:stone"] then
		ingots.register_ingots("default:copper_ingot", "ingot_copper.png")
		ingots.register_ingots("default:tin_ingot", "ingot_tin.png")
		ingots.register_ingots("default:bronze_ingot", "ingot_bronze.png")
		ingots.register_ingots("default:steel_ingot", "ingot_steel.png")
		ingots.register_ingots("default:gold_ingot", "ingot_gold.png")
end
everything else is taken care of. The only other thing you have to wory about is providing the texture.

When I have a bit more time I am going to take a look at sofars' 'Frame' mod. That will hopefully help me reduce the node count.
By the way, can anyone confirm that the download link works correctly? First time I am sharing something trough dropbox.

puzzlecube
Member
Posts: 24
Joined: Fri Oct 19, 2018 14:49
GitHub: puzzlecube
IRC: puzzlecube
In-game: puzzlecube KluppingOnion

Re: [Mod] Placeable ingots [1.0] [ingots]

by puzzlecube » Post

Oops my bad. Thats what I get for skimming over things. I see it now. The download link works too by the way.

Massive edit: upon actually reading the init.lua all the way through I would suggess replacing line 98 with

Code: Select all

if minetest.get_modpath("default") then
     -- register all the ingots
end
That way it will register them no matter what if default is enabled.
Better still would be to add something like this to the beginning of your ingots.register_ingot() function

Code: Select all

if not minetest.registered_items[ingot_item] then
     minetest.log("warning", ingot_item.." is not registered. Skipping ingot registration")
    return
end
That way the mod is compatible with pre default:tin versions of Minetest Game and derivatives that are based on old versions.
Would you believe this came from an autistic guy with low vision? Believe it.
Check this out![url]https:github.com/puzzlecube[/url]
I also make models for 3d printing!

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: [Mod] Placeable ingots [1.0] [ingots]

by Nathan.S » Post

Finally a good use for all the extra ores, and a much more impressive way to store it than just tossing it into chests.

if you add the following code to the node registration it should fix the lighting problem.

Code: Select all

paramtype = 'light',
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Placeable ingots [1.0] [ingots]

by Skamiz Kazzarch » Post

Thank you both for your input.Update 1.1 implementets both of your sugestions.
Further it adds support for 'moreores' and I managed to find a more elegant solution to the special case of a 1 ingot stack. Also there are coments now.
edit:
Some digging in in Sofars 'Frame' modturned out that I basicly already do what he did, so that was no help.
The only other avenue of attack I can think of is the useof a color parmtype2, which I realy realy don't want to do. For one, it would mean that all ingots would be sharing the same texture and have an uniform tint to them, which has no nuance, for the other, it just wouldn't work for some ingots like the mixed metal of 'technic'.
Last edited by Skamiz Kazzarch on Thu Nov 29, 2018 10:35, edited 1 time in total.

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

Re: [Mod] Placeable ingots [1.0] [ingots]

by texmex » Post

I really like this concept for some reason. I guess it's nice to have more of the items the player owns manifested in-world.
i hope there is a way to sqeeze it down to 64 total
Check out hardware coloring, I believe it should be of help.

The only thing I find to criticize is a way for placing the whole wielded stack at once. Perhaps that can happen on Sneak+Right click?

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Placeable ingots [1.1] [ingots]

by Skamiz Kazzarch » Post

ninjad, see the edit to my previous post
Not neccesarily a fan of overloading shift + rightclick with another fuction, but since the curent impementation already makes it imposible to begin placing a new stack aginst a non full stack of the same type I might do it.

puzzlecube
Member
Posts: 24
Joined: Fri Oct 19, 2018 14:49
GitHub: puzzlecube
IRC: puzzlecube
In-game: puzzlecube KluppingOnion

Re: [Mod] Placeable ingots [1.1] [ingots]

by puzzlecube » Post

Personally I think there are times when shift + rightclick being overridden would be a good idea (until we can somehow have an on_middleclick function) Also I've found how you might be able to fix the stacks being taken away in creative mode! Its a bit of a newer way of doing it but its a minor inconvenience when stacks go away in creative anyways. Thank you Hume2 for posting that in the topic for sponges. Try this on for size around init.luaa lines 48 and 51.

Code: Select all

if not (creative and creative.is_enabled_for and creative.is_enabled_for(player_name)) then
   itemstack:take_item()
end
If it were added to line 87 replacing itemstack:take_item() with what is currently line 87 it could also keep the stack from growing more when you take off an ingot in creative mode. At least it seemed to work for sponges.
Also I never thought I would be the one to do this (unitl I learned git) but I am going to be that turd guy who asks why not put it on git? Trust me it's so much better once you've learned how.
Meanwhile I'm gonna go build that vault wandering in my imagination.
Would you believe this came from an autistic guy with low vision? Believe it.
Check this out![url]https:github.com/puzzlecube[/url]
I also make models for 3d printing!

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Placeable ingots [1.1] [ingots]

by Skamiz Kazzarch » Post

Big ingot version out now. What do you all think? Should I offer them as separate mods or one mod with a configuration option?

I think I made a git acount once upon a time? I never used it and promtly forgot the password, so...
I gues I will take a look into it, but it might take quite a while so don't get your hopes up.

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

Re: [Mod] Placeable ingots [1.1] [ingots]

by texmex » Post

Do a password reset and get that Github account going, yes! One mod with configs, yes!

puzzlecube
Member
Posts: 24
Joined: Fri Oct 19, 2018 14:49
GitHub: puzzlecube
IRC: puzzlecube
In-game: puzzlecube KluppingOnion

Re: [Mod] Placeable ingots [1.1] [ingots]

by puzzlecube » Post

I'd say configurable as one mod with the option to have both as well as either big or little. Best of luck figuring out git!
Would you believe this came from an autistic guy with low vision? Believe it.
Check this out![url]https:github.com/puzzlecube[/url]
I also make models for 3d printing!

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Placeable ingots [1.2] [ingots]

by Skamiz Kazzarch » Post

Version 1.2
-suport for stainless steel and mixed metal of technic
-added compatibility with 'creative'
-merged big ingots variant
-fixed a bug which allowed to overwrite blocks next to full stacks

There is a minor snag with the creative support as it doesn't give you an ingot if you take it form the stack with an empty hand, but it seems like to much effort on something so minor. The main reason why I wanted to support creative is that you can't take more than one item from the creative inventory at a time which is exeedingly annoying when you want to build big impressive piles.

The merge in-to one mod caused the id of the ingot nodes to change, so if you are already using big ingots and want to update, pick them up first!
But from now on they should stay stable.

When I begun on technic support I didn't expect there to be quite so many ingots. I will probably add them gradualy.
Also it opens up a new problem, how do I make all the ingots distingushable? Specificaly all the irons and steels, does carbon steel look any diferedn to 'regular' steel? How do I distingush silver and chromium?
I am aiming at a realistic/rustic style and don't realy want to use the discoloration used in the craftitem texture. If you know your way around pixel graphics and know how to expres the subtle differences in look i would welcome your help.

Do you want me to maintain a changelog, in the style I used in this post, in the first post? Or do you not care for such things?

Puzzlecube, how do you immagine it to work with big and small at the same time? I can't realy see an intuitive way to choose what to place, not to mention that that would be adding yet annother dozens of nodes.
With the current implementaition it would be prety easy to make the choice individual per ingot, if that's something that would interest you.

puzzlecube
Member
Posts: 24
Joined: Fri Oct 19, 2018 14:49
GitHub: puzzlecube
IRC: puzzlecube
In-game: puzzlecube KluppingOnion

Re: [Mod] Placeable ingots [1.2] [ingots]

by puzzlecube » Post

Yeah, you're right about the big and small ingots both being enabled being kind of useless effort. While technically possible it would be adding 70 nodes per metal type instead of 8 or 64, The real problem would come when it comes time to distinguish between rather to place big or small ingots and having them both in the same node would fill up 4096 node registrations really fast. Didn't even think about that massive snag for a small bit of creative convenience.
Secondly as for the difference in coloration between the irons and silver and chromium; wrought iron is just the normal gray and cast iron is a deep kind of gray baby blue, carbon steel has kind of a faded sky blue hue, stainless steel is a very light gray but not quite white gray, chromium appears whiter than silver and stainless steel. SIlver also seems to have slightly decreased contrast. I'll explain more once I have time to sit with GIMP and all of the textures side by side if you wish.
Would you believe this came from an autistic guy with low vision? Believe it.
Check this out![url]https:github.com/puzzlecube[/url]
I also make models for 3d printing!

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Placeable ingots [1.2] [ingots]

by Skamiz Kazzarch » Post

That would be welcome. My art process until now basicly consisted of copying a few pixels directly from an image of the metal and then pushing them around until I was satisfied with the result. I have a basic idea of what impresion it should make, but to little experience and art knowledge to express it and capture all the nuances.

puzzlecube
Member
Posts: 24
Joined: Fri Oct 19, 2018 14:49
GitHub: puzzlecube
IRC: puzzlecube
In-game: puzzlecube KluppingOnion

Re: [Mod] Placeable ingots [1.2] [ingots]

by puzzlecube » Post

I have put all the irons and steels plus chromium and silver textures together into one labeled pallet for your enlightenment on the extremely subtle differences in texture and apparently my own enlightenment as well. Nothing will be able to tell you the subtle differences in texture better than having them all next to each other unaffected by ingame lighting and shaders. I never even noticed just how close in color wrought iron and stainless steel are and how close chromium and silver are even. I can help with some textures too but I figured I'd share this since it was such an eye opener for me.

Also i think that copy paste tweak method for 100% matching a textures style and scheme is kind of the best way to do it if you can. It stinks when you can't because then you have to tweak and tweak and tweak before you can even get to the tweak phase if you know what I mean. The difficult part is getting the subtle low-res discolorations that happen throughout blocks right. Just takes practice.
Attachments
Side by side comparison pallet of metals labeled above and below for the top and bottom rows respectively.
Side by side comparison pallet of metals labeled above and below for the top and bottom rows respectively.
Metals.png (4.71 KiB) Viewed 3703 times
Would you believe this came from an autistic guy with low vision? Believe it.
Check this out![url]https:github.com/puzzlecube[/url]
I also make models for 3d printing!

Xudo
Member
Posts: 162
Joined: Wed Nov 09, 2016 16:43
GitHub: akryukov92
In-game: Xudo

Re: [Mod] Placeable ingots [1.2] [ingots]

by Xudo » Post

Maybe you should label ingots somehow? Different type of metal with different labels.
Look how gold bars are usually labelled IRL.
Spoiler
Image

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Placeable ingots [1.2] [ingots]

by Skamiz Kazzarch » Post

Aaand you missed my point. I specificaly don't want to use the colors used by 'technic' because I think that they aren't realistic.
The problem I have is that when i search for these materials most results are finished products which have thier surface treated in various ways or straight up painted over. And when I specificaly search for a 'texture', most results are hand made or computer generated. And then, when I find something, which looks like a good reference, I have to wory whether what I found is actualy the material I searched for or if the picture is misslabeled, which is hard to tell as I myself don't know yet the difference.
My point being: Never have I ever seen cast iron so blue as it is depicted in 'technic', so I'm not going to put much stock in the acuracy of thier other textures.
Mind you, there are some textures which seem genuine and usefull. But they are mostly gray and the low resolution of the texture doesn't allow me to easily capture the details which distingush them, so I will have to fiddle around a bit, which may take a while.

Xodo: I was considering putting labels on them, but, on the small ingot at least, there isn't enough space to write anything meanigfull. I am thinking of just putting distinct patern on them.

User avatar
Lord_Vlad
Member
Posts: 112
Joined: Thu Jul 20, 2017 07:58

Re: [Mod] Placeable ingots [1.2] [ingots]

by Lord_Vlad » Post

If that can help, I worked in metals before. I'm fairly used to see real life aluminum, iron, stainless steel, copper and some surface treatment called 'galvanisation' in french.

Like actually iron has a black carbon-like layer on top when you buy it from the high furnace factory.

Anyways, I could be a pretty good judge of the texture for these metals.

Also a suggestion. xtraores has a few ingots, maybe worth a look.

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

Re: [Mod] Placeable ingots [1.2] [ingots]

by sirrobzeroone » Post

I really like the mod and I feel your pain on the metal texture coloring selection

I'm working on some textures and had to rebase the metal palettes so not sure if it's useful but heres my metals palette attached. If its useful feel free to use or not, they are very linear palettes, just trying to be a little helpful I mean no offense and I based them on polished metals so they may not be helpful.

Image

G = Gold
S = Silver
C = Copper
T = Tin
B = Bronze
E = Steel
M = Mithril
A = Adamantine
I = Iron (Rusty)
Attachments
Metal palette.png
Metal palette.png (841 Bytes) Viewed 3703 times

User avatar
Phoenixflo44
Member
Posts: 639
Joined: Fri Jul 28, 2017 15:01
In-game: EvilPhoenix
Location: Behind my PC, in Germany

Re: [Mod] Placeable ingots [1.2] [ingots]

by Phoenixflo44 » Post

I love this mod. Now you would have to be able to place the mese crystals and the diamonds and then the mod would be perfect.

Greetings Phoenixflo44
Spoiler
I hate my life

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Placeable ingots [1.2] [ingots]

by Sokomine » Post

Those stacks of ingots look extremly nice! With those, treasure hunts and vaults will give much more immersion than the too big solid blocks we're used to. Hope to see it on servers soon.
A list of my mods can be found here.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: [Mod] Placeable ingots [1.2] [ingots]

by runs » Post

Please do support for rainbow ore.

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Placeable ingots [1.3] [ingots]

by Skamiz Kazzarch » Post

Heeyoo o/
Runs' requst finaly kicked me back to this.

Version 1.3
-suport for brass, lead, carbon steel, cast iron, chromium and zinc of technic
-suport for ranibow ore of rainbow ore

Also made some changes to code structure and added a README which explains how you can register your own ingots.

The only thing missing from technic are uranium ingots and I feel like letting people place large amounts of radioactive material into a small place is kind of not a good idea.

Phoenixflo44: Befor making this mod I had this idea that I want to be able to place down mese crystals and build up a full mese block from 9 pieces of equal volume, but it turned out to look not great.
I might return to it and make the meshes acording to estethic tastes instead of mathematic calculations, but I don't feel particulary motivated for it atm.

Edit: Just did a mini update and added optional dependency on 'rainbow_ore' which was missing.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Placeable ingots [1.3] [ingots]

by Sokomine » Post

Skamiz Kazzarch wrote: The only thing missing from technic are uranium ingots and I feel like letting people place large amounts of radioactive material into a small place is kind of not a good idea.
Er..perhaps not. Though you might add barrels with the radiocative waste from all those reactors inside. That'd then be an ore *nobody* would want to dig...
A list of my mods can be found here.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests