Skip to content

Releases: johanberntsson/PunyInform

v5.5.1

13 Jul 10:08
Compare
Choose a tag to compare

Important to note when upgrading:

  • Nothing

Optimizations:

  • Saved 96-144 bytes in z3 by printing verbs smarter in VerbName.
  • Saved 130 bytes in parser.h
  • Made scope calculation slightly faster

Bugfixes:

  • The following verbs were truncated (all in z3, some also in z5+) when using the VerbName print rule: consult, discard, disrobe, noscript, objects, purchase, squeeze, superbrief, swallow, transcript, transfer, uncover, unscript, verbose, version.

v5.5

08 Jun 10:31
Compare
Choose a tag to compare

Important to note when upgrading:

  • Nothing

Changes in functionality:

  • The z5+ statusline routine (DrawStatusline) has been changed to print a full line of reverse spaces before printing the actual text on the statusline. This means that the statusline text flashes briefly every move (only visible on slow platforms), and it means the statusline is slightly slower (~0.10 s vs 0.09 s, on a C64). This change has been made to increase compatibility with older interpreters, as some of them don't support the get_cursor opcode, which is required for the old statusline routine. The most important interpreters that don't support it are MaxZip on classic MacOS and Infocom's Amiga-interpreter.
  • There is a new constant OPTIONAL_NON_FLASHING_STATUSLINE. Define it in z5+ games if you want to use the old, non-flashing statusline routine.

Optimizations:

  • The code for automatic setting of the reactive attribute is now shorter and 20% faster (total time for a full-size z3 game is typically 1.5 s)
  • Finding floating objects at game start is faster and shorter
  • Optimized the z3 versions of _CopyInputArray and _CopyParseArray routines in parser.

Bugfixes:

  • The Flags extension would define the symbol TM_NOT_PUNY if the extension was used without the PunyInform library. This was the wrong name, and wasn't used for anything, so it's been removed.

v5.4

10 Apr 08:32
Compare
Choose a tag to compare

Important to note when upgrading:

  • Nothing

Changes in functionality:

  • Made talk_menu adapt better to narrow screens for z5 by providing alternate, shorter, customizable messages to end conversation and to show next page of topics.

Optimizations:

  • Made talk menu not include message to show next page of topics when built for z3.

Bugfixes:

  • Added DisallowTakeAnimate support for GET ALL.
  • Ruby program to run test suite adapts better to environment

v5.3.1

05 Jan 14:01
Compare
Choose a tag to compare

Important to note when upgrading:

  • Nothing

Optimizations:

  • Don't force a scope update when calling a property routine if the property value is 0 or NULL. This should save a lot of scope updates for games without OPTIONAL_MANUAL_SCOPE where there's often no user code to run in a turn.

Bugfixes:

  • Fixed: add_to_scope didn't work properly.

v5.3

19 Dec 15:11
Compare
Choose a tag to compare

Important to note when upgrading:

  • Nothing

Changes in functionality:

  • InScope is now always consulted when deciding whether to recalculate scope or reuse the cached scope copy.
  • The variable scope_reason is now supported, and can be checked in InScope (but not in add_to_scope!). TALKING_REASON is not supported - PARSING_REASON is used instead.

Bugfixes:

  • Disambiguation of a complex noun phrase where a parse_name didn't consume all words failed without a response.
  • Improved grammar for 'remove' when removing clothing.
  • action and action_to_be are now set to NULL when game starts, instead of 0, which means action ##Take.
  • action_to_be is updated when the player types a direction.

v5.2

25 Nov 22:33
Compare
Choose a tag to compare

Important to note when upgrading:

  • If you've been setting cs_parse_name_id to assign an ID for a cheap scenery object, stop doing this, Instead, give it an ID using the new mechanism for assigning an ID to any cheap scenery object, e.g. cheap_scenery 100 CS_PARSE_NAME [; if(NextWord() == 'air') rtrue; rfalse; ] "Airy!", to give it the ID 100. The valid range is 100-500.

Changes in functionality:

  • Added option to assign an ID to a cheap scenery object.
  • New global in cheap scenery: cs_match_id. Can be used to check ID of matched cheap scenery object in location before-routines etc.
  • New procedure in cheap scenery: CSPerformAction(action, ID, second) - Works like <action noun second>; but for a cheap scenery object. Give second as -(object) to flip the order, so the cheap scenery object gets to be second.
  • Global cs_parse_name_id in cheap scenery extension has been removed. Instead of assigning this in parse_name routines, give the object an ID in the cheap scenery list.
  • ext_menu ends with <<Look>>; but this can now be skipped by defining the constant M_NO_LOOK.
  • Enter action has a new message: MSG_ENTER_HELD, which is used when trying to enter something which is (possibly indirectly) held by the player.

Optimizations:

  • Saved 34 bytes in cheap scenery extension.

Bugfixes:

  • Fixed parser bug: If all matched objects had concealed, and 2+ objects matched, the parser would ask a disambiguation question.
  • Quote boxes weren't centered on screen in z5+ games, like they should.
  • Parse buffer is emptied when leaving a menu in ext_menu in z3, so ending it with "q" can never be misunderstood as the player trying to quit the game.
  • Fixed bug in cheap scenery: If an entry using CS_PARSE_NAME starts with CS_THEM, the object was still considered an IT-object if it had a parse_name routine and it didn't set parser_action = ##PluralFound.

v5.1

10 Oct 14:39
Compare
Choose a tag to compare

Important to note when upgrading:

  • Action routines can return a message to be printed (new), or set globals to have after routines run (older change). For this reason, avoid calling action routines directly, i.e. instead of doing LookSub();, do <Look>;.
  • If you define any entry point routines (apart from Initialise), you now have to define them before including puny.h. Up to now, you were adviced to do just this, but you could often get away with defining them later in the source code.

Changes in functionality:

  • Let action routines return a message# to be printed, and have PerformPreparedAction print this, saving 344 bytes.
  • Ifdefs instead of stubs for entry point routines, saving up to 178 bytes, and adding performance.
  • Moved NotifyOff-, NotifyOn- and Oops-messages to messages.h.
  • TenSpaces array is now private (_TenSpaces) and resides in static memory.
  • Made FastSpaces routine tolerate negative argument.

Optimizations:

  • Updated abbreviations, saving 108 bytes for a minimal game using the built-in abbreviations.
  • Created internal parser routine _ObjInMultipleObjects, reducing logic duplication and saving 48 bytes in z3 and 64 bytes in z5.
  • Created routine _CheckForAndObject in parser, to save 18 bytes.
  • Saved 6 bytes in z3 and 20 bytes in z5 in _ParseToken, while improving performance.
  • Saved 12 bytes in z5 in NumberWord (used by OPTIONAL_ALLOW_WRITTEN_NUMBERS), while improving performance.
  • Made StartDaemon faster and 15 bytes shorter for z5.
  • Made StopDaemon faster and a few bytes shorter for z5.
  • Saved 15 bytes in _ParsePattern for z5.
  • Optimized routines _CopyInputArray and _CopyParseArray for z5.
  • Made resetting of task_done array in main shorter and faster in z5.
  • Made quote box extension faster and smaller in z5, by using FastSpaces routine.

Bugfixes:

  • Fixed bug in CSTEST action in cheap scenery, which said a reaction string or routine was expected after a CS_PARSE_NAME + routine, when there was in fact no problem.
  • Fixed parser bug which gave a strange message for "get blue book and all books but blue."

v5.0.1

25 Sep 17:10
Compare
Choose a tag to compare

Important to note when upgrading:

  • Nothing

Changes in functionality:

  • Modified library_of_horror.inf to use the recently added cheap scenery option to mark some objects or words as "them"-words.

Optimizations:

  • Optimized library_of_horror.inf to produce a smaller Z-code file.

Bugfixes

  • Cheap scenery would match adjectives without a noun following them.

v5.0

09 Sep 21:29
Compare
Choose a tag to compare

Important to note when upgrading:

  • If you use talk menu: Split up your talk_array into one array per actor. End each array with TM_END. Instead of giving each actor a talk_start property, give them a talk_array property, with the name of their own talk array as the value.
  • If you use talk_menu, remove any calls to InitTalk(), as they are no longer needed.
  • If you use talk menu and have replaced the TMPrintLine routine, copy the latest version from ext_talk_menu.h and modify it to your liking.
  • Cheap scenery entries that use the standard form of adjective + noun will now match any combination of these words, e.g. noun adjective noun. Re-test your cheap scenery objects.
  • Cheap scenery now matches the object that matches the highest number of words in player input, rather than the first object that matches any word. Re-test your cheap scenery objects.

Changes in functionality:

  • Change in talk menu: Split up talk_array into one array per actor. End each array with TM_END. Instead of giving each actor a talk_start property, give them a talk_array property, with their own talk array as the value.
  • Change in talk menu: The user definable routine TMPRintLine takes different arguments than before, the code has changed, and it now prints quote marks around lines by default.
  • Change in talk menu: Routines _TMCallOrPrint, _SetTopic, ActivateTopic, InActivateTopic, GetTopicStatus, RunTalk and TalkSub have been altered. The signature (how you call them) of the public routines has not changed, except for TMPrintLine (which users typically don't call).
  • Change in talk menu: Routine InitTalk has been removed.
  • Change in talk menu: The debug action TalkSetup has been removed, along with the grammar to activate it.
  • Updated howto/talk_menu.inf to reflect the changes in talk menu.
  • Changed the standard adjective + noun form for cheap scenery entries to match any combination of these words.
  • Changed cheap scenery so the longest match ( = matching the highest number of consecutive words in player input) is used, rather than the first match. In case of a tie, the first match of this length is used.
  • Changed cheap scenery so "them" will refer to the cheap scenery object if a plural word was used, e.g. "x shelves", or if entry begins with CS_THEM, or if it has a parse_name routine which sets parser_action = ##PluralFound.
  • New cheap scenery feature: CS_MAYBE_ADD_LIST [function] [object] [propery] adds the list if the function returns true.
  • New debug verb for cheap scenery: 'cstest'. Checks the integrity of all cheap_scenery arrays in the game.
  • Improved error printing in cheap scenery: The property name is now printed as well (useful when including extra lists of cheap scenery, not necessarily stored in the cheap_scenery property).
  • New function in flags extension: AnyFlagIsSet(flag1, flag2, flag3) - returns true if any of two or three flags are set.
  • New function in flags extension: AnyFlagIsClear(flag1, flag2, flag3) - returns true if any of two or three flags are clear.

Optimizations:

  • Optimized word matching in cheap scenery extension for z5.
  • Optimized the cheap scenery extension for code size.
  • Made flags functions FlagIsSet and FlagIsClear slightly shorter.

Bugfixes:

  • Improved _PatternLength to count preposition alternatives correctly.
  • Bugfix: You could refer to the cheap scenery object with "it" even after moving to a new room, e.g. "x window. e. open it"

v4.7

27 Aug 11:01
Compare
Choose a tag to compare

Important to note when upgrading:

  • If you have code to check that your game is built with the intended library version, there is now a new constant you may want to consider: PUNYINFORM_PATCH_VERSION. It is normally zero, but e.g if the version is v4.6.3, PUNYINFORM_PATCH_VERSION is 3.
  • MoveFloatingObjects has been changed to look at location rather than real_location when deciding if an object should be present, and if it should be present it is indeed moved location rather than real_location. This may change the behaviour of your floating objects if you're using darkness in your game.

New/changed functionality:

  • New file: howto/adjectives.inf, with a class to add adjectives and many synonyms to objects in all Z-code versions.
  • In addition to the PUNYINFORM_MAJOR_VERSION and PUNYINFORM_MINOR_VERSION constants, there is now a third version constant for PunyInform: PUNYINFORM_PATCH_VERSION. It is normally 0, but if we need to make a patch release between major/minor releases, we set this to a number > 0. If it's 0, it is not printed in the banner.
  • The default message in the cheap scenery extension can now be changed by setting CS_DEFAULT_MSG to a string before including the extension. This is mainly to support extensions that need to replace it.
  • Moved two more messages from parser.h to messages.h, so they can be customized: MSG_PARSER_NO_IT and MSG_PARSER_CANT_SEE_IT.
  • Changed MoveFloatingObjects to use location rather than real_location, i.e. floating objects can also exist in the thedark location (like in I6lib).
  • Added functionality in MoveFloatingObjects to accept a class ID in a found_in array, i.e. if location belongs to this class, the object is present (like in I6lib).
  • Added functionality in MoveFloatingObjects to accept a regular object in a found_in array, and if this object's parent is location, the floating object should also be present (like in I6lib).
  • Changed MoveFloatingObjects to only move an object to location if it's not already there, in order not to disturb the order of the objects more than necessary (like in I6lib).
  • Added functionality in MoveFloatingObjects so a floating object that is held by the player is no longer considered to be floating (like in I6lib).

Optimizations:

  • Optimized IndirectlyContains function for speed.

Bugfixes:

  • Added an optional call to ChooseObjectsFinal when a noun token matches a list of indistinguishable objects. If ChooseObjectsFinal reduces this to a single match, then it is accepted. In effect this means that we pick and use one random item from a set of indistinguishable objects.
  • Improved pattern matching so that shorter patterns are preferred, which provides better responses when using OPTIONAL_GUESS_MISSING_NOUN (issue 112)