version=pmwiki-2.2.130 ordered=1 urlencoded=1 agent=Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 author=debiankaios charset=UTF-8 csum= ctime=1634917843 host=77.22.249.150 name=Lua.Minetest-1 rev=5 targets= text=! Coding in Minetest for beginner%0a%0a%0a!! 1.1 Prologue%0a%0aMinetest is an open source voxel game engine. But more Info here:%0a%0a[[https://www.minetest.net/]] [[https://wiki.ircnow.org/index.php?n=Minetest.Minetest]]%0a%0aDepends for this tutorial: There are no, it's for newbie.%0a%0a!! Table of contents %0a%0aNever we get all in one part. There will more then one part. And we get never the complete api in this tutorial. If you have questions ask in [[forums.minetest.net]]. But now table of Contents:%0a%0a# [[https://wiki.ircnow.org/index.php?n=Lua.Minetest-1 | Basics in Lua]]%0a# [[https://wiki.ircnow.org/index.php?n=Lua.Minetest-2 | Our first mod]]%0a%0a!! 1.2 Basics in Lua%0a%0a!!! 1.2.1 Installing lua%0a%0aOpenbsd:%0a[@%0a# pkg_add lua-5.3.5%0a@]%0a%0adebian-based Linux:%0a[@%0a# apt install lua5.3%0a@]%0a%0aFor other systems show here: [[http://www.lua.org/start.html#installing]]%0a%0a!!! 1.2.3 Functions%0a%0aAll who know the basics in lua can show here: [[https://wiki.ircnow.org/index.php?n=Lua.Minetest-2 | Our first mod]]%0a%0aFunctions are the most important in minetest. Without it or similar it where not possible to make a such game. You can easy run a function:%0a%0a[@%0afunction(argument)%0a@]%0a%0aThe first function which you learn is print(). Create a new file named "main.lua" in a new folder which you can name how you want and write in main.lua:%0a%0a[@%0aprint("Hello World!")%0a@]%0a%0aSave it and run in the console following command:%0a%0a[@%0a$ lua5.3 %3cpath-to-your-progamm>/main.lua%0a@]%0a%0aIf all working correct you should get put out:%0a%0a[@%0a$ lua5.3 %3cpath-to-your-progamm>/main.lua%0aHello World!%0a@]%0a%0aTroubleshooting:%0a%0a[@%0a$ lua5.3 %3cpath-to-your-progamm>/main.lua%0alua5.3: main.lua:1: ')' expected near 'World'%0a@]%0a%0aYou forgot the "". Why you need this you will sea in 1.2.4%0a%0a[@%0a$ lua5.3 %3cpath-to-your-progamm>/main.lua%0abash: lua5.3: Command not found.%0a@]%0a%0aYou don't have lua installed. Maybe lua5.3 is to new for your os. Try to install older versions. But then do this:%0a%0a[@%0a$ lua%3cyour version> %3cpath-to-your-progamm>/main.lua%0a@]%0a%0a!!! 1.2.4 Variables%0a%0aIn Variables can you save data. But if you end the programm it will deleted. In lua are 3 main types of variables: intenger, floats and string. Strings we have already met in 1.2.3. Like the name say are strings strings. Important is that we on begin and on end one of this Charachters need: ' or ". You can choose one of them, which you like more, but you must on beginn and on end the same charachter choose. If in strings should stand one of this charachters, you must choose the other charachter. If there is no of this charachters then think lua you meant a other variable which you want set in there. More to this thema in 1.2.5. But there are two more types: floats and integer. Both are number-values. The different is one are decimal numbers the floats and the other are integer(yes, the integer). Both types need no charachters on end beginning because variable names can't begin with numbers. Lets define our first variables:%0a%0a[@%0astring = "Our first Integer and our first float: "%0ainteger = 12%0afloat = 12.34%0aprint(string)%0a@]%0a%0aOutput:%0a[@%0a$ lua5.3 main.lua%0aOur first Integer and our first float: %0a@]%0a%0aNice, but we can only print one variable. How to fix it?%0a%0a!!! 1.2.5 Functions with more then one argument%0a%0aFunctions can not have only one argument, they can have more then one argument. We separate they with a comma. Lets test:%0a%0a[@%0astring = "Our first Integer and our first float: "%0ainteger = 12%0afloat = 12.34%0aprint(string, integer, float)%0a@]%0a%0aOutput:%0a%0a[@l$ lua5.3 main.lua %0aOur first Integer and our first float: 12 12.34%0a@]%0a%0aOk thats nice. But there are spaces. time=1635071421 author:1635071421=debiankaios diff:1635071421:1635071297:= host:1635071421=77.22.249.150 author:1635071297=debiankaios diff:1635071297:1634999127:=86,120c86%0a%3c In Variables can you save data. But if you end the programm it will deleted. In lua are 3 main types of variables: intenger, floats and string. Strings we have already met in 1.2.3. Like the name say are strings strings. Important is that we on begin and on end one of this Charachters need: ' or ". You can choose one of them, which you like more, but you must on beginn and on end the same charachter choose. If in strings should stand one of this charachters, you must choose the other charachter. If there is no of this charachters then think lua you meant a other variable which you want set in there. More to this thema in 1.2.5. But there are two more types: floats and integer. Both are number-values. The different is one are decimal numbers the floats and the other are integer(yes, the integer). Both types need no charachters on end beginning because variable names can't begin with numbers. Lets define our first variables:%0a%3c %0a%3c [@%0a%3c string = "Our first Integer and our first float: "%0a%3c integer = 12%0a%3c float = 12.34%0a%3c print(string)%0a%3c @]%0a%3c %0a%3c Output:%0a%3c [@%0a%3c $ lua5.3 main.lua%0a%3c Our first Integer and our first float: %0a%3c @]%0a%3c %0a%3c Nice, but we can only print one variable. How to fix it?%0a%3c %0a%3c !!! 1.2.5 Functions with more then one argument%0a%3c %0a%3c Functions can not have only one argument, they can have more then one argument. We separate they with a comma. Lets test:%0a%3c %0a%3c [@%0a%3c string = "Our first Integer and our first float: "%0a%3c integer = 12%0a%3c float = 12.34%0a%3c print(string, integer, float)%0a%3c @]%0a%3c %0a%3c Output:%0a%3c %0a%3c [@l$ lua5.3 main.lua %0a%3c Our first Integer and our first float: 12 12.34%0a%3c @]%0a%3c %0a%3c Ok thats nice. But there are spaces.%0a\ No newline at end of file%0a---%0a> In Variables can you save data. But if you end the programm it will deleted. In lua are 3 main types of variables: intenger, floats and string. Strings we have already met in 1.2.3. Like the name say are strings strings. Important is that we on begin and on end one of this Charachters need: ' or ". You can choose one of them, which you like more, but you must on beginn and on end the same charachter choose. If in strings should stand one of this charachters, you must choose the other charachter. If there is no of this charachters then think lua you meant a other variable which you want set in there. More to this thema in 1.2.5. But there are two more types: floats and integer. Both are number-values. The different is one are decimal numbers the floats and the other are integer(yes, the integer). Both types need no charachters on end beginning because variable names can't begin with numbers.%0a\ No newline at end of file%0a host:1635071297=77.22.249.150 author:1634999127=debiankaios diff:1634999127:1634923935:=35,36c35,36%0a%3c !!! 1.2.3 Functions%0a%3c %0a---%0a> !!! 1.2.2 Functions%0a> %0a71,72c71,72%0a%3c You forgot the "". Why you need this you will sea in 1.2.4%0a%3c %0a---%0a> You forgot the "". Why you need this you will sea in 1.2.3%0a> %0a84,86c84,86%0a%3c !!! 1.2.4 Variables%0a%3c %0a%3c In Variables can you save data. But if you end the programm it will deleted. In lua are 3 main types of variables: intenger, floats and string. Strings we have already met in 1.2.3. Like the name say are strings strings. Important is that we on begin and on end one of this Charachters need: ' or ". You can choose one of them, which you like more, but you must on beginn and on end the same charachter choose. If in strings should stand one of this charachters, you must choose the other charachter. If there is no of this charachters then think lua you meant a other variable which you want set in there. More to this thema in 1.2.5. But there are two more types: floats and integer. Both are number-values. The different is one are decimal numbers the floats and the other are integer(yes, the integer). Both types need no charachters on end beginning because variable names can't begin with numbers. %0a\ No newline at end of file%0a---%0a> !!! 1.2.3 Variables%0a> %0a> In Variables can you save data. But if you end the programm it will deleted.%0a\ No newline at end of file%0a host:1634999127=77.22.249.150 author:1634923935=debiankaios diff:1634923935:1634917843:=84,86d83%0a%3c !!! 1.2.3 Variables%0a%3c %0a%3c In Variables can you save data. But if you end the programm it will deleted.%0a\ No newline at end of file%0a host:1634923935=77.22.249.150 author:1634917843=debiankaios diff:1634917843:1634917843:=1,83d0%0a%3c ! Coding in Minetest for beginner%0a%3c %0a%3c %0a%3c !! 1.1 Prologue%0a%3c %0a%3c Minetest is an open source voxel game engine. But more Info here:%0a%3c %0a%3c [[https://www.minetest.net/]] [[https://wiki.ircnow.org/index.php?n=Minetest.Minetest]]%0a%3c %0a%3c Depends for this tutorial: There are no, it's for newbie.%0a%3c %0a%3c !! Table of contents %0a%3c %0a%3c Never we get all in one part. There will more then one part. And we get never the complete api in this tutorial. If you have questions ask in [[forums.minetest.net]]. But now table of Contents:%0a%3c %0a%3c # [[https://wiki.ircnow.org/index.php?n=Lua.Minetest-1 | Basics in Lua]]%0a%3c # [[https://wiki.ircnow.org/index.php?n=Lua.Minetest-2 | Our first mod]]%0a%3c %0a%3c !! 1.2 Basics in Lua%0a%3c %0a%3c !!! 1.2.1 Installing lua%0a%3c %0a%3c Openbsd:%0a%3c [@%0a%3c # pkg_add lua-5.3.5%0a%3c @]%0a%3c %0a%3c debian-based Linux:%0a%3c [@%0a%3c # apt install lua5.3%0a%3c @]%0a%3c %0a%3c For other systems show here: [[http://www.lua.org/start.html#installing]]%0a%3c %0a%3c !!! 1.2.2 Functions%0a%3c %0a%3c All who know the basics in lua can show here: [[https://wiki.ircnow.org/index.php?n=Lua.Minetest-2 | Our first mod]]%0a%3c %0a%3c Functions are the most important in minetest. Without it or similar it where not possible to make a such game. You can easy run a function:%0a%3c %0a%3c [@%0a%3c function(argument)%0a%3c @]%0a%3c %0a%3c The first function which you learn is print(). Create a new file named "main.lua" in a new folder which you can name how you want and write in main.lua:%0a%3c %0a%3c [@%0a%3c print("Hello World!")%0a%3c @]%0a%3c %0a%3c Save it and run in the console following command:%0a%3c %0a%3c [@%0a%3c $ lua5.3 %3cpath-to-your-progamm>/main.lua%0a%3c @]%0a%3c %0a%3c If all working correct you should get put out:%0a%3c %0a%3c [@%0a%3c $ lua5.3 %3cpath-to-your-progamm>/main.lua%0a%3c Hello World!%0a%3c @]%0a%3c %0a%3c Troubleshooting:%0a%3c %0a%3c [@%0a%3c $ lua5.3 %3cpath-to-your-progamm>/main.lua%0a%3c lua5.3: main.lua:1: ')' expected near 'World'%0a%3c @]%0a%3c %0a%3c You forgot the "". Why you need this you will sea in 1.2.3%0a%3c %0a%3c [@%0a%3c $ lua5.3 %3cpath-to-your-progamm>/main.lua%0a%3c bash: lua5.3: Command not found.%0a%3c @]%0a%3c %0a%3c You don't have lua installed. Maybe lua5.3 is to new for your os. Try to install older versions. But then do this:%0a%3c %0a%3c [@%0a%3c $ lua%3cyour version> %3cpath-to-your-progamm>/main.lua%0a%3c @]%0a%3c %0a host:1634917843=77.22.249.150