Skip to main content

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

Here's another interesting one.  It's a type of issue I come across a lot.  The compiler tells me there's an error, but if I just rearrange things, or delete and re-edit, it works again.

HEre's the game telling me that "dark_zone" must refer to a zone.

I have a dark zone test which I took from the manual....


  is_dark : boolean_dynamic {(
  is_at "dark_zone" &&
   is_present "torch" == false
  )}


The compiler tells me that "dark_zone" must be a zone... which it is:

zones {
   dark_zone : zone {
      locations = [ road_12, road_13]

}}

Now, if I comment out the is_dark test, like this:

//  is_dark : boolean_dynamic

//{(

//  is_at "dark_zone" &&   

//is_present "torch" == false  

//)}

Then the error correctly moves to a light test which relies on it. It tells me there's no function "is_dark".  Which is correct. Now the strange thing happens.....


If I go back and UNCOMMENT the is_dark test, making no other changes other than to remove the // comment symbols, suddenly the parser is happy, and the game will compile.

This does happen very occasionally... I just have to cut a block of code to force the error away, and then pasting it back resolves the issue.

I worked around this problem by changing the order in which the blocks are defined. The error message will give you an indication of the dependencies. If I understand your example correctly, it looks like you can define the zones{} block before the booleans{} block and the error will go away.

FYI. The order of the regions makes no difference.

It used to, unless you've fixed it. There was a thread related to this in the CaveJam.

It's a bug to do with iterative parsing of code. Pressing CONTROL + S should force a full refresh of the parse and resolve these issues (until that bug (a tricky one) is fixed). You misdiagnosed that it was to do with the order or blocks.

Yeah, I know, but reordering the blocks fixes it so that you don't need to do the Ctrl+S thing all the time. At least until you fix it further down the track.