Killbrick
I wanna code like a custom killbrick for an obby in Roblox but oh my god Copilot is useless.
https://redd.it/1jwc8iu
@r_lua
I wanna code like a custom killbrick for an obby in Roblox but oh my god Copilot is useless.
https://redd.it/1jwc8iu
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Anyone know a good starting point?
I know literally nothing about coding, and the "tutorials" ive been searching up usually involve background knowledge i really don't have, anyone know what i should do to start out?
https://redd.it/1jwfya1
@r_lua
I know literally nothing about coding, and the "tutorials" ive been searching up usually involve background knowledge i really don't have, anyone know what i should do to start out?
https://redd.it/1jwfya1
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Venting - Lua vs C# for game development?
Ok, so I've posted a similar question in the "gamedev" subreddit asking why C# is much more popular than Lua when it comes to making games. A decade ago, whenever someone mentioned "Lua", you sort of instinctively knew they were making games. Lua has been integrated a lot into game engines for noscripting or into games for modding. Lua was also used as a standalone programming language to build games (latest indie hit being Balatro).
As someone who started with Python, Lua's simpliciy, performance and inter-operability with C makes the development experience smooth and satisfying. I prefer it much over C# due to C# being more heavy in features, features I don't always want, need or understand and my experience with Java in the past was bad (the worst being the boilerplate and how every piece of data has it's own class, meaning you need to go through many conversions and getters to get a simple boolean). I get it, C# is "more beautiful" than Java.
But lately C# seems to grow more and more and Lua seems to be forgotten, like, no more recommended or talked as much about. I know big part of it is because of Unity, but what else makes working in C# enjoyable? It can't be all about it being in Unity that even Godot adopted and Defold is attempting to do so too.
So as I said, I posted in the other sub, just to get downvoted big time and be given answers that, while I respect in terms knowledge fidelity, were sort of agressive. "You cant with Lua", "No types = garbage", stuff like that.'So I don't really get it. You could say I am venting now, and that is correct. But i'm more confused than anything.
If I were to respond to the critics brought to Lua, I would say people who use C# don't even use C# at it's full potential as a PL (that being their main reasoning, Lua is a noscripting language while C# is a full-blown PL), they are using it for noscripting in Unity and that comes with a lot of magic abstractions like function decorators which I dislike a lot. So in that scenario, it's like almost not relevant at all if you have type safety or not as long as you're a little disciplined and you have documented your code. Also, GDScript and UE's blueprint system were succesful so far, I don't see why C# is not just a "better" option, but "the must".
https://redd.it/1jwwkwu
@r_lua
Ok, so I've posted a similar question in the "gamedev" subreddit asking why C# is much more popular than Lua when it comes to making games. A decade ago, whenever someone mentioned "Lua", you sort of instinctively knew they were making games. Lua has been integrated a lot into game engines for noscripting or into games for modding. Lua was also used as a standalone programming language to build games (latest indie hit being Balatro).
As someone who started with Python, Lua's simpliciy, performance and inter-operability with C makes the development experience smooth and satisfying. I prefer it much over C# due to C# being more heavy in features, features I don't always want, need or understand and my experience with Java in the past was bad (the worst being the boilerplate and how every piece of data has it's own class, meaning you need to go through many conversions and getters to get a simple boolean). I get it, C# is "more beautiful" than Java.
But lately C# seems to grow more and more and Lua seems to be forgotten, like, no more recommended or talked as much about. I know big part of it is because of Unity, but what else makes working in C# enjoyable? It can't be all about it being in Unity that even Godot adopted and Defold is attempting to do so too.
So as I said, I posted in the other sub, just to get downvoted big time and be given answers that, while I respect in terms knowledge fidelity, were sort of agressive. "You cant with Lua", "No types = garbage", stuff like that.'So I don't really get it. You could say I am venting now, and that is correct. But i'm more confused than anything.
If I were to respond to the critics brought to Lua, I would say people who use C# don't even use C# at it's full potential as a PL (that being their main reasoning, Lua is a noscripting language while C# is a full-blown PL), they are using it for noscripting in Unity and that comes with a lot of magic abstractions like function decorators which I dislike a lot. So in that scenario, it's like almost not relevant at all if you have type safety or not as long as you're a little disciplined and you have documented your code. Also, GDScript and UE's blueprint system were succesful so far, I don't see why C# is not just a "better" option, but "the must".
https://redd.it/1jwwkwu
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
How do i learn faster
so, i’m a young teen and i wanted to know how to learn the advanced stuff of lua since i wanted to make a game since elementary school. I have my limits, first of all.. i have a boarding school and i only go home every other weekend and second, my boarding school barely lets us use the computers. So please, if you have any suggestions please tell me
https://redd.it/1jxf0jn
@r_lua
so, i’m a young teen and i wanted to know how to learn the advanced stuff of lua since i wanted to make a game since elementary school. I have my limits, first of all.. i have a boarding school and i only go home every other weekend and second, my boarding school barely lets us use the computers. So please, if you have any suggestions please tell me
https://redd.it/1jxf0jn
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Sites to learn Lua
Do you know any websites to learn Lua? I'm a Game Developer and I've already earned my certificate and I want to be a Lua Developer! Do you know any websites?
https://redd.it/1jxj07w
@r_lua
Do you know any websites to learn Lua? I'm a Game Developer and I've already earned my certificate and I want to be a Lua Developer! Do you know any websites?
https://redd.it/1jxj07w
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Lua IOS
Is there a way to write and run Lua code safely on IOS, but without Jailbreaking or other sketchy things?
https://redd.it/1jxnt4v
@r_lua
Is there a way to write and run Lua code safely on IOS, but without Jailbreaking or other sketchy things?
https://redd.it/1jxnt4v
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Is "Programming in Lua" worth buying?
For a Game Developer who is going to program his game in Lua, is it worth buying the book "Programming in Lua"?
https://redd.it/1jxradz
@r_lua
For a Game Developer who is going to program his game in Lua, is it worth buying the book "Programming in Lua"?
https://redd.it/1jxradz
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
What happened to lua-users.org
I'm sorry if this is an otherwise well-known fact, but I couldn't find any information about what happened with lua-users.org(unsurprising, considering google is good at anything but searching).
the website is semi-up, with the forum and wiki missing from it.
what happened to it?
https://redd.it/1jyd1yd
@r_lua
I'm sorry if this is an otherwise well-known fact, but I couldn't find any information about what happened with lua-users.org(unsurprising, considering google is good at anything but searching).
the website is semi-up, with the forum and wiki missing from it.
what happened to it?
https://redd.it/1jyd1yd
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
trying to start learning lua to make toblox mini games
idk hbow to start i know variables functions meaning loop and more but like idk how i start like what should i do after know the basics (variables etc ... ) can anyone help me with some suggetions and thank you !
https://redd.it/1jyjxyk
@r_lua
idk hbow to start i know variables functions meaning loop and more but like idk how i start like what should i do after know the basics (variables etc ... ) can anyone help me with some suggetions and thank you !
https://redd.it/1jyjxyk
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
ZeroBrane not recognizing "on.paint"
Hello! I just started goofing around with Lua so I can program for my Ti-Nspire CX. If I can keep from getting distracted long enough to actually learn Lua. I've started with using ZeroBrane Studio since that is what is recommended on the Lua site and it's specifically made for use with Lua. I am following tutorials on:
https://compasstech.com.au/TNS\_Authoring/Scripting/noscript\_tut1.html
I am of course starting out with "hello world", but I can't even get that to work. ZeroBrane doesn't seem to recognize the function "on.paint(gc)". It seems to think that the "on" is a variable. This is probably a simple solution but I'm not a programmer so I may be missing something. I have dabbled in programming over the years, but am definitely not a programmer. Thanks.
The output when I try to run the program is:
Program starting as '"/opt/zbstudio/bin/linux/x64/lua" -e "io.stdout:setvbuf('no')" "/home/brian/Downloads/TI-Nspire CX/My Programs/Compass Tech Course.lua"'.
Program 'lua' started in '/opt/zbstudio/myprograms' (pid: 1212772).
/opt/zbstudio/bin/linux/x64/lua: ...wnloads/TI-Nspire CX/My Programs/Compass Tech Course.lua:4: attempt to index global 'on' (a nil value)
stack traceback:
...wnloads/TI-Nspire CX/My Programs/Compass Tech Course.lua:4: in main chunk
\[C\]: at 0x00404f08
Program completed in 0.01 seconds (pid: 1212772).
function on.paint(gc)
gc:drawString("hello world", 0, 20)
end
https://redd.it/1jyksvz
@r_lua
Hello! I just started goofing around with Lua so I can program for my Ti-Nspire CX. If I can keep from getting distracted long enough to actually learn Lua. I've started with using ZeroBrane Studio since that is what is recommended on the Lua site and it's specifically made for use with Lua. I am following tutorials on:
https://compasstech.com.au/TNS\_Authoring/Scripting/noscript\_tut1.html
I am of course starting out with "hello world", but I can't even get that to work. ZeroBrane doesn't seem to recognize the function "on.paint(gc)". It seems to think that the "on" is a variable. This is probably a simple solution but I'm not a programmer so I may be missing something. I have dabbled in programming over the years, but am definitely not a programmer. Thanks.
The output when I try to run the program is:
Program starting as '"/opt/zbstudio/bin/linux/x64/lua" -e "io.stdout:setvbuf('no')" "/home/brian/Downloads/TI-Nspire CX/My Programs/Compass Tech Course.lua"'.
Program 'lua' started in '/opt/zbstudio/myprograms' (pid: 1212772).
/opt/zbstudio/bin/linux/x64/lua: ...wnloads/TI-Nspire CX/My Programs/Compass Tech Course.lua:4: attempt to index global 'on' (a nil value)
stack traceback:
...wnloads/TI-Nspire CX/My Programs/Compass Tech Course.lua:4: in main chunk
\[C\]: at 0x00404f08
Program completed in 0.01 seconds (pid: 1212772).
function on.paint(gc)
gc:drawString("hello world", 0, 20)
end
https://redd.it/1jyksvz
@r_lua
How realistic is it to write a dynamic website in Lua as a new programmer?
Basically noscript. I'm new to programming and learning C and Lua, but I'm not really sure where to start. I thought it would be fun to build a dynamic website in Lua since that would probably teach me some of the things I'd need to know for future projects, but I'd imagine that's probably over my head. Does anyone know if that's a realistic ask? If not, where should I start if I want to learn what's necessary to do something like this? Thanks!
https://redd.it/1jzoiif
@r_lua
Basically noscript. I'm new to programming and learning C and Lua, but I'm not really sure where to start. I thought it would be fun to build a dynamic website in Lua since that would probably teach me some of the things I'd need to know for future projects, but I'd imagine that's probably over my head. Does anyone know if that's a realistic ask? If not, where should I start if I want to learn what's necessary to do something like this? Thanks!
https://redd.it/1jzoiif
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
A little help with a code fixing task!
Hello everyone!
I'm fairly new to this, but I was assigned the below corrupted code as a test to fix it, and I can't figure it out. The code in question goes as follows:
function factorial(n)
if (n == 0) then
return 1
else
return n factorial(n - 1) -- The developer did not handle negative numbers. Prevent infinite recursion. You must check if n is lower than 0 then return something. You should be returning nil. Use elseif and then else
end
end
Now, what I was able to figure out is that I need to check if n is lower than 0, then return nil, which can be done by doing this:
function factorial(n)
if (n == 0) then
return 1
elseif (n < 0) then
return nil
else
return n factorial(n - 1)
end
end
But then I was told that this is incorrect, and I can't seem to figure out why. Would anyone be so kind as to point out the mistake and tell me if it's just the coding style, or maybe it is just blatantly incorrect?
https://redd.it/1k0u4fv
@r_lua
Hello everyone!
I'm fairly new to this, but I was assigned the below corrupted code as a test to fix it, and I can't figure it out. The code in question goes as follows:
function factorial(n)
if (n == 0) then
return 1
else
return n factorial(n - 1) -- The developer did not handle negative numbers. Prevent infinite recursion. You must check if n is lower than 0 then return something. You should be returning nil. Use elseif and then else
end
end
Now, what I was able to figure out is that I need to check if n is lower than 0, then return nil, which can be done by doing this:
function factorial(n)
if (n == 0) then
return 1
elseif (n < 0) then
return nil
else
return n factorial(n - 1)
end
end
But then I was told that this is incorrect, and I can't seem to figure out why. Would anyone be so kind as to point out the mistake and tell me if it's just the coding style, or maybe it is just blatantly incorrect?
https://redd.it/1k0u4fv
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Extended lua noscript for mpv
Hello,
I would like to make mpv play short clips as visualization, but:
- the first half of the track reversed with 0.8 speed
- then the original forward in normal speed and complete
- all videos are in subdurectories on a cloud-server
- endless play repetition
Actually, I have a code, which reverses everything and renames the originals into xxx_vorher and names the reversed into xxx_reverse. But it's always the full track in normal speed. What am I doing wrong?
Working noscript:
local utils = require 'mp.utils'
local base_folder = "C:\\Users\\ju-ra\\OneDrive - per ianua projekt eV\\mArple\\artwork\\ki"
function process_all_videos(folder)
local cmd = string.format('dir "%s" /b /s /a-d', folder)
local handle = io.popen(cmd)
local result = handle:read("*a")
handle:close()
for line in result:gmatch("[^\r\n]+") do
if line:match("%.mp4$") or line:match("%.mkv$") or line:match("%.avi$") then
if not line:match("_vorher%.") and not line:match("_reverse%.") then
local new_path = line:gsub("(%.%w+)$", "_vorher%1")
os.rename(line, new_path)
local reverse_path = line:gsub("(%.%w+)$", "_reverse%1")
local args = {
"ffmpeg", "-y",
"-i", new_path,
"-vf", "reverse",
"-af", "areverse",
reverse_path
}
mp.msg.info("Erstelle Reverse: " .. reverse_path)
utils.subprocess({ args = args, playback_only = false })
end
end
end
mp.msg.info("Alle Videos wurden umbenannt und Reverses erstellt.")
end
process_all_videos(base_folder)
mp.commandv("quit")
________________________
What I am trying to add:
local mp = require 'mp'
local started = false
local half_point = 0
local reversed = false
function reverse_and_play_forward()
if started then return end
started = true
local duration = mp.get_property_number("duration", 0)
half_point = duration / 2
-- Sprung zur Mitte und rückwärts abspielen
mp.set_property_number("speed", 1)
mp.set_property("playback-direction", "backward")
mp.commandv("seek", half_point, "absolute+exact")
reversed = true
-- Beobachte die Zeit
mp.observe_property("time-pos", "number", function(name, pos)
if reversed and pos and pos <= 0.1 then
-- Wenn Anfang erreicht, vorwärts abspielen
reversed = false
mp.set_property("playback-direction", "forward")
mp.set_property_number("speed", 1)
mp.commandv("seek", 0, "absolute+exact")
mp.unobserve_property(nil)
end
end)
end
mp.register_event("file-loaded", reverse_and_play_forward)
Thanks for every idea
https://redd.it/1k133wq
@r_lua
Hello,
I would like to make mpv play short clips as visualization, but:
- the first half of the track reversed with 0.8 speed
- then the original forward in normal speed and complete
- all videos are in subdurectories on a cloud-server
- endless play repetition
Actually, I have a code, which reverses everything and renames the originals into xxx_vorher and names the reversed into xxx_reverse. But it's always the full track in normal speed. What am I doing wrong?
Working noscript:
local utils = require 'mp.utils'
local base_folder = "C:\\Users\\ju-ra\\OneDrive - per ianua projekt eV\\mArple\\artwork\\ki"
function process_all_videos(folder)
local cmd = string.format('dir "%s" /b /s /a-d', folder)
local handle = io.popen(cmd)
local result = handle:read("*a")
handle:close()
for line in result:gmatch("[^\r\n]+") do
if line:match("%.mp4$") or line:match("%.mkv$") or line:match("%.avi$") then
if not line:match("_vorher%.") and not line:match("_reverse%.") then
local new_path = line:gsub("(%.%w+)$", "_vorher%1")
os.rename(line, new_path)
local reverse_path = line:gsub("(%.%w+)$", "_reverse%1")
local args = {
"ffmpeg", "-y",
"-i", new_path,
"-vf", "reverse",
"-af", "areverse",
reverse_path
}
mp.msg.info("Erstelle Reverse: " .. reverse_path)
utils.subprocess({ args = args, playback_only = false })
end
end
end
mp.msg.info("Alle Videos wurden umbenannt und Reverses erstellt.")
end
process_all_videos(base_folder)
mp.commandv("quit")
________________________
What I am trying to add:
local mp = require 'mp'
local started = false
local half_point = 0
local reversed = false
function reverse_and_play_forward()
if started then return end
started = true
local duration = mp.get_property_number("duration", 0)
half_point = duration / 2
-- Sprung zur Mitte und rückwärts abspielen
mp.set_property_number("speed", 1)
mp.set_property("playback-direction", "backward")
mp.commandv("seek", half_point, "absolute+exact")
reversed = true
-- Beobachte die Zeit
mp.observe_property("time-pos", "number", function(name, pos)
if reversed and pos and pos <= 0.1 then
-- Wenn Anfang erreicht, vorwärts abspielen
reversed = false
mp.set_property("playback-direction", "forward")
mp.set_property_number("speed", 1)
mp.commandv("seek", 0, "absolute+exact")
mp.unobserve_property(nil)
end
end)
end
mp.register_event("file-loaded", reverse_and_play_forward)
Thanks for every idea
https://redd.it/1k133wq
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Looking for assistance learning FiveM development
Hello, Firstly, Thank you for taking the time to read this.
My friend & I have been working on trying to learn FiveM development for about a month now as we slowly build up a server. We have been learning mainly through reddit posts, discussions and youtube videos on how to do majority of things and it's gotten us quite far.
We're hoping this post will reach someone who has knowledge in building FiveM servers or is knowledgeable in Lua and is willing to mentor us on some of the more intricate obstacles we are struggling with such as learning how to properly use exports and integrate noscripts to communicate with each other such as notifications, MDT etc.
If this seems like something that might interest you or if you are willing to help please contact me via Discord @ dino0831 We are both eager to learn and catch on quickly. Hope to hear from you soon :)
Thank you
https://redd.it/1k2ef8j
@r_lua
Hello, Firstly, Thank you for taking the time to read this.
My friend & I have been working on trying to learn FiveM development for about a month now as we slowly build up a server. We have been learning mainly through reddit posts, discussions and youtube videos on how to do majority of things and it's gotten us quite far.
We're hoping this post will reach someone who has knowledge in building FiveM servers or is knowledgeable in Lua and is willing to mentor us on some of the more intricate obstacles we are struggling with such as learning how to properly use exports and integrate noscripts to communicate with each other such as notifications, MDT etc.
If this seems like something that might interest you or if you are willing to help please contact me via Discord @ dino0831 We are both eager to learn and catch on quickly. Hope to hear from you soon :)
Thank you
https://redd.it/1k2ef8j
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Okay so im reaching out im not sure how to look up what im about to ask
Ive been getting bored with the games that i have been playing and i was told to look up the lua game on roblox but it tells you how to do it but it is confusing me just wondering if im the only one ? If you have any info much appreciated
https://redd.it/1k31xt8
@r_lua
Ive been getting bored with the games that i have been playing and i was told to look up the lua game on roblox but it tells you how to do it but it is confusing me just wondering if im the only one ? If you have any info much appreciated
https://redd.it/1k31xt8
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Lua learning
I have wanted to learn lua for a while but have not had the time, but now I do, so I am just curious whether how do I start? Because I took a look at couple videos and I have to be honest I did not understand or keep in mind any of that. If you guys would send me some useful resources or a starting point to learn lua I would appreciate it.
https://redd.it/1k38fsn
@r_lua
I have wanted to learn lua for a while but have not had the time, but now I do, so I am just curious whether how do I start? Because I took a look at couple videos and I have to be honest I did not understand or keep in mind any of that. If you guys would send me some useful resources or a starting point to learn lua I would appreciate it.
https://redd.it/1k38fsn
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Compiling lua
Hello I have a game where the files for lua were in .lu so I decompiled them and the decompiler doesn't have an option to compile them back into .lu so I was wondering if anyone knows of a compiler that concerts lua into .lu, btw the Lua is 5.1
https://redd.it/1k3dk0s
@r_lua
Hello I have a game where the files for lua were in .lu so I decompiled them and the decompiler doesn't have an option to compile them back into .lu so I was wondering if anyone knows of a compiler that concerts lua into .lu, btw the Lua is 5.1
https://redd.it/1k3dk0s
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Can I use custom C API functions from Lua bytecode?
I'm thinking of precompiling Lua noscripts I upload to an unmanned vehicle that has a custom C API noscript runner thing. Would this be possible/feasible?
https://redd.it/1k3x9au
@r_lua
I'm thinking of precompiling Lua noscripts I upload to an unmanned vehicle that has a custom C API noscript runner thing. Would this be possible/feasible?
https://redd.it/1k3x9au
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community