how 2 make image bigger in love?
Need help with drawing an image and making it visible, despite me drawing the image already.
function love.load()
player = {}
player.x = 400
player.y = 400
speed = 2
score = 0
r = 0.1
earth = love.graphics.newImage('sprites/earth.png')
end
function love.update(dt)
if love.keyboard.isDown("d") then
player.x = player.x + speed
end
if love.keyboard.isDown("a") then
player.x = player.x - speed
end
if love.keyboard.isDown("s") then
player.y = player.y + speed
end
if love.keyboard.isDown("w") then
player.y = player.y - speed
end
r = r + 0.03
end
function love.draw()
love.graphics.circle("fill", player.x, player.y, 15)
love.graphics.draw(earth, 300, 400)
end
https://redd.it/1fm5jhg
@r_lua
Need help with drawing an image and making it visible, despite me drawing the image already.
function love.load()
player = {}
player.x = 400
player.y = 400
speed = 2
score = 0
r = 0.1
earth = love.graphics.newImage('sprites/earth.png')
end
function love.update(dt)
if love.keyboard.isDown("d") then
player.x = player.x + speed
end
if love.keyboard.isDown("a") then
player.x = player.x - speed
end
if love.keyboard.isDown("s") then
player.y = player.y + speed
end
if love.keyboard.isDown("w") then
player.y = player.y - speed
end
r = r + 0.03
end
function love.draw()
love.graphics.circle("fill", player.x, player.y, 15)
love.graphics.draw(earth, 300, 400)
end
https://redd.it/1fm5jhg
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Toogle while function
Hi, I'm trying to make a noscript on Lg HUb to toogle on/off an infinite sequence. The problem is that in the moment it enters the loop it wont receive any more events and cannot stop de noscript until I end the windows task, so it keeps printing "Do something" infinitely. Any suggestions?
local isActive = false
function OnEvent(event, arg)
if event == "MOUSEBUTTONRELEASED" and arg == 4 then
isActive = not isActive
if isActive then
OutputLogMessage("Script activated\n")
else
OutputLogMessage("Script deactivated\n")
end
end
while isActive do
OutputLogMessage("Do something\n")
end
end
https://redd.it/1fmfwcm
@r_lua
Hi, I'm trying to make a noscript on Lg HUb to toogle on/off an infinite sequence. The problem is that in the moment it enters the loop it wont receive any more events and cannot stop de noscript until I end the windows task, so it keeps printing "Do something" infinitely. Any suggestions?
local isActive = false
function OnEvent(event, arg)
if event == "MOUSEBUTTONRELEASED" and arg == 4 then
isActive = not isActive
if isActive then
OutputLogMessage("Script activated\n")
else
OutputLogMessage("Script deactivated\n")
end
end
while isActive do
OutputLogMessage("Do something\n")
end
end
https://redd.it/1fmfwcm
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
What even is noscripting
I gave up on luas complete basics long time ago but i never understood the concept of noscripting in general how does it work and in what way people make it work (would love some extremely basic noscript that kind of showcases that)
https://redd.it/1fmz6b5
@r_lua
I gave up on luas complete basics long time ago but i never understood the concept of noscripting in general how does it work and in what way people make it work (would love some extremely basic noscript that kind of showcases that)
https://redd.it/1fmz6b5
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Garry's Mod Attempt to index boolean value
I'm writing code for a weapon in Garry's Mod, trying to check if a trace didn't hit anything to exit a function early, but for some reason attempting to invert the value of TraceResult's Hit field causes this error. If I do not try to invert it, no error occurs. Failed attempts to invert the value include
Rest of function:
function SWEP:PrimaryAttack()
local owner = self:GetOwner()
print( owner )
local tr = owner:GetEyeTrace()
PrintTable( tr )
if ( not tr.Hit ) then return end
-- More code that never gets run due to erroring conditon
end
https://redd.it/1fn1g7a
@r_lua
I'm writing code for a weapon in Garry's Mod, trying to check if a trace didn't hit anything to exit a function early, but for some reason attempting to invert the value of TraceResult's Hit field causes this error. If I do not try to invert it, no error occurs. Failed attempts to invert the value include
!tr.Hit, not tr.Hit, tr.Hit == false, tr.Hit ~= true, and finally, true ~= tr.Hit. I can't think of any other options to try. How is this code trying to index Hit?Rest of function:
function SWEP:PrimaryAttack()
local owner = self:GetOwner()
print( owner )
local tr = owner:GetEyeTrace()
PrintTable( tr )
if ( not tr.Hit ) then return end
-- More code that never gets run due to erroring conditon
end
https://redd.it/1fn1g7a
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
logitech G-Hub G-Keys remapping?
Can you somehow simulate the press of a G-key? I would need a letter key to be a G-key to make my noscript work. Is this possible I tried remapping via powertoys but it was not registered as a g-key press.
https://redd.it/1fn9g30
@r_lua
Can you somehow simulate the press of a G-key? I would need a letter key to be a G-key to make my noscript work. Is this possible I tried remapping via powertoys but it was not registered as a g-key press.
https://redd.it/1fn9g30
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
How the hell do I install luarocks!?
I want to install luarocks for an existing lua installation I have which is on a different hard drive from my main one.
I have 2 main folders, one called `Lua`, which holds the lua installation (5.4.2 btw) and one called `Luarocks`, which holds the luarocks.exe. In the `luarocks` folder, I have a subfolder, called `rocks` where i want the rocks/plugins/libraries/whatever to go. I don't care about local or global rocks as I'm the only one using this computer.
So far, powershell (im on windows btw) recognizes luarocks. I have 3 main problems though.
1 Plugins are in `AppData\\Roaming` (I want the rocks to go in the `rocks` folder as mentioned earlier)
2 It keeps asking me to set the lua interperter directory whenever typing in `luarocks list` even though i keep doing what it says:Error: Lua 5.4.2 interpreter not found at S:\\Coding\\LanguageInstalls\\Lua\\Lua5.4.2 Please set your Lua interpreter with: luarocks --local config variables.LUA <d:\\path\\lua.exe>
What I put in and still get error afterwards:
luarocks config variables.LUA S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lua.exe
3 Whenever I try to simply require a module, (im requiring lunajson btw) I get this error:
S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lua.exe: test.lua:4: module 'lunajson' not found:
no field package.preload'lunajson'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lua\lunajson.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lua\lunajson\init.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lunajson.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lunajson\init.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\..\share\lua\5.4\lunajson.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\..\share\lua\5.4\lunajson\init.lua'
no file '.\lunajson.lua'
no file '.\lunajson\init.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lunajson.dll'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\..\lib\lua\5.4\lunajson.dll'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\loadall.dll'
no file '.\lunajson.dll'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lunajson54.dll'
no file '.\lunajson54.dll'
stack traceback:
C: in function 'require'
test.lua:4: in main chunk
C: in ?
With this noscript:
local lunajson = require("lunajson")
https://redd.it/1fnvhhw
@r_lua
I want to install luarocks for an existing lua installation I have which is on a different hard drive from my main one.
I have 2 main folders, one called `Lua`, which holds the lua installation (5.4.2 btw) and one called `Luarocks`, which holds the luarocks.exe. In the `luarocks` folder, I have a subfolder, called `rocks` where i want the rocks/plugins/libraries/whatever to go. I don't care about local or global rocks as I'm the only one using this computer.
So far, powershell (im on windows btw) recognizes luarocks. I have 3 main problems though.
1 Plugins are in `AppData\\Roaming` (I want the rocks to go in the `rocks` folder as mentioned earlier)
2 It keeps asking me to set the lua interperter directory whenever typing in `luarocks list` even though i keep doing what it says:Error: Lua 5.4.2 interpreter not found at S:\\Coding\\LanguageInstalls\\Lua\\Lua5.4.2 Please set your Lua interpreter with: luarocks --local config variables.LUA <d:\\path\\lua.exe>
What I put in and still get error afterwards:
luarocks config variables.LUA S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lua.exe
3 Whenever I try to simply require a module, (im requiring lunajson btw) I get this error:
S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lua.exe: test.lua:4: module 'lunajson' not found:
no field package.preload'lunajson'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lua\lunajson.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lua\lunajson\init.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lunajson.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lunajson\init.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\..\share\lua\5.4\lunajson.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\..\share\lua\5.4\lunajson\init.lua'
no file '.\lunajson.lua'
no file '.\lunajson\init.lua'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lunajson.dll'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\..\lib\lua\5.4\lunajson.dll'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\loadall.dll'
no file '.\lunajson.dll'
no file 'S:\Coding\LanguageInstalls\Lua\Lua5.4.2\lunajson54.dll'
no file '.\lunajson54.dll'
stack traceback:
C: in function 'require'
test.lua:4: in main chunk
C: in ?
With this noscript:
local lunajson = require("lunajson")
https://redd.it/1fnvhhw
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Hi,I have a problem when trying to download the saitek panel plugin for the zibo.
https://redd.it/1fo0s5h
@r_lua
https://redd.it/1fo0s5h
@r_lua
Tables and json
Hello, so basically what i am trying to achieve is to save the contents of a table to a .json file and make the table update and save from that file. For example, let’s say i have a table called Redtest how would i go about saving the contents of this table to a .json file and also use the contents within that file to update the current table. So if there are interruptions like crashes or something, i would have the data stored separately ready to use again and not lose all the data. Is there an efficient way of doing this? Any help would greatly be appreciated. Also if it helps i am using CfxLua.
https://redd.it/1fo3el3
@r_lua
Hello, so basically what i am trying to achieve is to save the contents of a table to a .json file and make the table update and save from that file. For example, let’s say i have a table called Redtest how would i go about saving the contents of this table to a .json file and also use the contents within that file to update the current table. So if there are interruptions like crashes or something, i would have the data stored separately ready to use again and not lose all the data. Is there an efficient way of doing this? Any help would greatly be appreciated. Also if it helps i am using CfxLua.
https://redd.it/1fo3el3
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
"Go to Symbols in Workspace" is too slow in VSCode with Lau extension by sumneko
I am working on project where there are are roughly 5000+ lua files.
I am using VSCode (moving from Sublime) with extension Lua by sumneko. While all the other things are working well, what I see a huge drawback is the symbol search in workspace.
When I start typing a function name, it take like good 10-15s for it to show results. And any incremental char in the search field also takes some 10-15s. In Sublime it used to be fast even without any extension (VS code doesn't do it work without extension).
Has anybody faced this? Are there settings which can cache the result and show it faster?
Or any other extension which can do this better way?
https://redd.it/1fp1lu6
@r_lua
I am working on project where there are are roughly 5000+ lua files.
I am using VSCode (moving from Sublime) with extension Lua by sumneko. While all the other things are working well, what I see a huge drawback is the symbol search in workspace.
When I start typing a function name, it take like good 10-15s for it to show results. And any incremental char in the search field also takes some 10-15s. In Sublime it used to be fast even without any extension (VS code doesn't do it work without extension).
Has anybody faced this? Are there settings which can cache the result and show it faster?
Or any other extension which can do this better way?
https://redd.it/1fp1lu6
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
How to declare dependencies in lua packages
I am new to lua.
I am writing a lua module where I would like to implement some interfaces that are exposed by another third-party module that I have no control over.
How can I declare a dependency on that third-party module so that I can implement the exposed interface?
I did some digging and found that "luarocks" can help manage dependencies. But, I am uncertain if that's the preferred way?
At the end of the day, people using the third-party library can load my implementation of the third-party interface in their application. So, I believe, at runtime it'll be fine as people can define dependencies on both modules. But, for my local development, I don't know how to go about it.
I don't know if I'm sounding stupid.
Thanks for your help!
https://redd.it/1fplr7s
@r_lua
I am new to lua.
I am writing a lua module where I would like to implement some interfaces that are exposed by another third-party module that I have no control over.
How can I declare a dependency on that third-party module so that I can implement the exposed interface?
I did some digging and found that "luarocks" can help manage dependencies. But, I am uncertain if that's the preferred way?
At the end of the day, people using the third-party library can load my implementation of the third-party interface in their application. So, I believe, at runtime it'll be fine as people can define dependencies on both modules. But, for my local development, I don't know how to go about it.
I don't know if I'm sounding stupid.
Thanks for your help!
https://redd.it/1fplr7s
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
is there a way to implement scanner on lua?
I was just wondering if you could put a scanner like java.
https://redd.it/1fq32tc
@r_lua
I was just wondering if you could put a scanner like java.
https://redd.it/1fq32tc
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Modding games
Okay so i know the games have an API that supports Lua, my book says to embed into the program i have to "Initialize The Lua State: #include<lua.h> ... " and gives code. my problem is the game is an executable how do i put that in the game. i feel like i am going about this wrong. Like Hades 2 everything is exposed cool. Starbound its JSON files and i managed. or do i just create a mod folder by it and drop files in that.
if anyone has any good sources for me to read or watch let me know, i want to learn to do this and i cant afford college.
https://redd.it/1fq9gjn
@r_lua
Okay so i know the games have an API that supports Lua, my book says to embed into the program i have to "Initialize The Lua State: #include<lua.h> ... " and gives code. my problem is the game is an executable how do i put that in the game. i feel like i am going about this wrong. Like Hades 2 everything is exposed cool. Starbound its JSON files and i managed. or do i just create a mod folder by it and drop files in that.
if anyone has any good sources for me to read or watch let me know, i want to learn to do this and i cant afford college.
https://redd.it/1fq9gjn
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Need resources
Can i get recommendations for books or websites or youtube guides that help with self learning. I've picked up alot of python, but im not sure how to use the concepts i've learned. So im trying learn lua to dive into modding. Need a few sources.
https://redd.it/1fr1sq2
@r_lua
Can i get recommendations for books or websites or youtube guides that help with self learning. I've picked up alot of python, but im not sure how to use the concepts i've learned. So im trying learn lua to dive into modding. Need a few sources.
https://redd.it/1fr1sq2
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Is luarocks compatible with luau?
I have downloaded and ran luau on my computer, but when i tried to use it with luarocks (normal lua works fine) the require function gave an error:
test.lua:1: error requiring module
stacktrace:
C function require
test.lua:1
any ideas?
https://redd.it/1fri1bf
@r_lua
I have downloaded and ran luau on my computer, but when i tried to use it with luarocks (normal lua works fine) the require function gave an error:
test.lua:1: error requiring module
stacktrace:
C function require
test.lua:1
any ideas?
https://redd.it/1fri1bf
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Recommend a Good Lua Codebase to Study
Is there a good open source lua codebase you'd recommend looking at for a beginner trying to grok the ways of lua? I can muddle through with a lot of googling and searching in the lua docs, but I think I might benefit from just looking at good lua code.
https://redd.it/1fs6aew
@r_lua
Is there a good open source lua codebase you'd recommend looking at for a beginner trying to grok the ways of lua? I can muddle through with a lot of googling and searching in the lua docs, but I think I might benefit from just looking at good lua code.
https://redd.it/1fs6aew
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Ikibooru - a booru of generic files written almost entirely in Lua
https://mid.net.ua/ikibooru.html
https://redd.it/1fsanmh
@r_lua
https://mid.net.ua/ikibooru.html
https://redd.it/1fsanmh
@r_lua
GitHub - dankfmemes/LuaCraft: Execute Lua noscripts on your Minecraft server. This is very experimental.
https://github.com/dankfmemes/LuaCraft
https://redd.it/1fsit3e
@r_lua
https://github.com/dankfmemes/LuaCraft
https://redd.it/1fsit3e
@r_lua
GitHub
GitHub - dankfmemes/LuaCraft: Execute Lua noscripts on your Minecraft server. This is very experimental.
Execute Lua noscripts on your Minecraft server. This is very experimental. - dankfmemes/LuaCraft
So I tried Roblox Studio...
It eats 2GB RAM.
Has a Qtitan library around Qt5. LibFbxSDK probably the one from AutoDesk. WebView2 from Microsoft.
And yes, Luau is an interesting extension to Lua...
https://redd.it/1fsq7z6
@r_lua
It eats 2GB RAM.
Has a Qtitan library around Qt5. LibFbxSDK probably the one from AutoDesk. WebView2 from Microsoft.
And yes, Luau is an interesting extension to Lua...
https://redd.it/1fsq7z6
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community