Lua - Reddit – Telegram
Lua - Reddit
30 subscribers
281 photos
31 videos
4.26K links
News and discussion for the Lua programming language.

Subreddit: https://www.reddit.com/r/lua

Powered by : @r_channels & @reddit2telegram
Download Telegram
How to prevent Lua from aborting the entire program

im trying to embed Lua 5.3.6 into a game, but i dont want lua to abort my program when it encouters an error, and i cant find a way to make sure these two functions are called in protected mode, the first function is called from a lua_CFunction, second is a lua_CFunction, i dont want to have to call all my c functions using pcall in lua, but im fine with pcall in cpp

GameObjectType get_GameObjectType(lua_State L, const int idx) {
void ud = luaL_checkudata(L, idx, "core.GameObjectType");
luaL_argcheck(L, ud != nullptr, idx, "GameObject expected");
return static_cast<GameObjectType
>(ud);
}

static int coregetroot (luaState *L) {
auto *game
objecttype = createGameObjectType(L);
try {
gameobjecttype->object = core::getroot();
} catch (const std::exception& e) {
luaL
error(L,e.what());
}

return 1;
};

https://redd.it/1pql0w6
@r_lua
Winter Games Tournament
https://redd.it/1pqthco
@r_lua
is luadist safe to install lua?

if not,how can i install it for windows 10

thanks:)

https://redd.it/1pt7x7o
@r_lua
Vectarine: A game framework for ultra fast prototyping

I really like Love2D for making games, but it is annoying to export on the web. I like participating in game jams on itch.io and having a web version for people to test is a must. Moreover, I need to restart my game when I make a change to see it which slows me down where coding. That's why I made https://github.com/vanyle/vectarine/ It is a hybrid between a framework and a game engine.

You write your game in Lua (or Luau) and as you save, you see changes instantly. Also, I've automated the export process to make is super simple + added a bunch of other helpful tools to simplify debugging

The engine's interface looks like this:

https://preview.redd.it/tbochxvdcf9g1.png?width=1824&format=png&auto=webp&s=8f3178b29eadae72982997de4ef4a8d3ed4111e5

I'm open to feedback! There is a lot missing right now like Joystick support but I want to improve it over time.

https://redd.it/1pvo97d
@r_lua
Can I learn lua with dyslexia

I seen bits of lua and it looks fun but I have dyslexia and have a hard time with long words so I was wondering if lua may not be the best thing for me to try to make a hobby and if so where is the best place to try to learn lua with like hand on. Because I dont want to watch a video that is just going to tell me how to do anything. I learn better well doing it myself as well. And one other thing how long does it take the average person to learn lua?

https://redd.it/1q02ksm
@r_lua
Need help updating code (for gmod)

I found a gmod mod that allows you to get some cool camera shots but it doesn't work. From what I understand it is outdated and I need help updating it since I don't know basically any coding. Some of the commands work but the really important ones don't. I have fixed the "add" command by replacing GetViewEntity() with Entity( 1 ):GetViewEntity() but other than that it is difficult to know what to do.

Basically all the command say something like this

\] smoothcam play



[ERROR\] lua/autorun/smoothcam.lua:147: attempt to index global 'gui' (a nil value)

1. Play - lua/autorun/smoothcam.lua:147

2. unknown - lua/autorun/smoothcam.lua:416

3. unknown - lua/includes/modules/concommand.lua:54



link to the original mod: https://github.com/WilliamVenner/gmod-smoothcam

https://redd.it/1q0btqp
@r_lua
I built a Lua/Luau obfuscator with control-flow flattening and anti-tamper - looking for feedback

I’ve been working on a Lua/Luau obfuscator as a side project.

It’s not just a renamer - it includes:

string encryption
control-flow flattening
integrity-bound API indirection
environment hardening (anti-hooking)

Here’s a small before/after example:
*https://pastebin.com/raw/GNFGha8e*

I’m mainly looking for feedback or ideas on what could be improved.

If anyone’s curious, I have a Discord where I post builds and updates.

https://redd.it/1q0gbj8
@r_lua
Is Lua the right step to learn how to code a roblox game?

So, I want to learn how to code so I can make my own story game on roblox. Yet, I am not sure if I am going in the right step or not. Since I heard that Roblox game used Lua or a variation of it.

If it is, what resources should I use to learn lua more, since I am finding coddy tech frustating to use and learn from. Since I would type it thinking I got it correct but then I am stuck and the ai help doesn't work for me. (A human imput would be better since I normally find when a human who has experince can normally find out what I did wrong)

If this isn't the correct step then what should I do instead?



https://redd.it/1q15r42
@r_lua
What are some of your problems with lua?

Love2d and other libraries are welcome but just say what library your talking about

https://redd.it/1q1euey
@r_lua
Not sure if this is allowed but I'm looking for people to help with my project
https://redd.it/1q27234
@r_lua
Made this cool stylized Lua logo, thoughts?
https://redd.it/1q2minc
@r_lua
Made this cool stylized Lua logo, thoughts?
https://redd.it/1q2minc
@r_lua
Is there a CLI of lua-language-server's type checking?

I have a Lua project (Neovim plugin).
I'd like to use Neovim's type definitions files, which are provided as LuaLS's @meta things.
I'd like to include type checking in my CI to prevents, but it looks like LuaLS does not work as standalone type checker.
Therefore I looked for typed lua things but none of them sounds great. (teal and stella are not lua, selene does not support LuaLS style type annotations)

Is there a project that does this? Or is there a workaround?

https://redd.it/1q2werf
@r_lua
What are some of your problems with lua?

Love2d and other libraries are welcome but just say what library your talking about

https://redd.it/1q1euey
@r_lua
Is Lua the right step to learn how to code a roblox game?

So, I want to learn how to code so I can make my own story game on roblox. Yet, I am not sure if I am going in the right step or not. Since I heard that Roblox game used Lua or a variation of it.

If it is, what resources should I use to learn lua more, since I am finding coddy tech frustating to use and learn from. Since I would type it thinking I got it correct but then I am stuck and the ai help doesn't work for me. (A human imput would be better since I normally find when a human who has experince can normally find out what I did wrong)

If this isn't the correct step then what should I do instead?



https://redd.it/1q15r42
@r_lua
I built a Lua/Luau obfuscator with control-flow flattening and anti-tamper - looking for feedback

I’ve been working on a Lua/Luau obfuscator as a side project.

It’s not just a renamer - it includes:

string encryption
control-flow flattening
integrity-bound API indirection
environment hardening (anti-hooking)

Here’s a small before/after example:
*https://pastebin.com/raw/GNFGha8e*

I’m mainly looking for feedback or ideas on what could be improved.

If anyone’s curious, I have a Discord where I post builds and updates.

https://redd.it/1q0gbj8
@r_lua
Can I learn lua with dyslexia

I seen bits of lua and it looks fun but I have dyslexia and have a hard time with long words so I was wondering if lua may not be the best thing for me to try to make a hobby and if so where is the best place to try to learn lua with like hand on. Because I dont want to watch a video that is just going to tell me how to do anything. I learn better well doing it myself as well. And one other thing how long does it take the average person to learn lua?

https://redd.it/1q02ksm
@r_lua