[Mod] Abjphabet [abjphabet]

I haven't been able to think up of good recipes. Should I...........

-Make these nodes into uncraftable minables
3
18%
-Go on and think up craft recipes anyway
14
82%
 
Total votes: 17

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: [WIP][Mod]Abjphabet[abjphabet]

by 12Me21 » Post

ABJ wrote:[
12Me21 wrote:
ABJ wrote:-How do I decrease texture resolution?
I can make some 16x16 textures, and then there can be an option to either have the high-res textures or my 16x16 ones.
Very much thank you if you will :)))))))))))) P.S. Do you mean like two downloads?
Yes, there would be a high-res and 16x16 download, plus texture packs for people who play on servers that have the mod. (if the server used the 16x16 version, but you wanted the high-res version, you could use a texture pack)

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

Re: [Mod] Abjphabet [abjphabet]

by cx384 » Post

Maybe you should ad some special character`s. (like ←→↓↑!¡?¿Ω߀&"\ / ...)
Can your read this?

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Post

cx384 wrote:Maybe you should ad some special character`s. (like ←→↓↑!¡?¿Ω߀&"\ / ...)
I think it only needs common symbols like punctuation and arrows.

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Post

I made a much more efficient version of the code, now you can more easily add or remove blocks:

Code: Select all

local characters = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0"}


for _, name in ipairs(characters) do --do this for all characters in the list
	if tonumber(name) ~= nil then --if it's a number
		local desc = "Number "..name 
	else --if it's a letter
		local desc = "Letter "..string.upper(name) --make the letter uppercase in the description
	end

	minetest.register_node("abjphabet:"..name, {
		description = desc,
		tiles = {"abjphabet_"..name..".png"},
		groups = {cracky=3}
	})
end


User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Post

I'lm almost done making a machine that will craft them!

Code: Select all

local characters = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0"}


for _, name in ipairs(characters) do --do this for all characters in the list
	if tonumber(name) ~= nil then --if it's a number
		local desc = "Number "..name 
	else --if it's a letter
		local desc = "Letter "..string.upper(name) --make the letter uppercase in the description
	end

	minetest.register_node("abjphabet:"..name, {
		description = desc,
		tiles = {"abjphabet_"..name..".png"},
		groups = {cracky=3}
	})
end

minetest.register_node("abjphabet:machine", {
	description = "Letter Machine",
	tiles = {"abjphabet_machine.png"},
	paramtype = "light",
	groups = {cracky=2},
	
	after_place_node = function(pos, placer)
		local meta = minetest.env:get_meta(pos)
	end,

	on_construct = function(pos)
		local meta = minetest.env:get_meta(pos)
		meta:set_string("formspec", "invsize[10,11;]"..
			"field[0,0;2,1;lettername;Letter;]"..
			"list[current_name;input;1,1;1,1;]"..
			"list[current_name;output;1,2;1,1;]"..
			"list[current_player;main;1,7;8,4;]"..
			"button[7,8;6,4;name;label]")--6 4 5 4
			local inv = meta:get_inventory()
		inv:set_size("input", 1)
		inv:set_size("output", 1)
	end,

	on_receive_fields = function(pos, formname, fields, sender)
		local meta = minetest.env:get_meta(pos)
		local inv = meta:get_inventory()
		local inputstack = inv:get_stack("input", 1)
		if fields.lettername ~= nil and inputstack:get_name()=="default:paper" then
			local give = {}
			give[1]=inv:add_item("output","abjphabet:"..fields.lettername)
			inputstack:take_item()
			inv:set_stack("input",1,inputstack)
		end   
	end
})

--Craft















type the letter/number you want into the text box, put a piece of paper in the top item slot, then press enter and go back in and the paper will be crafted into the letter you typed! (currently It doesn't check the input so it'll probably give an error or unknown node if you type something else.)

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Post

ok, I finished the code for the letter making machine, I don't have textures or a crafting yet, but other than that, it works perfectly!

Code: Select all

local characters = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0"}


for _, name in ipairs(characters) do --do this for all characters in the list
	if tonumber(name) ~= nil then --if it's a number
		local desc = "Number "..name 
	else --if it's a letter
		local desc = "Letter "..string.upper(name) --make the letter uppercase in the description
	end

	minetest.register_node("abjphabet:"..name, {
		description = desc,
		tiles = {"abjphabet_"..name..".png"},
		groups = {cracky=3}
	})
end

minetest.register_node("abjphabet:machine", {
	description = "Letter Machine",
	tiles = {"abjphabet_machine.png"},
	paramtype = "light",
	groups = {cracky=2},
	
	after_place_node = function(pos, placer)
		local meta = minetest.env:get_meta(pos)
	end,

	on_construct = function(pos)
		local meta = minetest.env:get_meta(pos)
		meta:set_string("formspec", "invsize[8,6;]"..
			"field[3.8,.5;1,1;lettername;Letter;]"..
			"list[current_name;input;2.5,0.2;1,1;]"..
			"list[current_name;output;4.5,0.2;1,1;]"..
			"list[current_player;main;0,2;8,4;]"..
			"button[2.54,-0.25;3,4;name;Paper -> Letter]")
			local inv = meta:get_inventory()
		inv:set_size("input", 1)
		inv:set_size("output", 1)
	end,

	on_receive_fields = function(pos, formname, fields, sender)
		local meta = minetest.env:get_meta(pos)
		local inv = meta:get_inventory()
		local inputstack = inv:get_stack("input", 1)
		if fields.lettername ~= nil and inputstack:get_name()=="default:paper" then
			for _,v in pairs(characters) do
				if v == fields.lettername then
					local give = {}
					give[1] = inv:add_item("output","abjphabet:"..fields.lettername)
					inputstack:take_item()
					inv:set_stack("input",1,inputstack)
					break
				end
			end
			
		end   
	end
})

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Abjphabet [abjphabet]

by Don » Post

12Me21 wrote:ok, I finished the code for the letter making machine, I don't have textures or a crafting yet, but other than that, it works perfectly!

Code: Select all

local characters = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0"}


for _, name in ipairs(characters) do --do this for all characters in the list
	if tonumber(name) ~= nil then --if it's a number
		local desc = "Number "..name 
	else --if it's a letter
		local desc = "Letter "..string.upper(name) --make the letter uppercase in the description
	end

	minetest.register_node("abjphabet:"..name, {
		description = desc,
		tiles = {"abjphabet_"..name..".png"},
		groups = {cracky=3}
	})
end

minetest.register_node("abjphabet:machine", {
	description = "Letter Machine",
	tiles = {"abjphabet_machine.png"},
	paramtype = "light",
	groups = {cracky=2},
	
	after_place_node = function(pos, placer)
		local meta = minetest.env:get_meta(pos)
	end,

	on_construct = function(pos)
		local meta = minetest.env:get_meta(pos)
		meta:set_string("formspec", "invsize[8,6;]"..
			"field[3.8,.5;1,1;lettername;Letter;]"..
			"list[current_name;input;2.5,0.2;1,1;]"..
			"list[current_name;output;4.5,0.2;1,1;]"..
			"list[current_player;main;0,2;8,4;]"..
			"button[2.54,-0.25;3,4;name;Paper -> Letter]")
			local inv = meta:get_inventory()
		inv:set_size("input", 1)
		inv:set_size("output", 1)
	end,

	on_receive_fields = function(pos, formname, fields, sender)
		local meta = minetest.env:get_meta(pos)
		local inv = meta:get_inventory()
		local inputstack = inv:get_stack("input", 1)
		if fields.lettername ~= nil and inputstack:get_name()=="default:paper" then
			for _,v in pairs(characters) do
				if v == fields.lettername then
					local give = {}
					give[1] = inv:add_item("output","abjphabet:"..fields.lettername)
					inputstack:take_item()
					inv:set_stack("input",1,inputstack)
					break
				end
			end
			
		end   
	end
})
You are suppose to be working on mydecks 12Me21 :P
I am really liking this mod. I am thinking of big signs. I might make signs for Minetest Ville with this. Big billboard signs.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Post

Don wrote:You are suppose to be working on mydecks 12Me21 :P
don't worry, I haven't forgotten (I stole your code for the letter machine lol)

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Abjphabet [abjphabet]

by Don » Post

12Me21 wrote:
Don wrote:You are suppose to be working on mydecks 12Me21 :P
don't worry, I haven't forgotten (I stole your code for the letter machine lol)
I am glad you are helping ABJ. Wasn't too long ago I was ABJ. I was trying to figure out everything. It is not so easy when you first start. With the right help it gets easier. If there is anything I can do to help I will.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Post

rubenwardy wrote:The minetest community usually uses tabs for indentation, but that doesn't actually matter.

Image
You mean that's how they put those magical spaces?

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Post

Hello All
Thank you for all the help you have been giving.
This is by far the most helpful community I have been in.
Best Diamond Mines
ABJ

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Post

Don wrote:You are suppose to be working on mydecks 12Me21 :P
I am really liking this mod. I am thinking of big signs. I might make signs for Minetest Ville with this. Big billboard signs.
Thank you for your interest Don :) especially considering there are other (*better) mods around.
Diamonds

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Post

12Me21 wrote:ok, I finished the code for the letter making machine, I don't have textures or a crafting yet, but other than that, it works perfectly!

Code: Select all

local characters = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0"}


for _, name in ipairs(characters) do --do this for all characters in the list
	if tonumber(name) ~= nil then --if it's a number
		local desc = "Number "..name 
	else --if it's a letter
		local desc = "Letter "..string.upper(name) --make the letter uppercase in the description
	end

	minetest.register_node("abjphabet:"..name, {
		description = desc,
		tiles = {"abjphabet_"..name..".png"},
		groups = {cracky=3}
	})
end

minetest.register_node("abjphabet:machine", {
	description = "Letter Machine",
	tiles = {"abjphabet_machine.png"},
	paramtype = "light",
	groups = {cracky=2},
	
	after_place_node = function(pos, placer)
		local meta = minetest.env:get_meta(pos)
	end,

	on_construct = function(pos)
		local meta = minetest.env:get_meta(pos)
		meta:set_string("formspec", "invsize[8,6;]"..
			"field[3.8,.5;1,1;lettername;Letter;]"..
			"list[current_name;input;2.5,0.2;1,1;]"..
			"list[current_name;output;4.5,0.2;1,1;]"..
			"list[current_player;main;0,2;8,4;]"..
			"button[2.54,-0.25;3,4;name;Paper -> Letter]")
			local inv = meta:get_inventory()
		inv:set_size("input", 1)
		inv:set_size("output", 1)
	end,

	on_receive_fields = function(pos, formname, fields, sender)
		local meta = minetest.env:get_meta(pos)
		local inv = meta:get_inventory()
		local inputstack = inv:get_stack("input", 1)
		if fields.lettername ~= nil and inputstack:get_name()=="default:paper" then
			for _,v in pairs(characters) do
				if v == fields.lettername then
					local give = {}
					give[1] = inv:add_item("output","abjphabet:"..fields.lettername)
					inputstack:take_item()
					inv:set_stack("input",1,inputstack)
					break
				end
			end
			
		end   
	end
})
Wow :D thanks. Is that for the init.lua?
And BTW I'm gonna check out MyDecks to see what it is :)

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Post

ABJ wrote:Hello All
Thank you for all the help you have been giving.
This is by far the best community I have been in.
Best Diamond Mines
ABJ

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Post

Talking about crafting, 100% poll tells me to make craft recipes. So, well, I need to make an ore for this, to craft the blocks etc and the machine and to put in to the machine to make letters. numbers, symbols, etc so there will not be so much dependence..
I'm thinking of a name for the ore.
Abcium (:D)(Pronounced A B Cium)
If the name isn't good (*funny lol) enough for you, feel free to suggest another name.

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Abjphabet [abjphabet]

by Don » Post

ABJ wrote:Talking about crafting, 100% poll tells me to make craft recipes. So, well, I need to make an ore for this, to craft the blocks etc and the machine and to put in to the machine to make letters. numbers, symbols, etc so there will not be so much dependence..
I'm thinking of a name for the ore.
Abcium (:D)(Pronounced A B Cium)
If the name isn't good (*funny lol) enough for you, feel free to suggest another name.
I like the name.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Post

Don wrote:
ABJ wrote:Talking about crafting, 100% poll tells me to make craft recipes. So, well, I need to make an ore for this, to craft the blocks etc and the machine and to put in to the machine to make letters. numbers, symbols, etc so there will not be so much dependence..
I'm thinking of a name for the ore.
Abcium (:D)(Pronounced A B Cium)
If the name isn't good (*funny lol) enough for you, feel free to suggest another name.
I like the name.
I think you should just need to put the raw ore, so it isn't too hard to make.

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Post

12Me21 wrote:I think you should just need to put the raw ore, so it isn't too hard to make.
Thats what I was thinking to do :)

BTW 12Me21 your code is making my head explode :D I've really gotta learn to code

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Post

BTWA is it possible to use the != sign instead of that thing which I can't find the key for? Or is lua really that different from Python?

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Post

ABJ wrote:BTWA is it possible to use the != sign instead of that thing which I can't find the key for? Or is lua really that different from Python?
No, I think you have to do ~=.

the "~" symbol is usually right below the escape key, if your keyboard doesn't have it, you can hold the ALT key, then type "95" on the number pad, then release the alt key. (unless you don't have a number pad)

Anyway, I'm still working on some 16x16 textures, and I noticed that the default textures have some problems; for example, some have a few pixels of black in the space around the letters, and some letters aren't centered.

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Post

ABJ wrote:
12Me21 wrote:ok, I finished the code for the letter making machine, I don't have textures or a crafting yet, but other than that, it works perfectly!

Code: Select all

local characters = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0"} --lo


for _, name in ipairs(characters) do --do this for all characters in the list
	if tonumber(name) ~= nil then --if it's a number
		local desc = "Number "..name 
	else --if it's a letter
		local desc = "Letter "..string.upper(name) --make the letter uppercase in the description
	end

	minetest.register_node("abjphabet:"..name, {
		description = desc,
		tiles = {"abjphabet_"..name..".png"},
		groups = {cracky=3}
	})
end

minetest.register_node("abjphabet:machine", {
	description = "Letter Machine",
	tiles = {"abjphabet_machine.png"},
	paramtype = "light",
	groups = {cracky=2},
	
	after_place_node = function(pos, placer)
		local meta = minetest.env:get_meta(pos)
	end,

	on_construct = function(pos)
		local meta = minetest.env:get_meta(pos)
		meta:set_string("formspec", "invsize[8,6;]"..
			"field[3.8,.5;1,1;lettername;Letter;]"..
			"list[current_name;input;2.5,0.2;1,1;]"..
			"list[current_name;output;4.5,0.2;1,1;]"..
			"list[current_player;main;0,2;8,4;]"..
			"button[2.54,-0.25;3,4;name;Paper -> Letter]")
			local inv = meta:get_inventory()
		inv:set_size("input", 1)
		inv:set_size("output", 1)
	end,

	on_receive_fields = function(pos, formname, fields, sender)
		local meta = minetest.env:get_meta(pos)
		local inv = meta:get_inventory()
		local inputstack = inv:get_stack("input", 1)
		if fields.lettername ~= nil and inputstack:get_name()=="default:paper" then
			for _,v in pairs(characters) do
				if v == fields.lettername then
					local give = {}
					give[1] = inv:add_item("output","abjphabet:"..fields.lettername)
					inputstack:take_item()
					inv:set_stack("input",1,inputstack)
					break
				end
			end
			
		end   
	end
})
Wow :D thanks. Is that for the init.lua? ....
Yeah, just replace the current text with this one.

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [Mod] Abjphabet [abjphabet]

by rubenwardy » Post

It's called a tilde. ~
For me it's near the enter key / back space key - if my 'muscle memory' serves me right.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Post

ABJ, what type of keyboard do you use?

Builder123
Member
Posts: 85
Joined: Mon Dec 15, 2014 21:50
IRC: Builder123
In-game: Builder123

Re: [Mod] Abjphabet [abjphabet]

by Builder123 » Post

Code: Select all

letters: a,b,c,d,e,f,g,h,I,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Post

rubenwardy wrote:It's called a tilde. ~
For me it's near the enter key / back space key - if my 'muscle memory' serves me right.
This is the key you seem to be mentioning \| no tilde for me!
There used to be a tilde there but it's no longer typable
I got it by doing Shift+`. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!~~~~~~~~~~~~~~~~~`

Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests