[Mod] Abjphabet [abjphabet]

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

-Make these nodes into uncraftable minables
2
18%
-Go on and think up craft recipes anyway
9
82%
 
Total votes : 11

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Tue Apr 07, 2015 21:54

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!

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"}


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: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Abjphabet [abjphabet]

by Don » Tue Apr 07, 2015 23:42

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!

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"}


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: 826
Joined: Tue Mar 05, 2013 00:36

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Tue Apr 07, 2015 23:48

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: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Abjphabet [abjphabet]

by Don » Wed Apr 08, 2015 00:05

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: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Wed Apr 08, 2015 11:22

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: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Wed Apr 08, 2015 11:26

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: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Wed Apr 08, 2015 11:29

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: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Wed Apr 08, 2015 11:31

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!

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"}


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: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Wed Apr 08, 2015 11:32

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: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Wed Apr 08, 2015 11:39

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: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Abjphabet [abjphabet]

by Don » Wed Apr 08, 2015 11:52

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: 826
Joined: Tue Mar 05, 2013 00:36

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Wed Apr 08, 2015 11:56

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: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Wed Apr 08, 2015 13:34

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: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Wed Apr 08, 2015 13:43

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: 826
Joined: Tue Mar 05, 2013 00:36

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Wed Apr 08, 2015 14:29

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: 826
Joined: Tue Mar 05, 2013 00:36

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Wed Apr 08, 2015 14:53

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!

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"} --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
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Abjphabet [abjphabet]

by rubenwardy » Wed Apr 08, 2015 15:05

It's called a tilde. ~
For me it's near the enter key / back space key - if my 'muscle memory' serves me right.
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Wed Apr 08, 2015 15:34

ABJ, what type of keyboard do you use?
 

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

Re: [Mod] Abjphabet [abjphabet]

by Builder123 » Wed Apr 08, 2015 15:41

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
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: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Wed Apr 08, 2015 15:43

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+`. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!~~~~~~~~~~~~~~~~~`
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Wed Apr 08, 2015 15:44

12Me21 wrote:ABJ, what type of keyboard do you use?

QWERTY
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Wed Apr 08, 2015 15:45

Builder123 wrote:
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
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

Where does that go?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Abjphabet [abjphabet]

by rubenwardy » Wed Apr 08, 2015 18:47

Keyboards are all different. :(

Mine's like this (not my PIC, though)

Image
 

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

Re: [Mod] Abjphabet [abjphabet]

by Builder123 » Wed Apr 08, 2015 19:04

Enable letters
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Wed Apr 08, 2015 19:05

OK, so now we need to decide on what symbols to include.

I think A-Z, 0-9, plus simple punctuation like . , ? ! ' - , and also arrows: ↑↓←→
that totals 46.

of course, it's simple to add and remove blocks, but we still would need textures.

EDIT:
OK, I just realized that there's a huge problem... some symbols are not allowed in filenames/node names.
 

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

Re: [Mod] Abjphabet [abjphabet]

by Don » Wed Apr 08, 2015 21:54

12Me21 wrote:OK, so now we need to decide on what symbols to include.

I think A-Z, 0-9, plus simple punctuation like . , ? ! ' - , and also arrows: ↑↓←→
that totals 46.

of course, it's simple to add and remove blocks, but we still would need textures.

EDIT:
OK, I just realized that there's a huge problem... some symbols are not allowed in filenames/node names.

Use the name for the symbol
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: 826
Joined: Tue Mar 05, 2013 00:36

Re: [Mod] Abjphabet [abjphabet]

by 12Me21 » Wed Apr 08, 2015 22:06

Don wrote:
12Me21 wrote:OK, so now we need to decide on what symbols to include.

I think A-Z, 0-9, plus simple punctuation like . , ? ! ' - , and also arrows: ↑↓←→
that totals 46.

of course, it's simple to add and remove blocks, but we still would need textures.

EDIT:
OK, I just realized that there's a huge problem... some symbols are not allowed in filenames/node names.

Use the name for the symbol


I think i'll just use the ascii number
 

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

Re: [Mod] Abjphabet [abjphabet]

by Builder123 » Thu Apr 09, 2015 00:55

Try Harder @~#}]{[_-+=)(*&^%$£"!¬`?/.,<>:; ALL
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Abjphabet [abjphabet]

by ABJ » Thu Apr 09, 2015 10:49

Well I can't add everything at once. I'll start with the essentials like full stop, comma, apostrophe, slashes etc
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Abjphabet [abjphabet]

by rubenwardy » Thu Apr 09, 2015 11:06

It wouldn't be that hard to use imagemagick to generate all these letters automatically.

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
convert -background white -fill black  -font Arial \
          -size 32x32  -gravity center \
          label:A     output.png
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 25 guests

cron