Crashing/Unable to launch Pulp game in simulator

I am unable to launch my exported .pdx Pulp game in the SDK simulator or on my Playdate console. Upon loading the game, I get this error in the console:

loaded pdz in 3ms
caching bitmaps...
	using frames.pdt
	using pipe.pdt
	using chars.pdt
?:-1: table index is nil
stack traceback:
	?: in function <?:1581>
	(...tail calls...)
	?: in function <?:1352>
	(...tail calls...)
	?: in upvalue '?'
	?: in upvalue '?'
	?: in function <?:2853>
	?: in upvalue '?'
	?: in upvalue '?'
	?: in function <?:3714>

Has anyone else encountered this?

I haven't encounter this. Does it play in the web player? And if so, have you checked the console to see if it's logging any errors?

Thanks for the reply. It does work in the web player, but I didn't think to check the javascript console in Chrome. I do see this error:

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See Chrome Platform Status

Which seems to be linked to this:

bind(window, 'wheel', function(event) {
		event.preventDefault(); **X**
		var clamp = 30;
		var delta = Math.max(-clamp, Math.min(clamp, event.deltaY));
		simulatedCrankAngle += (delta / 60) * (180 / Math.PI);
	});

I added the **X** next to the code the "intervention" seems to be linked to. What's weird is that my game doesn't use the crank at all, I've ignored it to this point.

That’s weird. No issues with other Pulp projects?

I wonder if something that you deleted in PulpScript related to crank behavior is actually still there in the json.

Nope, it doesn't seem to work with other Pulp projects. I don't remember adding anything crank related to pulpscript in this project either.

The only thing I can think of, and it's a stretch, is that I remember at one point my browser tab crashed and I lost progress. After that happened, plus the direction I was taking my game changed a little, I had exported my game and attempted to import the project at one point. I honestly can't remember if this specific project was the one I'd imported. Maybe the export/import process added unexpected code?

Are you using any browser extensions, like Pulp+? The fact that you have the same problem after you export other Pulp projects is odd. The only other thing I can think of is if your SDK/Simulator or your PD device are not using the latest version, but I'm sure you've already updated as there's notifications for that.

My apologies, I misspoke. I meant to say it doesn’t happen with other projects, not that it doesn’t work. This issue seems to be exclusive to this specific project.

Ah okay. In that case, I might be inclined to say what if you export your JSON then import it to a new Pulp project. Now try to play the one in the Simulator or device.

If that still doesn't work, then export only the tiles and copy/paste the individual scripts (in case there's something exporting in the project JSON messing it up) into a new Pulp project.

Obviously this doesn't resolve the underlying issue, but this is what I would try if I had this block.

This was great advice, thank you. I fixed the issue. While I was copying everything (very, very painstakingly so I can test every little thing, recreating every room and doing all the names of the tiles and placement before doing the script), I came across a single sprite that was using the "on load" event instead of "on enter" to set the frame of the sprite. I don't know why that was causing the crash, but that was the culprit.

Thank you again for helping me troubleshoot this!

1 Like

Glad to hear the case is closed! :partying_face: