You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 resulting main.pdz file to assets in Crank.toml or I got an error about main.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 call playdate.update in Lua. This obviously doesn’t exist, but if I define it in main.lua the function gets called.
If I build with crank build --device and upload to device via the simulator, my Rust update function gets called.
For what it’s worth, I’m uploading to device via the simulator because crank run --device hangs (#41 (comment))
The text was updated successfully, but these errors were encountered:
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 resulting main.pdz file to assets in Crank.toml or I got an error about main.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 call playdate.update in Lua. This obviously doesn’t exist, but if I define it in main.lua the function gets called.
If I build with crank build --device and upload to device via the simulator, my Rust update 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 (#41 (comment))The text was updated successfully, but these errors were encountered: