Help with messages that display every turn

Hey!

I’m trying to (very softly) learn Adventuron. I’m trying to port one of my games, so to begin with something substantial.

Now: based on the examples and actually working games (specifically: SPOOKY ADVENTURE), this should work, but instead it doesn’t compile. I can’t tell what’s wrong…

######################################
# on_describe                        #
######################################

on_describe {
   : if (is_at "airlock") {
   
      : if (turns() == 0) {
         : print "A voice shrieks from hidden speakers, repeating your name over and over again.\n\"CHLOE,\" it says, \"FIRST YOU NEED TO CALM DOWN. DO YOU HEAR ME, CHLOE? DO YOU UNDERSTAND ME? YOU HAVE TO CALM DOWN.\"\nYou take a couple of breaths and start to feel the blood in your head subside." ;
      }
         
      : else_if (turns() == 1) {
         : print "\"THE SITUATION IS STABLE, CHLOE. NO FURTHER SHOCKS ARE EXPECTED. THE DOOR YOU'RE TRYING TO OPEN IS BOMBPROOF. IT LEADS OUTSIDE AND YOU CAN'T OPEN IT RIGHT NOW.\"" ;
      }
         
      : else_if (turns() == 2) {
         : print "\"WE ARE APPROXIMATELY TWO KILOMETERS BELOW THE SURFACE. IF THAT DOOR OPENS--WHICH IS CURRENTLY PREVENTED BY OUR SECURITY FAILSAFES--MILLIONS OF TONS OF SEAWATER WOULD RUSH INTO THE FACILITY AND DESTROY EVERYTHING. YOU YOURSELF WOULD BE CRUSHED BY THE PRESSURE IN MOMENTS.\"" ;
      }
         
      : else_if (turns() == 3) {
         : print "\"WHAT YOU HAVE TO DO NOW, CHLOE, IS GET TO THE WARD---\" The voice cuts off and, after a brief static, it's silence.\nYou're alone now." ;
      }
   }
}

From what I can discern, the problem is in those if-statements [(turn() == x) etc]. But they are exactly the same in the games that actually compile.

Any ideas?

Thanks in advance.

1 Like

I’ve just dropped the code into the demo adventure (changing the location check to outside_cave) and it works perfectly. So I’m guessing there’s another issue with your code than what you have posted here.

The hard part is identifying what.
If I turn the secondary if-statements into a simple PRINT, it works.

Which line is it identifying the problem on? Like I say, the code you posted works without any issues in the sample Cave of Magic game, so there’s no fundamental problems with it. Often it’ll just be something as simple as a missing bracket } somewhere.

Are you attempting to use 8-bit compatibility mode? It won’t work in that.

That’s it. :slight_smile:

Any reason why? I would very much like to port the game (eventually) with graphics and all to 8-bit systems.

In case I will think of another way to convey the same effect.

Chris has written some clever code that generates PAW/DAAD code from Adventuron. However, not every feature is compatible. See…

https://adventuron.io/betabeta/docs/8bit.html#8BitCompatibleFeatures

One of the issues you’re likely to have, if you want to target 8-bit computers is file size. The DAAD code Adventuron produces is quite bloated, by necessity as the two systems work very differently. You can produce much more economical code by writing the game in DAAD from scratch.

It’s been a long time since I did any Adventuron programming in 8-bit mode, but I would usually be doing this sort of thing using autoincrement on my own counter in the on_tick section, rather than the on_describe one.

1 Like

Thanks a lot. I understand.

One of the main reasons for using Adventuron was graphics, and now I’m fixated with GIFs, that I couldn’t achieve in Inform. I guess my game will only be web/modern PC.

And I can address DAAD, too. We will see.

Thanks for your time!