Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

"back" is a reserved identifier in the current context

A topic by Garry Francis created Jun 13, 2020 Views: 87 Replies: 3
Viewing posts 1 to 3
Submitted

I created an object called 'back' only to be greeted by the error '"back" is a reserved identifier in the current context'. Why is it a reserved identifier? I can't find any reference to a 'back' identifier in the ctrl_space help or the online doco. I struck a similar problem with 'root' in a past jam.

Can we please have a list of all the reserved identifiers?

Host

They are all reserved for good reason, and I have chosen not to document the object hierarchy yet because I don't think that beginners need that (yet), and I wanted to give myself space to refine the model, which is granted by being as ambigious as possible.

Anyway, as of today, below is the runtime object hierarcy.

  • "back" is a reserved identifier because it's used in gamebook mode to go to the last location (or page) on the stack.
  • "root" is a reserved identifier because every object, location,  scenery, character, in the game is placed beneath a root node called root.
  • "story" is the root element of things that exist in the game (locations, player, objects, etc)

+ root
   + ether
      + item_that_does_not_exist_1
      + item_that_does_not_exist_2
   + story
      + location_1
         + player
            + iten_id_of_held_object_1
            + iten_id_of_held_object_2
         + lamp
         + table
            + item
      + location_2
         + tree_1
         + npc_1
            + container_1
                + iten_id_of_object_in_container_1
Submitted

Aha. That explains it. So 'back' is used as an identifier even if you're not using gamebook mode?

I seem to have a knack of finding these things unintentionally. Two jams ago, it was 'root', remember? As you have this silly system where the id determines the adjective and noun, I had to find a workaround for 'root'. The workaround was to append a number (e.g. 'root_01'), but this has its own issues (reported in the last jam) or to prepend a junk adjective (e.g. 'dummy_root').

Anyway, I now know what 'back' is.

Host

I think I describe the workarounds quite well in the document.

Just specifying an explicit noun is enough to override the "ID represents the adjective and noun" rule. Or adding a numeric suffix.

The id doesn't have to be tied to the noun, so reserved words don't stop you from making as many roots or backs as you like.

Yes, back is reserved even outside of gamebook mode for the sake of simplicity and because gamebook mode will overlap parser mode optionally in future revisions. I was just setting the flag down early.