Some questions about love.thread

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Posts: 46
Joined: Fri Mar 06, 2015 9:01 am

Some questions about love.thread

Post by louie999 » Tue Aug 25, 2015 3:14 pm

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
    if not fun then 

User avatar
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Some questions about love.thread

Post by Nixola » Tue Aug 25, 2015 5:32 pm

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 =
lp = love.physics
lt = love.thread
li = love.image
lg =

User avatar
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Some questions about love.thread

Post by T-Bone » Thu Aug 27, 2015 1:11 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 55 guests