Releases: johanberntsson/PunyInform
v4.4
Important to note when upgrading:
- If you're using the flags extension, using flag 0 is now deprecated. Use flag 1 and up.
Changes in functionality:
- Functions in flags extension can now take up to three flags in a call, e.g. if(FlagIsSet(F_BOB, F_STEVE, F_LINDA)) returns true if all three flags are set. To make this work, flag number 0 has been deprecated. Old code using flag 0 will still work, but will produce a warning in debug mode.
- New optional feature OPTIONAL_MANUAL_SCOPE_BOOST, speeding up turns for games with manual scope updates, where the player will often have many non-reactive objects in scope. More info in the manual.
- Default value of MAX_SCOPE is changed from 32 to 50.
- Game author's guide has been updated and content reordered. Every author should read chapter 1-3.
- Extended howto/talk_menu.inf to demostrate how to customize the messages printed by the talk_menu extension.
Optimizations:
- Replaced some veneer routines with shorter versions (optimized and not printing error messages) when building a game without DEBUG or Strict mode, and with RUNTIME_ERRORS set to 0.
- Optimized DrawStatusline, making it 9% faster and a few bytes smaller.
- Minor optimization in parser, making it a little faster and smaller.
- Made the dashes array in talk_menu static.
- Optimized code to run react_before, react_after and each_turn, making it 100+ bytes smaller.
Bugfixes:
- Fixed serious bug in talk menu extension - if you specified a routine to be run if a certain option was selected, and the story file was larger than half the maximum story file size for the Z-code version, it would result in runtime errors.
- Fixed a bug in _PrintPatternSyntax to handle patterns with routine calls
- Fixed a bug where a wide list would print "which contains is ..." for a container placed on a supporter.
v4.3
Important to note when upgrading:
- Six library messages have gone from being static strings to complex messages (code) (See list under "Changes in functionality"). If you get an error like the one below, it's because you have tried to replace a compex message with a simple message, which isn't possible. Fix: Change it to a complex message instead.
lib\messages.h(707): Error: Expected constant but found <expression>
> #IfTrue MSG_EAT_INEDIBLE < 1000;
- If you call RunTimeError, you now need to change it to _RunTimeError. (This is really an internal routine, which game programmers shouldn't have to call though).
Changes in functionality:
- Updated library messages to reflect when the noun has pluralname:
- MSG_TAKE_SCENERY: That's hardly portable => That's/They're hardly portable
- MSG_OPEN_YOU_CANT, MSG_CLOSE_YOU_CANT, MSG_ENTER_YOU_CANT, MSG_LOCK_NOT_A_LOCK, MSG_UNLOCK_NOT_A_LOCK, MSG_WEAR_NOT_CLOTHING: That's not something you can open/close/enter/lock/unlock/wear => You can't [verb] that/those
- MSG_TAKE_STATIC, MSG_PUSH_STATIC, MSG_PULL_STATIC, MSG_TURN_STATIC: That's fixed in place => That's/They're fixed in place
- MSG_EAT_INEDIBLE: That's plainly inedible => That's/They're plainly inedible
- MSG_OPEN_ALREADY: It's already open => It's/They're already open
- MSG_OPEN_LOCKED: It seems to be locked => It's/They're locked
- MSG_PUTON_NOT_SUPPORTER: You can't put things on top of that => You can't put things on top of that/those
- Six library messages have gone from being static strings to complex messages: MSG_TAKE_SCENERY, MSG_TAKE_STATIC, MSG_EAT_INEDIBLE, MSG_OPEN_ALREADY, MSG_OPEN_LOCKED, MSG_PUTON_NOT_SUPPORTER.
- Added runtime error for when a door fails to define door_to or door_dir.
- Runtime error when you try to start a timer and the object lacks the time_out property now prints the offending object.
- Routine RunTimeError was renamed to _RunTimeError, to reflect that it's not a routine game programmers are likely to need.
Bug fixes:
- Non-existent constants MSG_LOCK_YOU_CANT, MSG_UNLOCK_YOU_CANT and MSG_WEAR_YOU_CANT were mistakenly referred to in messages.h, instead of the constants that should have been used.
- Fixed a lot of minor issues in the manual.
v4.2
Important to note when upgrading:
- If your code uses ChooseObjects, test this again to make sure it does what you want, as the weight of the score returned by ChooseObjects when helping out in picking a single object has changed.
Changes in functionality:
- Added entry point routine ChooseObjectsFinal, letting the programmer influence the final choice of object, just before the parser has to ask the player to specify which object they mean.
- Added a demo game howto/indistinguishable.inf to show how a game can have (a small number of) indistinguishable objects, utilizing the new ChooseObjectsFinal entry point routine.
- Added an optional suffix to the library version, e.g. "dev" for v4.1dev, using constant PUNYINFORM_VERSION_SUFFIX.
- Changed weight of ChooseObjects score to make it always trump library score. This is how it works in the standard library too.
- Internal routine _CheckNoun was renamed to _ParseNounPhrase. The constant to make it print debug information was renamed to DEBUG_PARSENOUNPHRASE.
- Added suggestion to Game Author's Guide to initialize the talk_menu extension manually.
Bug fixes:
- Fixed visibility_ceiling bug which prevented correct calls in PlayerTo and removed the visiblity_ceiling global.
- Improved parsing of multiexcept so disambiguation doesn't give the same priority to objects in/on the second noun phrase in the grammar.
- Fixed bad parsing of 'get Xs and Y' patterns, i.e. where the Xs is a word in plural form, possibly referring to several objects.
- Fixed warnings and confusing text in test programs.
v4.1
Important to note when upgrading:
- If you have objects which have direction words in their names, e.g. "east river", "west wall", do some testing to make sure the game behaves as it should in these locations. While we expect the library to behave more sensibly now, a bit of extra testing is in order.
Changes in functionality:
- Improved differentiation between directions and objects, since giving them equal priority in the parser caused a bug in the Cloak of Darkness game ("x floor" referred both to down and floor). Parser now prefers objects which are not directions.
- Added OPTIONAL_LIST_TOGETHER to support list_together property (but indistinguishable objects are still not supported).
- Added OPTIONAL_LANGUAGE_NUMBER to support the routine LanguageNumber(n), to print e.g. "twenty-five".
- Added programming example for list_together property: howto/list_together.inf
- Allow author to define timer_order as a common property if they want, when using OPTIONAL_ORDERED_TIMERS.
- Routines _CheckNoun, _CheckPatterns renamed to _ParseNounPhrase, _PrintGrammarPattern.
Optimizations
- _ParseNounPhrase routine has been made smaller and faster.
Bugfixes:
- Fixed a bug where patterns containing prepositions that didn't match at all didn't produce any response from the parser.
- Fixed a bug where direction variables were incorrectly set for non-directional nouns when the parser was perfoming an action for a list of objects, i.e. "TAKE EAST AND BOOK".
v4.0
Important to note when upgrading:
- If you are using the cheap scenery extension, and you have description routines, note that these are now reaction routines, allowing them to react to any action. They now have the same format as before routines. For an existing description routine, add "Examine:" first in the routine. If it's a named routine, you must also add "default: rfalse;" last in the routine.
- If you are calling _ImplicitGrabIfNotHeld or _ImplicitDisrobeIfWorn, remove the initial underscore character.
Changes in functionality:
- Cheap scenery description routines are now reaction routines, which work like before routines, allowing them to trap all actions on the object.
- Parser won't try to auto-take object for a held token, if the object has static, scenery or animate, except animate objects which have been made takeable through the use of a DisallowTakeAnimate routine. This allows before routines to react to "eat whale", "attack troll with steamroller" etc.
- Support for global no_implicit_actions, to let game tell library not to use implicit actions.
- _ImplicitGrabIfNotHeld routine has been renamed to ImplicitGrabIfNotHeld and has been documented in the manual and quickref document.
- _ImplicitDisrobeIfWorn routine has been renamed to ImplicitDisrobeIfWorn and has been documented in the manual and quickref document.
- 'look north' etc. now works
- Library now runs _NoteObjectAcquisitions whenever child(player) has changed, so forgetting to set update_moved typically doesn't cause problems.
Bugfixes:
- Fixed 'ask actor to topic' conversion to 'actor, topic' (issue 107)
- Stopped 'again' from triggering an endless loop after an empty input line.
- Fixed 'ask George to look' and similar to generate the order callback
- Bugfix: Setting second to the first word in topic for ##Tell
v3.6
Important to note when upgrading:
- If you are using the cheap scenery extension, and the SceneryReply routine which you may provide for it, note that the SceneryReply routine now takes three arguments instead of two:
word1
,word2
androutine
. Please update your SceneryReply routine accordingly. See the manual for information on how to use theroutine
parameter. - The 'touch' verb now has three new synonyms: 'feel', 'fondle' and 'grope'. If you have added any of these words as verbs to your game, you will need to change your code.
Changes in functionality:
- Added 'feel', 'fondle' and 'grope' as synonyms to touch.
- Added 'enter' and 'exit' for in_dir, out_dir in rooms (issue 105)
- Improved 'take off' for objects not being worn (issue 103)
- Added a way for SceneryReply routine (used with cheap scenery extension) to tell different inline parse_name routines apart.
- Added howto/cheapscenerydemo.inf to show how to use Cheap Scenery.
- ext_talk_menu has a new global variable talk_menu_talking. A routine in talk_array can set it to false to end the conversation prematurely.
- Added strict mode indicator for v5 (issue 104)
Optimizations:
- Minor optimizations for speed and size in parser.
- Minor optimisations for speed and size in handling of ordered timers.
Bugfixes:
- Fixed GuessMissingNoun bug for phrases with missing noun without second.
- Fixed pattern scoring bug when some patterns contained the scope token.
- Added messages for empty inputs (issue 106)
v3.5
Important to note when upgrading:
- PunyInform now expects the Inform compiler to be version 6.36.
Changes in functionality:
- PunyInform now expects the Inform compiler to be version 6.36.
- New extension: ext_talk_menu.h, for menu-driven conversations.
- New example game: howto/talk_menu.inf
- Don't print the option to UNDO if the player has won the game, only if they lost.
- If the game defines DEATH_MENTION_UNDO, print the option to undo even if the player won.
- Don't print the option to UNDO if the interpreter says it doesn't support it.
Optimizations:
- Slight optimization of Directions.parse_name for z5.
Bugfixes:
- Fix routine _ListObjsMsg in grammar.h, which was called with one argument but didn't have any local variables, as this caused a warning in Infocom's terps for Motorola 68K platforms.
- Fixed grammar property bug, where -verb responses has a bad parser offset
v3.4
Important to note when upgrading:
- "look on table" (leading to the action ##Search) is now recognized by PunyInform. If you have added grammar for this to your game, you can probably just remove it from your game code.
Changes in functionality:
- New constant OPTIONAL_FLEXIBLE_INVENTORY enables "i tall/wide" to switch inventory format.
- Game code can change the inventory format by setting inventory_style to 0 (tall) or 1 (wide).
- Changed workflag-parameter for PrintContents to be called p_style. It can be omitted or 0, or you can add one or more bit values. The ones currently supported are ISARE_BIT (print "is" or "are" before list), WORKFLAG_BIT (only print objects which have workflag set), and NEWLINE_BIT (print each object indented, on a new line). Existing calls to PrintContents don't have to be changed.
- ext_cheap_scenery has a new option: Give CS_PARSE_NAME (=2) as the adjective value and a routine that works like a parse_name routine as the noun value to allow for long names and names with certain rules. However, two items in the cheap_scenery list can never compete - the first one that matches at least one word wins.
- ext_cheap_scenery has a new option: Give CS_ADD_LIST (=3) as the adjective value and an object as the noun value and a property name as the description value, to include a list of cheap scenery objects in the current list.
- Added new mode for calling PrintContents: p = PrintContents(1, obj). Returns:
0 if there are no printable objects in/on p_obj
1 if there's exactly one printable object and it doesn't have pluralname
2 if there are 2+ printable objects or one object with pluralname - New public routine FastSpaces(n) to print n space characters efficiently.
- New optimization tip added to Game Author's Guide.
- ext_menu.h got a new constant EXT_MENU_STDLIB_MODE - if defined, item_width should be set to half the name length of the item, just the way DoMenu works in the standard library (issue 96)
- Added grammar for "look on table" (issue 97).
- New routine _IsAreString(p) to return string "is " or "are ". Used by _PrintContents. Note: Not a public routine.
- Added comments to all messages in messages.h which receive one or two arguments.
Optimizations:
- Slight optimization in Direction.parse_name
Bugfixes:
- _IsSentenceDivider was using dictionary words directly for 'then' and 'and' although there are constants to be used. Fixed.
- Fixed bad messsage for enter action with missing preposition (issue 95)
- Fixed missing "(which is empty)" for container holding only scenery or concealed objects (issue 99).
- Improved "search (supporter)" message to use is/are more correctly.
- Improved PrintContents to use is/are more correctly for supporters.
- More precise error messages failing with a missing preposition.
v3.3
Important to note when upgrading:
- The library now provides a 'score' verb even for non-score games, just to say there is no score in this game. If you have a non-score game which implements the "score" verb, you now have to remove your implementation or replace ScoreSub with your routine, or change the library message MSG_SCORE_DEFAULT.
Changes in functionality:
- Implemented ChooseObjects entry point routine.
- Added a 'score' verb for games with no score, which just prints a message saying there is no score in this game.
- Added an example of how to add random comments to a game (howto/comments.inf).
- Changed so that NPCs can't use wildcards, such as "take all" (This was deemed a both buggy and undesirable behaviour)
- Set lower priority in parser for objects that aren't held when issuing an action that expects a held object.
- Set lower priority in parser for held objects when issuing a Take command, even for NPCs.
Optimizations:
- Exclude code to call LibraryMessages unless it's defined.
Bugfixes:
- Stopped the parser from trying to pick up object for Held grammar token when actor isn't player.
- Fix so noun is the first recognized word in topic, and second is the actor, when action == ##NotUnderstood
- Fixed bug which made parser not recognize NPC name if player first did "go (direction)" or asked an NPC to do it, e.g. "John, go east" and then "John, take the sweater".
- Improved parsing of complex disambiguation messages such as 'get blue book and books' and 'get blue book and all books except blue'
- Fixed bad call to each_turn when aborting a disambiguation question
v3.2
Important to note when upgrading:
- If you currently replace any of the messages MSG_LOOKMODE_NORMAL, MSG_LOOKMODE_LONG or MSG_LOOKMODE_SHORT with a string, you need to change your replacement message to a complex one (a message handled in code in LibraryMessages).
Changes in functionality:
- Changed lookmode messages to a complex message, to make the library smaller AND allow for more generic abbreviations which will benefit games better.
- Updated techreport.
- Updated quickref document.
- Added markdown version of QuickRef document.
- Don't print "(providing light)" for animated objects with light attribute.
- _UpdateScope changed so it remembers if the last calculated scope was for a scope routine.
- Added error message when addressing a misspelled or missing NPC.
- Added an error message when player is giving a too vague specification of an object in an order to an NPC.
Optimizations:
- Optimized parser to gain some speed and make it a little smaller.
- Made Banner() smaller by checking if Story and Headline are defined.
- Updated quickref document.
Bugfixes:
- Added missing ##Going after rule call when moving between rooms.
- Fixed bad NPC order handling (##NotUnderstood and ##Answer callbacks).
- Fixed scope token handling of pattern with more than one object. Now the scope modification is only valid during the parsing of the scope token, and then reset to normal scoping rules.
- ext_menu.h and ext_quote_box.h now force a resplit for the statusline upon exit (which they always should have done).
- Fixed bad is/are for MSG_SEARCH_CANT_SEE_CLOSED (issue 92)
- Fixed ThatorThose response for the player object (issue 91)
- Fixed bug in howto/change_player.inf that was introduced in v3.0 and made nothing work as it should with the PC swapping.
- Made non-transparent actors have their possessions in scope.
- Fixed setup of noun/second for NPC orders.
- Fixed parser bug which would sometimes make it print "I think you wanted to (verb) someone" when it should have been something.