Skip to content

Releases: johanberntsson/PunyInform

v3.1

23 Oct 10:23
Compare
Choose a tag to compare

Important to note when upgrading:

  • If your code calls ObjectIsInvisible(obj), change it to ~~TestScope(obj)

Changes in functionality:

  • Added a PunyInform Quick Reference document.
  • Implemented the grammar property as described in DM4.
  • Added support for ParseNoun, at a small cost if you use it, and no cost if you don't. Note: This is called before parse_name, unlike the standard library.
  • Remove duplicates from match list when player specifies same object twice for a multi token.
  • Removed ObjectIsInvisible routine which is not needed. Use TestScope instead.
  • Added UNDO to end of game message.
  • Changed so library doesn't check if header says it's a timed game before updating time, if STATUSLINE_TIME has been defined.
  • Added documentation on ParseToken to manual
  • Added more debugging tips to Game Authot's Guide

Optimizations:

  • Optimized _CheckNoun to save 70 bytes.
  • Optimized disambiguation code to save ~70 bytes.
  • Optimized code order to let virtual memory systems shift out parts of the library for long times, for speed.

Bugfixes:

  • Fixed two incorrect direction names in howto/custom_directions.inf.
  • Fixed noun/second setup for Consult, Answer and Ask action.
  • Fixed so we don't risk duplicates in scope when InScope is used.
  • OPTIONAL_GUESS_MISSING_NOUN function would sometimes reveal a concealed object.
  • When parse_name returned -1 wn was not reset.
  • Fixed error reporting from ParseToken with TT_SCOPE parameter.
  • Fixed that actions sometimes didn't print a message in large games.
  • Fixed compile-time error if SACK_OBJECT and OPTIONAL_NO_DARKNESS were defined.
  • Fixed a bad noun flag test in _CheckNoun.
  • Fixed bad num_words value after disambiguation question.
  • Fixed error reporting from general parse routines.
  • Fixed bug in scope routines that match multiple nouns.
  • Fixed that a direction instead of a disambiguation reply didn't work.
  • Fixed so that setting parser_action = ##PluralFound in parse_name works as it should.

v3.0

20 Sep 17:46
Compare
Choose a tag to compare

Important to note when upgrading:

  • Note that actions ##Wait and ##Inventory now always cause after-routines to run. If you have an after-routine in a location, or a GamePostRoutine(), and they do something for all actions, or all actions except certain listed actions, this may change their behaviour. Try doing Wait and try doing Inventory when you're not holding anything, to see what happens in these locations.
  • If you use ext_waittime.h, note that after-routines are now run for the actions defined by this extension. If you have an after-routine with a default-clause, this may lead to undesired behaviour when the player types e.g. "wait for 10 minutes".
  • If your code uses abbr_direction_array and/or full_direction_array: Copy those arrays from globals.h in PunyInform 2.8 and put them in your own code (there's one version for when OPTIONAL_FULL_DIRECTION is defined and one for when it's not - make sure you get the right one).
  • If your code accesses direction_properties_array, change --> to -> when accessing it.
  • If your code looks at entry 0 of any of the direction arrays to see how many entries there are, change it to use the constant DIRECTION_COUNT instead, which will always give the number of directions (8 or 12, depending on whether OPTIONAL_FULL_DIRECTIONS is defined or not.)

Changes in functionality:

  • Added constant CUSTOM_PLAYER_OBJECT - set it to your own player object, and the library won't create the default selfobj.
  • ##Wait now runs after-routines.
  • ##Inv now always runs after-routines (it used to run them only if the player had a non-empty inventory).
  • Actions defined by ext_waittime.h now run after-routines as well.
  • Added code so parse_name calls are also printed after "routines on", under all Z-code versions.
  • Changed direction_properties array from a table (a kind of word array) to a byte array.
  • Changed direction_name array from a table to a regular word array.
  • Removed arrays abbr_direction_array and full_direction_array, since they are no longer needed by the library.
  • Added a new example in howto folder: custom_directions, showing a way to recognize a set of custom directions, in addition to or instead of the standard directions.
  • Improved documentation on statusline in manual.
  • Slight updates to game author's guide, hopefully making it clearer.

Optimizations:

  • Optimized running of after-routines in action routines, saving ~140 bytes.
  • Optimized parsing of directions, saving 84 bytes in minimal config.

Bugfixes:

  • Part of the message MSG_RESTART_RESTORE_OR_QUIT was compiled even if the message had been replaced by the game, wasting space and printing a warning.
  • Fixed some action routines which didn't set scope_modified when they should.
  • Fixed bug which made for incorrect display when player didn't carry anything, if MSG_INVENTORY_DEFAULT had been replaced.
  • Changed so debug verb "routines" doesn't print double messages under z5+.
  • Fixed pattern offset bug in error handling of incomplete noun lists, leading to better error message for input like "take ball and"
  • Fixed parser problems when player refers to multiple directions in one command, like "take e and w" or "push e w", since direction object can't remember different matches.
  • Fixed so Directions object remembers the correct direction even when the parsed sentence contains an object that begins with a direction, like "look to the east of the north statue" (in a game where the look verb has been extended to allow this).

v2.8.3

27 Aug 05:04
Compare
Choose a tag to compare

Really fixed the issue we said we fixed in v2.8.2.

v2.8

26 Aug 20:05
Compare
Choose a tag to compare

Important to note when upgrading:

  • If you use the property number a lot, you may want to declare it a common property.
  • If you customize any messages whose identifiers end with "_SUCCESS", you need to change them to end with "_DEFAULT" instead.
  • The message MSG_EMPTY_CANT_CONTAIN doesn't exist anymore.

Changes in functionality:

  • Slight updates to Game Author's Guide
  • Added howto/pushdir.inf to show how to program items that can be pushed to
    other locations.
  • Removed the common property "number".
  • New messages: MSG_INSERT_ANIMATE, MSG_PUTON_ANIMATE, MSG_TRANSFER_ALREADY.
  • Removed message MSG_EMPTY_CANT_CONTAIN.
  • Added support for "move object to floor" (gets translated to
    "get object. drop it")
  • Changed all message identifiers ending with "_SUCCESS" to end with
    "_DEFAULT" - MSG_ANSWER_SUCCESS, MSG_ASK_SUCCESS, MSG_ASKFOR_SUCCESS,
    MSG_ASKTO_SUCCESS, MSG_ATTACK_SUCCESS, MSG_CLOSE_SUCCESS,
    MSG_DISROBE_SUCCESS, MSG_EAT_SUCCESS, MSG_ENTER_SUCCESS, MSG_EXIT_SUCCESS,
    MSG_GIVE_SUCCESS, MSG_INSERT_SUCCESS, MSG_INVENTORY_SUCCESS,
    MSG_KISS_SUCCESS, MSG_LISTEN_SUCCESS, MSG_LOCK_SUCCESS, MSG_OPEN_SUCCESS,
    MSG_PULL_SUCCESS, MSG_PUSH_SUCCESS, MSG_PUTON_SUCCESS, MSG_REMOVE_SUCCESS,
    MSG_SAVE_SUCCESS, MSG_SCORE_SUCCESS, MSG_SHOUT_SUCCESS, MSG_SHOUTAT_SUCCESS,
    MSG_SHOW_SUCCESS, MSG_SMELL_SUCCESS, MSG_SWITCH_OFF_SUCCESS,
    MSG_SWITCH_ON_SUCCESS, MSG_TAKE_SUCCESS, MSG_TELL_SUCCESS,
    MSG_THROW_SUCCESS, MSG_TOUCH_SUCCESS, MSG_TURN_SUCCESS, MSG_UNLOCK_SUCCESS,
    MSG_WAIT_SUCCESS, MSG_WAKE_SUCCESS, MSG_WAKEOTHER_SUCCESS, MSG_WEAR_SUCCESS
  • MSG_REMOVED_CLOSED has changed from "The (object) is closed." to
    "You can't, since the (object) is closed."

Optimizations:

  • Changed so complex library messages shared by multiple identifiers are now
    omitted if all identifiers have been replaced by custom messages.
  • Changed InsertSub and PutOnSub to call a common routine, to save bytes.

Bugfixes:

  • Fixed a bug in _UserFilter which caused problems when using a filter function
    for second.
  • TransferSub no longer tries to drop something if it couldn't be picked up.
  • TransferSub now runs AfterRoutines().
  • Fixed bug: TryToTakeNoun would return true, signalling that take failed,
    if original supporter/container's after routine returned true for ##LetGo.
  • MSG_ENTER_NOT_OPEN, MSG_EXIT_NOT_OPEN, MSG_INSERT_NOT_OPEN,
    MSG_GO_DOOR_CLOSED, MSG_EMPTY_IS_CLOSED, MSG_REMOVE_CLOSED now print
    "are closed" for pluralname objects.

v2.8.2

27 Aug 04:36
Compare
Choose a tag to compare

Fixed a compilation error for games with OPTIONAL_NO_DARKNESS.

v2.8.1

26 Aug 20:24
Compare
Choose a tag to compare

v2.8 mistakenly held old docs and the library identified itself as v2.7. Fixed this.

v2.7

19 Jul 11:59
Compare
Choose a tag to compare

Important to note when upgrading:

  • If you define your own grammar or extend the grammar for 'shout', 'yell', 'scream' or 'jump', you will want to check that everything still works as it should after upgrading.

Changes in functionality:

  • Added grammar for "shout (topic) at (creature)", triggering the Answer action ('to' was recognized before, 'at' is a new synonym)
  • Added a new action ShoutAt, triggered by "shout to/at (noun)"
  • Added grammar for "jump in (noun)", triggering the Enter action. ('into' was recognized before, 'in' is a new synonym)
  • New constants OPTIONAL_SL_NO_SCORE and OPTIONAL_SL_NO_MOVES to hide score and moves from the statusline in z5+ games. Defining NO_SCORE will define OPTIONAL_SL_NO_SCORE automatically.
  • Added routines NumberWords and WordValue (described in DM4)

Optimizations:

  • Moved PronounNotice routine to a better place in parser.h, considering
    virtual memory handling in Ozmoo and other 8-bit terps.

Bugfixes:

  • Removed the text "revealing..." when opening a container from the inside.

v2.6

08 Jun 13:10
Compare
Choose a tag to compare

Important to note when upgrading:

  • If you have added any of the verbs 'sniff', 'place', 'shout', 'scream' or 'yell' to your game, you will need to modify your code, as these verbs are now part of the standard set of verbs.

Changes in functionality:

  • Changed so 'shout' is not a synonym of 'say' but has its own grammar and has 'scream' and 'yell' as synonyms. "shout hello to John" still triggers the ##Answer action. "shout hello" or just "shout" triggers the new ##Shout action, setting consult_from and consult_words if any words to be shouted were specified.
  • Added 'sniff' as a synonym to 'smell'
  • Added 'place' as a synonym to 'put'.
  • Changed PushDir to use the ADirection filter for the direction argument

Optimizations:

  • Made statusline drawing faster in ext_menu.h (only affects z5+).
  • Made RunRoutines() faster for all common properties.
  • Made the noun guessing code faster and shorter.

Bugfixes:

  • Fixed a pronoun update bug when trying to talk to inamimate objects.
  • Added rule to not include held objects when disambiguate for the take action
  • Try to set scope_modified in the correct places in the library files.
  • Now printing all prepositions when complaining that the input is incomplete
  • Parsing "go" (without a direction or object) correctly.
  • Fixed so that noun filters are applied when parsing pronouns.
  • Improved message for incomplete sentences ('take ladder and')
  • Improved messages for putting things in/on itself.
  • Fixed broken 'again me' response (issue 81)
  • Fixed shortname for Directions ('put sweater in s' gave "south can't contain things")
  • Fixed that consult_words sometimes held a value when it shouldn't have.

v2.5

14 May 13:31
Compare
Choose a tag to compare

Important to note when upgrading:

  • Update your code to set update_moved = true; whenever you move an object into the player's inventory using a move command, to make sure the object gets the moved attribute and that the object is scored, when applicable.
  • If you provide customized strings for MSG_PARSER_BAD_PATTERN_PREFIX and/or MSG_PARSER_BAD_PATTERN_SUFFIX, you now need to change them to complex messages.

Changes in functionality:

  • Changed moved and the scoring of objects to work like I6 (update these at the end of the turn), added _NoteObjectAcquisitions. Note: Game author must set update_moved = true; when moving objects into player's inventory!
  • PunyInform Technical report added (documentation/techreport.pdf). This is meant to help in getting a better technical understanding of the library, for anyone who feels the need.
  • Game Author's Guide has been updated with more material on optimization, thanks to Hugo Labrande.
  • Changed the library messages for searching a container or supporter (MSG_SEARCH_IN_IT_ISARE, MSG_SEARCH_ON_IT_ISARE)
  • The (undocumented) routine SearchInOnNoun() was removed.
  • Messages MSG_PARSER_BAD_PATTERN_PREFIX and MSG_PARSER_BAD_PATTERN_SUFFIX were changed to be complex messages instead of static strings.
  • Changed MSG_TAKE_ALREADY_HAVE from a static string to a complex message, merging it with another message.
  • Changed newlines before and after quote box.

Bugfixes:

  • Fixed warning in ext_cheap_scenery when SceneryReply is not defined.
  • Changed so "actions" debug verb doesn't print object name when noun or second is a number.
  • Fixed bug: MoveFloatingObjects didn't set scope_modified.
  • Fixed a bug that made it impossible to change MSG_PARSER_BAD_PATTERN_PREFIX and MSG_PARSER_BAD_PATTERN_SUFFIX into complex messages.
  • Fixed bug in ext_quote_box.h which made quote box stay on screen forever.
  • Fixed a bug where grammar patterns with a topic token got a too high score (issue 77)

v2.4

20 Apr 16:08
Compare
Choose a tag to compare

Important to note when upgrading:

  • PunyInform now calls before and after of real_location instead of location. This means that if you have put code in thedark.before or thedark.after you now need to find other ways to do the same thing. For some situations, you may want to use before and after of the actual location where you need things to happen in the dark.
  • There's a new action ##Climb which covers "climb noun", "climb up noun" and "climb over noun".

Changes in functionality:

  • Changed so before and after are run for real_location rather than location.
  • Removed before and after for thedark.
  • Reworked howto/semidark.inf to work without using thedark.before.
  • Added climb and climb up/over to grammar, new action ##Climb.
  • Switched to fixed-width font for quote box in z3.
  • Added a second parameter for QuoteBox() to not wait for keypress after quote box.

Optimizations:

  • Merged a library message into another, to save some bytes.
  • Reordered properties to put those that have to be fast at the end.

Bugfixes:

  • Fixed bug in ext_quote_box (which crashed some interpreters in z3 just after quote box was printed.)
  • Fixed bad parsning of topic followed by multiple preposition alternatives.
  • Improved parser response when refering to objects outside scope (issue 75)
  • Fixed so cant_go property can hold a routine or string, not just a string.
  • Improved detection of pluralword flag when parsing a noun phrase
  • Improved selection of incomplete patterns ("show XXX" with missing obj)
  • Fixed consult_from bug (would only work the first time)
  • Fixed bug in detection of multiple words from the room's name property