Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Command not working in 8-bit

A topic by Dee Cooke created Jun 22, 2020 Views: 101 Replies: 5
Viewing posts 1 to 2
Submitted

Any idea why these commands aren't working on Spectrum?  They work fine in Adventuron.

start_at                 = my_location
locations {
   my_location : location "Testing one, two, three!" ;
   
} on_describe {
   
   : if (is_at "my_location" && is_in_section_one) {
      : print "Type 'one', 'two' or 'three'." ;
   }
   : if (is_at "my_location" && is_in_section_two) {
      : print "Success! We're past the choice bit." ;
   }
} on_command {    : match "one_"  {
      : if (is_in_section_one) {
         : set_integer var = "choice_result"  value = "1" ;
         : set_false "is_in_section_one" ;
         : set_true "is_in_section_two" ;
         : redescribe;
      }
   }
   
   : match "two_"  {
      : if (is_in_section_one) {
         : set_integer var = "choice_result"  value = "2" ;
         : set_false "is_in_section_one" ;
         : set_true "is_in_section_two" ;
         : redescribe;
      }
   }
   
   : match "three_"  {
      : if (is_in_section_one) {
         : set_integer var = "choice_result"  value = "3" ;
         : set_false "is_in_section_one" ;
         : set_true "is_in_section_two" ;
         : redescribe;
      }
   }
} booleans {
   
   is_in_section_one : boolean default = "true" ;
   is_in_section_two : boolean default = "false" ;
} integers {
   
   choice_result : integer "0" ;
   
}
On Spectrum, the commands aren't recognised:

Grateful for any ideas about what could be going wrong!

Submitted (1 edit) (+1)

Try this: "one _" instead "one_" etc.
You didn't put a space between the two words.

Submitted

That worked, thanks!  Never needed a space in Adventuron-only games so I'm not in the habit of putting one in, but that's an easy fix.

Submitted

You actually do need a space in Adventuron games. It's in all the doco and all the sample games. The space is a separator between the verb and the noun. The noun may be any of the wild cards (*, -, _). If it worked without a space, then that's a miracle. If there's no space, I would have thought that the underscore would have been treated as the last character of the verb. Perhaps that's a bug in the Adventuron editor that the compiler quietly accounts for.

Host (1 edit)

Yes, I read this as a bug. But I reserve the right to call this a feature.

Submitted

*shrug* It's just always worked.  I don't know where I picked up the habit, but I'm sure I saw it used that way in sample code somewhere when I was first learning how to use Adventuron.