Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

How do I print game_information?

A topic by Garry Francis created Sep 19, 2019 Views: 81 Replies: 3
Viewing posts 1 to 3
Submitted

How do I print the string constants in the game_information{} block? Specifically game_name, game_version and copyright_message.

I have tried:

:print "{game_name}"; //This prints a blank

:print {(game_name)} //This causes an error because it is not globally scoped

Host

The information in the game information section are not mapped to a variable therefore both methods you described fail. The first pattern you use is the inline text merging (meant for beginners) and fails silently.

The second method is the inline scripting form, meant for advanced users, and the message you see is it complaining that it can't find a variable in the global scope (integer, string or Boolean).

I'll expose this information via a special variable type in a later release For now, just ignore DRY, and repeat yourself.

Submitted

Okay. (Not sure what DRY is.) I put it in a subroutine because it's used in two places - your very first move (somewhat like Scott Adams/Brian Howarth games) and when you type VERSION (somewhat like Infocom/Inform games). I've just got to remember to update the version number twice - once in the game_information{} block and once in the subroutine.

Incidentally, where is the game_information{} block ever used?

Host

The game information block is used by the saved game handler (it uses short name, game version, and uuid). It's also meant to be used by indexers eventually. It also is used for the *credits command, and some of the text (such as the author license information) is placed at the top of the compiled HTML file.

DRY = Do not Repeat Yourself.