quit("restart") message passing

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
fendrin
Prole
Posts: 9
Joined: Thu Dec 28, 2017 6:59 am

quit("restart") message passing

Post by fendrin »

Hello,
is it possible to pass information to the next lua state when doing a restart with love.event.quit("restart") ?

My game comes with a launcher and passing information by file or the clipboard does not sound like a good solution.

Regards, Fabi
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: quit("restart") message passing

Post by grump »

I'm pretty sure you can't pass information directly to the new state.

Passing by file sounds like a workable solution to me.
fendrin
Prole
Posts: 9
Joined: Thu Dec 28, 2017 6:59 am

Re: quit("restart") message passing

Post by fendrin »

Thank you.
User avatar
AuahDark
Party member
Posts: 107
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: quit("restart") message passing

Post by AuahDark »

It's sort of possible in pre-11.3 by exploiting bug in named Channels but it's patched out. However, the development branch which is supposedly to be next major version of LOVE already have love.event.restart(somevalue) and there will be love.restart variable that contain the previously passed value.
Profile. Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and send the full logcat file!
fendrin
Prole
Posts: 9
Joined: Thu Dec 28, 2017 6:59 am

Re: quit("restart") message passing

Post by fendrin »

AuahDark wrote: Fri Aug 14, 2020 4:01 pm It's sort of possible in pre-11.3 by exploiting bug in named Channels but it's patched out. However, the development branch which is supposedly to be next major version of LOVE already have love.event.restart(somevalue) and there will be love.restart variable that contain the previously passed value.
Sounds exactly like what I need.
Thank you for keeping me up to date.

May I suggest to also allow altering the command line parameters (the parameter to the love.load and the global 'arg') which are passed to the restarted lua host?

Regards, Fabi
User avatar
AuahDark
Party member
Posts: 107
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: quit("restart") message passing

Post by AuahDark »

Note: It's not possible in 11.3 without using temporary file. The naming channel method I described is fixed in 11.3.

For command-line altering, no.
Profile. Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and send the full logcat file!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Semrush [Bot] and 3 guests