Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+2)

One deck of mine consistently crashes when navigating from card to card using the arrow keys, and today I realized it's a syntax error that isn't being caught by the 'Your script contains errors' validator. The script with missing brackets is 'valid' and will initialize the brushes, but will crash the deck after a certain amount of navigate[] events when ran at a deck level. The second one, with added brackets to surround the brush function, seems to have fixed the issue I've been having, but I was surprised that both were able to pass the check.

roundtips:"%J" parse "[
%%IMG0AAcABzh8/v7+fDg=,
%%IMG0AAMAA0DgQA==
]"

brush[on roundB1 delta newLine pos do
roundtips[0].copy[].map[(1) dict plight[deck.card.image[pos]]]
end

brush[on roundB2 delta newLine pos do
roundtips[1].copy[].map[(1) dict plight[deck.card.image[pos]]]
end
roundtips:"%J" parse "[
%%IMG0AAcABzh8/v7+fDg=,
%%IMG0AAMAA0DgQA==
]"

brush[on roundB1 delta newLine pos do
roundtips[0].copy[].map[(1) dict plight[deck.card.image[pos]]]
end]

brush[on roundB2 delta newLine pos do
roundtips[1].copy[].map[(1) dict plight[deck.card.image[pos]]]
end]

Was it my fork of lil.js? I just fixed a bug that I noticed I had a divergence with IJ’s base and it might be related. If not, never mind me.

(+1)

Unrelated - no worries! I should've probably noted I've only seen this happen in Native Decker.

(+2)

Lil's parser will currently tolerate source code ending without the full number of closing braces and/or parentheses; they're just implied.  This design is a potential foot-gun, but mildly handy when using the Listener like a calculator:


I was able to reproduce the crash you describe, but it's not specific to those script typos; it's a deeper race condition in Native Decker that just happens to become easier to reproduce when you have the toolbars open and custom brushes installed. Will fix.