Page 1 of 1
quit("restart") message passing
Posted: Fri Aug 14, 2020 9:33 am
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
Re: quit("restart") message passing
Posted: Fri Aug 14, 2020 10:31 am
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.
Re: quit("restart") message passing
Posted: Fri Aug 14, 2020 10:39 am
by fendrin
Thank you.
Re: quit("restart") message passing
Posted: Fri Aug 14, 2020 4:01 pm
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.
Re: quit("restart") message passing
Posted: Sun Aug 16, 2020 7:35 am
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
Re: quit("restart") message passing
Posted: Sat Aug 29, 2020 10:48 am
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.