How to Lua with Leadwerks 5
Hi guys, I spent all week putting together this super Lua lesson for game developers. It's focused on using Lua with our game engine Leadwerks 5, but most of the knowledge is general Lua programming. Please let me know if any parts of it are confusing, and if you have any ideas how it can be improved. I hope you enjoy the tutorial!
https://www.youtube.com/watch?v=eBcbB\_Pnj\_c
https://preview.redd.it/ksxp897debcf1.jpg?width=1920&format=pjpg&auto=webp&s=aad389f2a449b3bfb540f7fae9200249753b422f
https://redd.it/1lxj9lj
@r_lua
Hi guys, I spent all week putting together this super Lua lesson for game developers. It's focused on using Lua with our game engine Leadwerks 5, but most of the knowledge is general Lua programming. Please let me know if any parts of it are confusing, and if you have any ideas how it can be improved. I hope you enjoy the tutorial!
https://www.youtube.com/watch?v=eBcbB\_Pnj\_c
https://preview.redd.it/ksxp897debcf1.jpg?width=1920&format=pjpg&auto=webp&s=aad389f2a449b3bfb540f7fae9200249753b422f
https://redd.it/1lxj9lj
@r_lua
YouTube
How to Lua with Leadwerks 5
This tutorial provides all the programming knowledge you need to write Lua code with the Leadwerks 5 game engine.
https://www.leadwerks.com/learn/Programming
Learn how to make your own games at https://www.leadwerks.com
0:00 Getting Started
2:50 Code Comments…
https://www.leadwerks.com/learn/Programming
Learn how to make your own games at https://www.leadwerks.com
0:00 Getting Started
2:50 Code Comments…
LUA Failure
I tried to create my own mod for Farming Simulator 25. Basically, I wanted to do some of the things Autodrive does, but I don't like the way it does it. I failed. I have a lot of code, but no error messages in my FS25 log.
I don't want to do a copy & paste or a screenshot, but I'd gladly share it here. I added a GNU license to it. so anyone can make it work can use it.
https://redd.it/1lybd68
@r_lua
I tried to create my own mod for Farming Simulator 25. Basically, I wanted to do some of the things Autodrive does, but I don't like the way it does it. I failed. I have a lot of code, but no error messages in my FS25 log.
I don't want to do a copy & paste or a screenshot, but I'd gladly share it here. I added a GNU license to it. so anyone can make it work can use it.
https://redd.it/1lybd68
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
why
you guys know lua dont really support
then why the hell lua creator add
https://redd.it/1lykrp6
@r_lua
you guys know lua dont really support
continue because the creator want minimalistic, if something can be done clearly with existing constructs, lua prefers to not add new syntax.then why the hell lua creator add
repeat until when we can use while loop to mimic this statement?https://redd.it/1lykrp6
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
what is the best way to learn lua?
I've been looking for ways to learn Lua for a while now but I cant seem to find any, does anyone have any ideas for me such as a book/website that worked for them. Thanks!
https://redd.it/1lyxs93
@r_lua
I've been looking for ways to learn Lua for a while now but I cant seem to find any, does anyone have any ideas for me such as a book/website that worked for them. Thanks!
https://redd.it/1lyxs93
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Lua learner de/ger
Hey everyone,
I’m 15 and just started learning Roblox Lua from absolute zero — I have no coding experience at all.
I decided to document my learning journey step by step on TikTok (the videos are in German), mainly to stay motivated and maybe help others who are starting out too.
My Channel is forcgz
If you’re also learning Lua, working on Roblox projects, or just curious, feel free to check it out. I’d really appreciate any support or tips from more experienced devs!
https://redd.it/1m0gg15
@r_lua
Hey everyone,
I’m 15 and just started learning Roblox Lua from absolute zero — I have no coding experience at all.
I decided to document my learning journey step by step on TikTok (the videos are in German), mainly to stay motivated and maybe help others who are starting out too.
My Channel is forcgz
If you’re also learning Lua, working on Roblox projects, or just curious, feel free to check it out. I’d really appreciate any support or tips from more experienced devs!
https://redd.it/1m0gg15
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Error: Build error: Failed compiling module lpeglabel.dll
Can someone try installing that rock and see if it works or help me troubleshoot this? I'm stuck in dependency hell.
https://redd.it/1m0l2zw
@r_lua
Can someone try installing that rock and see if it works or help me troubleshoot this? I'm stuck in dependency hell.
https://redd.it/1m0l2zw
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Good lua minifier with options
What I'm looking for:
1. A minifier. Optional obfuscation doesn't hurt, but it is not something I care about
2. Option to ignore renaming certain variables/globals, e.g. callbacks.
3. I'm very character constrained, so 'simple' minifying is not enough
4. Optimally I can run it locally.
Would love any pointers or suggestions! I only found two possible candidates but neither was usable:
\- https://github.com/mathiasbynens/luamin \- doesn't seem to have any way to not rename specific variables/globals
\- https://github.com/stravant/lua-minify \- has a global rename ignore list, but it didn't seem to use it? couldn't get it not to rename certain globals on my machine
https://redd.it/1m0pa8b
@r_lua
What I'm looking for:
1. A minifier. Optional obfuscation doesn't hurt, but it is not something I care about
2. Option to ignore renaming certain variables/globals, e.g. callbacks.
3. I'm very character constrained, so 'simple' minifying is not enough
4. Optimally I can run it locally.
Would love any pointers or suggestions! I only found two possible candidates but neither was usable:
\- https://github.com/mathiasbynens/luamin \- doesn't seem to have any way to not rename specific variables/globals
\- https://github.com/stravant/lua-minify \- has a global rename ignore list, but it didn't seem to use it? couldn't get it not to rename certain globals on my machine
https://redd.it/1m0pa8b
@r_lua
GitHub
GitHub - mathiasbynens/luamin: A Lua minifier written in JavaScript
A Lua minifier written in JavaScript. Contribute to mathiasbynens/luamin development by creating an account on GitHub.
clickhouse-lua: A simple, lightweight HTTP-based ClickHouse client for Lua
https://github.com/EvandroLG/clickhouse-lua
https://redd.it/1m0rc9m
@r_lua
https://github.com/EvandroLG/clickhouse-lua
https://redd.it/1m0rc9m
@r_lua
GitHub
GitHub - EvandroLG/clickhouse-lua: A simple, lightweight HTTP-based ClickHouse client for Lua 🗄️
A simple, lightweight HTTP-based ClickHouse client for Lua 🗄️ - EvandroLG/clickhouse-lua
Lua functionalities
So i recently wrote code for a Lua Program that demands A pass code to let you use your computer on start up or else it shuts it down should you get the pass code wrong. Runs in the terminal/CMD and has no GUI to speak of. (Involves lots of os.executes and batch programming)
That worked and I set my sights on a Lua code for file reading.. I want to make a compiled book and was asking if Lua has built PDF file parsing or reading. I know i could just os.execute the thing to open an actual pdf reader and then just manipulate the pdf from in there but I wanted to manipulate via a GUI i will make in Lua.. Any one got a solution? I have used File:read/File:open and file:close() before to write stuff to a CSV and txt but not so sure about reading a PDF and not writing to it. Just reading it.. And scrolling through it from inside my Lua noscript
https://redd.it/1m0selu
@r_lua
So i recently wrote code for a Lua Program that demands A pass code to let you use your computer on start up or else it shuts it down should you get the pass code wrong. Runs in the terminal/CMD and has no GUI to speak of. (Involves lots of os.executes and batch programming)
That worked and I set my sights on a Lua code for file reading.. I want to make a compiled book and was asking if Lua has built PDF file parsing or reading. I know i could just os.execute the thing to open an actual pdf reader and then just manipulate the pdf from in there but I wanted to manipulate via a GUI i will make in Lua.. Any one got a solution? I have used File:read/File:open and file:close() before to write stuff to a CSV and txt but not so sure about reading a PDF and not writing to it. Just reading it.. And scrolling through it from inside my Lua noscript
https://redd.it/1m0selu
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
RT Builder GUI design
I was practicing how to make GUIs in Lua and because I still suck at the hardcoding I opted to use a GUI Builder. I use LuaRT Studio IDE and RT Builder. They allow me to compile noscripts to exe.
https://preview.redd.it/rrd15hxl76df1.png?width=1920&format=png&auto=webp&s=936e62119da31502294097687dbdeab899f325d1
I have this issue. The GUI loads fine but quickly goes off screen like when you run a batch noscript and dont put "pause" in the batch code. I also get the errors down there..
What am i doing wrong here..
https://redd.it/1m14bka
@r_lua
I was practicing how to make GUIs in Lua and because I still suck at the hardcoding I opted to use a GUI Builder. I use LuaRT Studio IDE and RT Builder. They allow me to compile noscripts to exe.
https://preview.redd.it/rrd15hxl76df1.png?width=1920&format=png&auto=webp&s=936e62119da31502294097687dbdeab899f325d1
I have this issue. The GUI loads fine but quickly goes off screen like when you run a batch noscript and dont put "pause" in the batch code. I also get the errors down there..
What am i doing wrong here..
https://redd.it/1m14bka
@r_lua
The shortest Lua C function (0 bytes)
Hi everyone. I just stumbled upon this neat trick and wanted to share it. There is a somewhat useful C function that takes 0 bytes to implement! What it does is return all its own parameters in order (via multiple return).
To register it:
lua_pushcfunction(L, lua_gettop);
lua_setglobal(L, "pass");
To use it:
print(pass("hi", 123, true, "bye"))
Hope this helps someone!
https://redd.it/1m2e9ry
@r_lua
Hi everyone. I just stumbled upon this neat trick and wanted to share it. There is a somewhat useful C function that takes 0 bytes to implement! What it does is return all its own parameters in order (via multiple return).
To register it:
lua_pushcfunction(L, lua_gettop);
lua_setglobal(L, "pass");
To use it:
print(pass("hi", 123, true, "bye"))
Hope this helps someone!
https://redd.it/1m2e9ry
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Is it possible to create an anti-recoil noscript for Fortnite?
Is it possible to create an anti-recoil noscript for Fortnite?.
Well, that's my question. I've spent several hours researching, creating, and practicing various noscripts, and I think they're either not working or are just "placebo" in use. I honestly don't notice it.
My mouse and in-game sensitivity is:
DPI: 850
X-Axis Sensitivity: 9.8%
Y-Axis Sensitivity: 9.8%
Aiming Sensitivity 76% and Crosshair Sensitivity 76%.
These are the following noscripts that I have tried and I have changed some things and it seems that it does not work.
And here is noscript number 2:
Thanks for making it to the end of this post. Could someone help me fix my noscripts? Or give me some tips on how to make it work? Thank you so much, everyone!
https://redd.it/1m2mupt
@r_lua
Is it possible to create an anti-recoil noscript for Fortnite?.
Well, that's my question. I've spent several hours researching, creating, and practicing various noscripts, and I think they're either not working or are just "placebo" in use. I honestly don't notice it.
My mouse and in-game sensitivity is:
DPI: 850
X-Axis Sensitivity: 9.8%
Y-Axis Sensitivity: 9.8%
Aiming Sensitivity 76% and Crosshair Sensitivity 76%.
These are the following noscripts that I have tried and I have changed some things and it seems that it does not work.
EnablePrimaryMouseButtonEvents(true)-- Patrón de recoil ajustado (solo hacia abajo, más agresivo)local recoil_pattern = {{0, 10}, {0, 10}, {0, 9}, {0, 9}, {0, 8}, {0, 8},{0, 7}, {0, 6}, {0, 6}, {0, 5}, {0, 5}, {0, 4},{0, 3}, {0, 3}, {0, 2}, {0, 2}, {0, 1}}function OnEvent(event, arg)if event == "MOUSE_BUTTON_PRESSED" and arg == 1 thenif IsMouseButtonPressed(3) then -- solo se activa si apuntas (click derecho)for i = 1, #recoil_pattern doif not IsMouseButtonPressed(1) then break endMoveMouseRelative(recoil_pattern[i][1], recoil_pattern[i][2])Sleep(16) -- 60 disparos por segundo aprox.endendendendAnd here is noscript number 2:
EnablePrimaryMouseButtonEvents(true)-- Solo recoil vertical, sin movimientos lateraleslocal recoil_pattern = {{0, 10}, {0, 10}, {0, 9}, {0, 9}, {0, 8}, {0, 8},{0, 7}, {0, 7}, {0, 6}, {0, 6}, {0, 5}, {0, 5},{0, 4}, {0, 4}, {0, 3}, {0, 3}, {0, 2}}function OnEvent(event, arg)if event == "MOUSE_BUTTON_PRESSED" and arg == 1 thenif IsMouseButtonPressed(3) then -- Solo si apuntasfor i = 1, #recoil_pattern doif not IsMouseButtonPressed(1) then break endMoveMouseRelative(recoil_pattern[i][1], recoil_pattern[i][2])Sleep(16)endendendendThanks for making it to the end of this post. Could someone help me fix my noscripts? Or give me some tips on how to make it work? Thank you so much, everyone!
https://redd.it/1m2mupt
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
I want to learn lua, need help
I want to learn lua from scratch, but nothing is installed and I don’t know anything about this language. Can someone send me stuff for learning lua please? (Videos, programming environment, docs,…)
https://redd.it/1m3qnz2
@r_lua
I want to learn lua from scratch, but nothing is installed and I don’t know anything about this language. Can someone send me stuff for learning lua please? (Videos, programming environment, docs,…)
https://redd.it/1m3qnz2
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Updates on Caelum
A week ago a made a post on this reddit in regards of a library that I am creating, Caelum, after that post i added more features that made me realize that this project is getting bigger and bigger, when in reality it was meant to be only a small library to help integrate lua in my engine.
At this point I am asking myself, is anyone really interested in a library such as Caelum-lua?
With this question in mind I wanted to make this new post in this reddit to understand more the lua vision and the lua-programmers as a programmar myself coming from a totally different type of programming "habitat".
Let me know your real opinion on the library, where you think it should go, maybe features that are too much or not really lua-centrinc that should be removed, features that you would like to see in a library like this, and if you like you can also bring your ideas directly to the github repo, as I said in the previous post, I would like to expand this library with a community driven vision and ideas.
Feel free to ask any question!
Thank you for your attention, and sorry if it is not really a topic on lua but more on the development path of a library
https://redd.it/1m3x9tr
@r_lua
A week ago a made a post on this reddit in regards of a library that I am creating, Caelum, after that post i added more features that made me realize that this project is getting bigger and bigger, when in reality it was meant to be only a small library to help integrate lua in my engine.
At this point I am asking myself, is anyone really interested in a library such as Caelum-lua?
With this question in mind I wanted to make this new post in this reddit to understand more the lua vision and the lua-programmers as a programmar myself coming from a totally different type of programming "habitat".
Let me know your real opinion on the library, where you think it should go, maybe features that are too much or not really lua-centrinc that should be removed, features that you would like to see in a library like this, and if you like you can also bring your ideas directly to the github repo, as I said in the previous post, I would like to expand this library with a community driven vision and ideas.
Feel free to ask any question!
Thank you for your attention, and sorry if it is not really a topic on lua but more on the development path of a library
https://redd.it/1m3x9tr
@r_lua
GitHub
GitHub - zLouis043/Caelum-lua: Caelum adds Classes, Structs, Enums, Complex-Data-Structures, validators, type-checking system,…
Caelum adds Classes, Structs, Enums, Complex-Data-Structures, validators, type-checking system, and a easy to use reflection system - zLouis043/Caelum-lua
Which tools do you use in your Lua projects?
I'm new to Lua and have found StyLua for formatting and selene for linting. Are these the best options? Are there any other tools I should be using?
https://redd.it/1m456yx
@r_lua
I'm new to Lua and have found StyLua for formatting and selene for linting. Are these the best options? Are there any other tools I should be using?
https://redd.it/1m456yx
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
is there an easy way to run a LUA mouse macro?
Previously used logitech though stopped working
https://redd.it/1m4m2am
@r_lua
Previously used logitech though stopped working
https://redd.it/1m4m2am
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
_G and _ENV
Hello. I am reading the chapter about environments from *Programming in Lua, 4th edition*, and also did online searching regarding `_G` and `_ENV`. Here are my observations and experimenting for record. Feel free to comment if you have something to add or correct.
* The `_ENV` is a local variable for the compiled chunk but can simulate a *global* environment by the compiler's mechanism of prepending all free names with `_ENV.` . Creating and accessing a global variable e.g. `a = 5 print(a)` is equivalent to `_ENV.a = 5 print(_ENV.a)`.
* The `_ENV` is initialized to be the same as `_G`, because `_G == _ENV -- true` (having the same memory address).
* `_ENV` contains a field of `_G`, and `_G` contains a field of `_G` as well.
* A global variable assignment such as `a = 5` puts a key of "a" and value of 5 in `_ENV` and `_G` simultaneously because they are still the same table. Evidenced as below:
​
print(_ENV) -- table: 0x6000017d8040
print(_G) -- table: 0x6000017d8040
a = 5
print(_ENV.a) -- 5
print(_G.a) -- 5
print(_ENV) -- table: 0x6000017d8040
print(_G) -- table: 0x6000017d8040
The result is the same if `a = 5` is replaced by `_ENV = 5` or `_G = 5`.
* However, if `_ENV` is assigned a new table, the memory addresses of `_G` and `_ENV` will be different, but the rule that the *global* environment is `_ENV` still applies.
* Example of overriding the \_ENV:
​
print(_ENV) -- table: 0x600001844200
print(_G) -- table: 0x600001844200
_ENV = {_G = _G, print = _ENV.print} -- can also be print = print or _G.print
print(_ENV) -- table: 0x600001840140 -- different from before
print(_G) -- table: 0x600001844200
a = 5
print(a) -- 5
print(_ENV.a) -- 5
print(_G.a) -- nil
In this case, `_G` will be prepended as `_ENV._G`, but since it was never added the field of "a", `_G.a` is `nil`.
https://redd.it/1m5766o
@r_lua
Hello. I am reading the chapter about environments from *Programming in Lua, 4th edition*, and also did online searching regarding `_G` and `_ENV`. Here are my observations and experimenting for record. Feel free to comment if you have something to add or correct.
* The `_ENV` is a local variable for the compiled chunk but can simulate a *global* environment by the compiler's mechanism of prepending all free names with `_ENV.` . Creating and accessing a global variable e.g. `a = 5 print(a)` is equivalent to `_ENV.a = 5 print(_ENV.a)`.
* The `_ENV` is initialized to be the same as `_G`, because `_G == _ENV -- true` (having the same memory address).
* `_ENV` contains a field of `_G`, and `_G` contains a field of `_G` as well.
* A global variable assignment such as `a = 5` puts a key of "a" and value of 5 in `_ENV` and `_G` simultaneously because they are still the same table. Evidenced as below:
​
print(_ENV) -- table: 0x6000017d8040
print(_G) -- table: 0x6000017d8040
a = 5
print(_ENV.a) -- 5
print(_G.a) -- 5
print(_ENV) -- table: 0x6000017d8040
print(_G) -- table: 0x6000017d8040
The result is the same if `a = 5` is replaced by `_ENV = 5` or `_G = 5`.
* However, if `_ENV` is assigned a new table, the memory addresses of `_G` and `_ENV` will be different, but the rule that the *global* environment is `_ENV` still applies.
* Example of overriding the \_ENV:
​
print(_ENV) -- table: 0x600001844200
print(_G) -- table: 0x600001844200
_ENV = {_G = _G, print = _ENV.print} -- can also be print = print or _G.print
print(_ENV) -- table: 0x600001840140 -- different from before
print(_G) -- table: 0x600001844200
a = 5
print(a) -- 5
print(_ENV.a) -- 5
print(_G.a) -- nil
In this case, `_G` will be prepended as `_ENV._G`, but since it was never added the field of "a", `_G.a` is `nil`.
https://redd.it/1m5766o
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Need beta testers for HRAM (hand-rolled assembly machine)
Hi everyone. I'm making an app called HRAM (hand-rolled assembly machine), and I plan to release it this week. But I need some beta testers first. Please send me an email at admin@90s.dev if you're interested. Your feedback will be helpful enough that I'll give you a free license. The app is only for Windows (10 or 11).
The app is programmable via Lua and has an assembly library built in, so you can create and run assembly functions at runtime. It has a 320x180 pixel screen that you can manipulate to help you practice assembly. The point of the app is to help learn low level concepts, in the fun environment of making a retro style game. I'm also in the process of adding threading/mutexes/etc also, but that may have to wait post release.
Current manual is at https://hram.dev/docs.txt
https://redd.it/1m5jfw0
@r_lua
Hi everyone. I'm making an app called HRAM (hand-rolled assembly machine), and I plan to release it this week. But I need some beta testers first. Please send me an email at admin@90s.dev if you're interested. Your feedback will be helpful enough that I'll give you a free license. The app is only for Windows (10 or 11).
The app is programmable via Lua and has an assembly library built in, so you can create and run assembly functions at runtime. It has a 320x180 pixel screen that you can manipulate to help you practice assembly. The point of the app is to help learn low level concepts, in the fun environment of making a retro style game. I'm also in the process of adding threading/mutexes/etc also, but that may have to wait post release.
Current manual is at https://hram.dev/docs.txt
https://redd.it/1m5jfw0
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community