Open paulyoung opened 1 year ago
I suppose this may actually belong in the crank
repo, but I'll follow up here anyway.
I had to define an empty
main.lua
file and add the resultingmain.pdz
file to assets inCrank.toml
or I got an error aboutmain.pdz
being missing when running in the simulator, but otherwise everything worked great.(I’m now wondering if that’s even necessary if I build with
--device
and will try that later, see below)
I just tried this and it is necessary. --device
makes no difference.
As explained in this dev forum post; if I build with
crank build
and then upload via the simulator, something tries to callplaydate.update
in Lua. This obviously doesn’t exist, but if I define it inmain.lua
the function gets called.If I build with
crank build --device
and upload to device via the simulator, my Rustupdate
function gets called.
The opposite appears to be true as well. If I do crank build --device
and open the resulting .pdx
in the simulator, I get a no such function 'update'
error because something is trying to run a Lua playdate.update
function. If I go to Device > Upload Game to Device
the Rust update
function runs on the device and things work as expected.
I’m not sure if this is a bug but it might be worth documenting if not.
I made a PR with some changes that allow interacting with the Lua runtime. I had to define an empty
main.lua
file and add the resultingmain.pdz
file toassets
inCrank.toml
or I got an error aboutmain.pdz
being missing when running in the simulator, but otherwise everything worked great.(I’m now wondering if that’s even necessary if I build with
--device
and will try that later, see below)As explained in this dev forum post; if I build with
crank build
and then upload via the simulator, something tries to callplaydate.update
in Lua. This obviously doesn’t exist, but if I define it inmain.lua
the function gets called.If I build with
crank build --device
and upload to device via the simulator, my Rustupdate
function gets called.For what it’s worth, I’m uploading to device via the simulator because
crank run --device
hangs (https://github.com/pd-rs/crankstart/issues/41#issuecomment-1763471714)