Ok, here's my current version of the init.lua:
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
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",
--ADD SYMBOLS HERE:
",",
".",
"'",
"?",
"!",
":",
"-",
";",
"(",
")",
"+",
"*",
"/",
"^",
"<",
">"}
local characternodenames={"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",
--Put the names for your symbols here (in order):
"comma",
"period",
"apostrophe",
"question_mark",
"exclamation_mark",
"colon",
"dash",
"semi_colon",
"left_p",
"right_p",
"plus",
"star",
"slash",
"up",
"left",
"right"}
for i, char in ipairs(characters) do --do this for all characters in the list
minetest.register_node("abjphabet:"..characternodenames[i],{
description = string.upper(char),
tiles = {"abjphabet_"..characternodenames[i]..".png"},
groups = {cracky=3}
})
end
minetest.register_node("abjphabet:machine", {
description = "Letter Machine",
tiles = {"abjphabet_machine.png"},
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;]".. --setting up the inventory inside
"field[3.8,.5;1,1;lettername;Letter;]".. --text input
"list[current_name;input;2.5,0.2;1,1;]".. --material input
"list[current_name;output;4.5,0.2;1,1;]".. --letter block output
"list[current_player;main;0,2;8,4;]".. --player's inventory
"button[2.54,-0.25;3,4;name;Paper -> Letter]") --craft button
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)
local lettername = fields.lettername
if lettername and (inputstack:get_name()=="default:paper" or minetest.setting_getbool("creative_mode")) then
for i, char in pairs(characters) do
if char == string.lower(lettername) then
local give = {}
give[1] = inv:add_item("output","abjphabet:"..characternodenames[i])
if not minetest.setting_getbool("creative_mode") then
inputstack:take_item()
inv:set_stack("input",1,inputstack)
end
break
end
end
end
end
})
and here are my textures:
https://www.dropbox.com/s/3i92d4a4cychv ... z.zip?dl=0I haven't done all of them yet, and I will probably make changes to these ones later.