Resurrecting this old topic because it was never resolved or closed: is it possible to inspect the command line arguments that PlaydateSimulator was launched with from the playdate API?
My use case is the following: I have an external level editor that I use to create levels of my game and I’d like to implement a “quick test” functionality in it where I can hit a button and have the PlaydateSimulator launch my game already inside the level that I’m editing. I would do this by having a dev-only option like PlaydateSimulator mygame.pdx –level Level.level, but for this I would need access to the argc/argv variables from inside the game (something like char **playdate→system→getCmdlineArgs(int *argc)), but I’m not finding anything of this sort in the C API docs.
Hm, I might be missing something else though: I just tried it and the return value is null.
I'm launching the Simulator (on Linux) with args “foo bar” and when calling the function (upon receiving kEventInit) I always get a null pointer out of it (outpath is correctly filled with the PDX file name).
The docs don't specify when the function should be called so I assume it should always be valid to call…
I do see the args in the console but launchArgs returns null…I'll make more experiments when I have time but I'm pretty sure we have the same setup except I'm on Linux and I'm launching the simulator directly from the terminal (like “./PlaydateSimulator foo bar”)