Some questions about love.thread
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Some questions about love.thread
In the game I'm making I want it to be that people can mod my game, but I want to restrict the use of some functions by the user, can I do that by using love.thread?
Code: Select all
fun = true
school = true
function isItFun()
if school then
fun = false
end
if not fun then
me:explode()
end
end
Re: Some questions about love.thread
I think a combination of [wiki]love.filesystem.load[/wiki] and [manual]setfenv[/manual] would be what you need.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Some questions about love.thread
love.thread could be used like that, yes. The mod's code would run on a thread, and is allowed to affect the game code only via a well-defined thread-communication API. It's not the first thing I'd try, but it could work. There are some security issues you might want to think about; you probably want some kind of sandboxing anyway and then I don't think the separate thread would matter as much.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Who is online
Users browsing this forum: Bing [Bot], Semrush [Bot] and 9 guests