Skip to content

Releases: johanberntsson/PunyInform

v2.3

08 Apr 10:24
Compare
Choose a tag to compare

Bug fix and optimization release (8 April 2021)

Important to note when upgrading:

  • If you use OPTIONAL_MANUAL_REACTIVE, you now need to add the reactive attribute to all objects that provide add_to_scope

Changes in functionality:

  • The reactive attribute is now also used for objects that provide add_to_scope
  • If constant OPTIONAL_REACTIVE_PARSE_NAME is defined, reactive attribute is also used for objects that provide parse_name (Read the manual on "The reactive attribute" before defining this constant!)
  • Added AddToScope as a synonym for PlaceInScope. DM4 is confused about its usage, and we recommend you just use PlaceInScope.

Optimizations:

  • Made _UpdateScope code shorter

Bugfixes:

  • Better parser response when a dictionary word failed to parse a noun
  • Fixed scope bug: add_to_scope was not run for the objects in an add_to_scope list.
  • Added objects in the dark to scope, just like I6lib does.
  • The death/win message is now printed in bold in z5.
  • Removed full stop after You have won/died messages.

v2.2

26 Mar 19:33
Compare
Choose a tag to compare

Bugfix and new feature release (27 March 2021)

Important to note when upgrading:

  • If you have code which reacts to a meta action like Save or Score in a before or react_before routine, that code won't work anymore. Instead, you will need to replace the action routine and add code to it.
  • There is now an extra newline printed before the game banner (the name of the game etc that is typically printed when the game starts). If you now have an unwanted newline, you need to remove a newline from the text printed before the banner.
  • If you define OPTIONAL_PRINT_SCENERY_CONTENTS, note that the meaning of this constant has changed. The contents of scenery objects are printed, regardless of whether they also have the concealed attribute. (It used to print the contents of all objects that had the scenery attribute OR the concealed attribute).

Changes in functionality:

  • Changed so BeforeRoutines() is not executed for meta verbs (issue 74)
  • The banner now has an empty line first, just as in I6 lib.
  • OPTIONAL_PRINT_SCENERY_CONTENTS will no longer cause Look to print contents of objects which have concealed attribute, unless they also have scenery.
  • The global "turns" now holds -1 until the first turn begins, at which time it's set to 0.
  • NO_SCORE constant is now supported and saves 310+ bytes if defined.

Optimizations:

  • Changed when scope_modified is set, for PutOn, Insert, Take, Drop and Purloin. This is partly an optimization, partly a bugfix and partly a (very minor) change in functionality.
  • Optimized matching of directions.
  • Removed superfluous global scope_copy_is_good

Bug fixes:

  • Fixed 'take all except X' offset error
  • Fixed take multiple bug (would silently ignore held objects)
  • Better parser response when grammar missing (e.g. Extend 'close' replace;)
  • Better parser responses when trying to parse unknown words
  • Better parser responses to bad input such as 'i blue' and 'open all'
  • Better parser response when list of nouns found where it isn't allowed
  • Made ExamineSub return correctly after printing "There's nothing special about (the item)."

v2.1

04 Mar 20:37
Compare
Choose a tag to compare

Bug fix and new feature release (5 March 2021)

Important to note when upgrading:

  • There is one less free attribute. If you were already using all free attributes, you will get an error. Possible fix: Use an individual property instead.

Changes in functionality:

  • New entry point routine: DisallowTakeAnimate. Have it return false if the player should be able to pick up noun.
  • Added constant OPTIONAL_MANUAL_REACTIVE which can be used by authors who want to make their game start as fast as possible. (Search for "reactive" in the manual to learn more)
  • Added debug verb "debug reactive" which shows objects which need to get or lose attribute reactive, when using OPTIONAL_MANUAL_REACTIVE.
  • Moved oops, again and score notifications messages to messages.inf

Optimizations:

  • Added attribute reactive which must be set for all objects providing react_before, react_after or each_turn. By default it is set automatically at game start, but an author can define OPTIONAL_MANUAL_REACTIVE to set it manually. The use of this attribute speeds up the game in situations with many objects in scope.
  • Optimized checking of react_before and react_after.
  • Optimized loops in BeforeRoutine, AfterRoutines and RunEachTurn.
  • Optimized so contents of scope_copy array can often be reused several times.
  • Made GetScopeCopy faster.
  • Removed unnecessary check for duplicates in ScopeWithin.

Bug fixes:

  • Implicit actions only occur when the actor==player, to stop for example "bob, give me knife" from doing unexpected things with the knife.
  • Fixed bug in handling fake directions, which made code like break every time.
  • Fixed "x me.g.g" locking up the game (disallowing complex again commands)
  • Fixed pattern filter bug in parser that stopped some commands from reaching phase 2.
  • Fixed bug that didn't restore scope after using a scope=XXX grammar token.
  • Made UpdateScope avoid adding duplicates when called after a scope routine which has already added objects.

v2.0

17 Feb 17:43
Compare
Choose a tag to compare

Bug fix and new feature release (17 February 2021)

Important to note when upgrading:

  • Games that use the scored attribute will now need to define OPTIONAL_SCORED!
  • Concealed/scenery items now show up in inventory.
  • To read the capacity of an object, you now have to call ObjectCapacity(object).

Changes in functionality:

  • Added OPTIONAL_SCORED to support the 'scored' attribute for places and objects.
  • Added OPTIONAL_SIMPLE_DOORS for an easier way to create doors, which also saves space if you have more than three doors.
  • Added OPTIONAL_PROVIDE_UNDO for supporting the 'undo' verb (only in z5 and z8).
  • Added new Game Author's Guide in documentation folder.
  • Changed to show concealed/scenery items in inventory lists (issue 72).
  • Changed so the capacity property is an alias of nw_to, to save a common property. This leads to capacity not having a proper default value. To read the capacity property, call ObjectCapacity(object). This returns the capacity value of the object or, if not provided, the value of the constant DEFAULT_CAPACITY, which is 100 unless the game code defines it.
  • Added a line to the summary in FullScoreSub, for "noteworthy actions". This sums up score added in code, like "score = score + 10;".
  • Moved messages from FullScoreSub to messages.h, so they can be customized.

Bug fixes:

  • Referring to undefined pronouns now give better responses (issue 68).
  • Fixed something/someone response when second missing (issue 70).
  • Changed to allow multiexpect to respond without filtering (issue 71).
  • Fixed creature testing bug (issue 73).

v1.9

17 Jan 12:03
Compare
Choose a tag to compare

Bugfix and new feature release (17 January 2021)

Changes in functionality:

  • Changed the Look routine to conserve space on small screens:
    • Default behaviour is now to NOT print an empty line before the room name
    • Added library message MSG_LOOK_BEFORE_ROOMNAME. Use it to print a newline if you want the old behaviour. (See testbench.inf)
  • Added constant OPTIONAL_NO_DARKNESS which removes handling of light and dark.
  • Added constant OPTIONAL_ORDERED_TIMERS, allowing programmer to decide the relative order of execution for different timers/daemons.
  • Changed MSG_OPEN_SUCCESS to also reveal the contents of the container being opened, if the container is non-transparent.
  • "put me in box" is now transformed into "enter box" (a before routine can capture any of the actions). Same with "put me on chair".
  • Print a newline before calling Initialise for v5 games, so first line of text isn't covered by statusline.
  • Added 'them' as a pronoun for pluralname objects
  • New feature: To make sure debug verbs like purloin can match an object which has a parse_name routine and may not have a parent, define a routine DebugParseNameObject(object) which returns true for all such objects. (See manual, under Debugging)
  • Made scope update at turn start rely on scope_modified_flag. This makes games using OPTIONAL_MANUAL_SCOPE quicker at times.
  • Added auto-disrobe action for actions Drop, ThrowAt, Insert and PutOn.
  • Put auto-take message in messages.h as MSG_AUTO_TAKE.
  • DROP ALL and PUT ALL IN BOX will no longer include worn objects.
  • Stopped 'held' and 'creature' from matching all and all-but sentences.
  • Added code to howto/change_player.inf so all would-be PCs accept gifts from the player.

Optimizations:

  • Changed PrintMsg to be a global variable, to save 150+ bytes. Doesn't affect anything from a game programmer's point of view.

Bugfixes:

  • Fixed bad quit message (issue 56)
  • Fixed bug where "get off (supporter)" would not let the supporter's after routine react to the Exit action.
  • Fixed bug with scope not being updated when the player is in a dark container and opens it.
  • Fixed bug in BeforeParsing call
  • Fixed inconsistent message format (issue 58)
  • Fixed issue 60 (parsing error with multiple sentences containing directions)
  • Fixed bug in matching of 'creature' token.
  • Changed multiexcept token to generate before/after calls for all objects
  • Rewrote CheckNoun to improve Disambiguation (issue 63)
  • Fixed bad restore failed message (issue 64)
  • Fixed code that was needed for some debug commands but was never compiled.
  • Fixed problem with compiler not finding DebugAttribute when compiling for v5 with strict error-checking.

v1.8

27 Nov 12:17
Compare
Choose a tag to compare

Bug fix and new feature release (27 November 2020)

Changes in functinality:

  • Added that Look will print what is in/on containers/supporters which have either scenery or concealed, if constant OPTIONAL_PRINT_SCENERY_CONTENTS is defined.
  • Added constants STATUSLINE_TIME and STATUSLINE_SCORE, to include only the code needed for the type of statusline used in the game.
  • Added extension ext_waittime.h
  • The cheap scenery extension doesn't let through the Search action any more in its before rule, which allows the game author to give a custom response for that action instead in SceneryReply.
  • The cheap scenery extension now allows for the SceneryReply routine to check which cheap scenery "object" was matched - it gets the two words specified for the "object" as two parameters. See example in ext_cheap_scenery.h
  • Made TheDark object more flexible by adding properties before and after.
  • Added howto/semidark.inf, a demonstration of how one can implement almost dark rooms.
  • If a switchable object has a string for description, or a routine which returns true, "examine [object]" will no longer add a text saying whether the object is currently switched on or off.
  • Added scoring notifications even on the final turn of the game, just before you win/die/lose.
  • Moved all processing that happens at the end of a turn to a routine called EndTurnSequence(). This can be called by a WAIT command to simulate that turns happen, should anyone want to implement a WAIT command.
  • Added checks so each_turn processing is stopped if an each_turn routine ends the game, or if a daemon or timer ends the game. Also, TimePasses() isn't called if a timer, daemon or each_turn has ended the game.
  • Changed so turns / clock is advanced before timers, daemons, each_turn and TimePasses() at the end of the turn.
  • Changed to use sys_statusline_flag to detect that it's a game with time on
    the statusline.

Optimizations:

  • Started using same message for MSG_INSERT_NOT_CONTAINER and MSG_EMPTY_CANT_CONTAIN.

Bugfixes:

  • Fixed location test in GoSub for vehicle movements in the dark
  • Fixed that 'a' (character) was used instead of 'a//' (dictionary word) when skipping articles to set noun and second to dictionary words for Ask etc.
  • Fixed bad parser message for incomplete sentences in patterns that use routine filters
  • Fixed bug in ScopeWithin
  • Fixed bug in call to TT_PARSER_ROUTINE
  • Improved _GrabIfNotHeld and related unit tests (issue 40)
  • Fixed broken "restore failed" message when RestoreSub is called after game has ended.
  • Removed extra space after "You have won/died"
  • Fixed bug where "Score" or "Time" would not be printed on statusline if the room name was too long.
  • Fixed bug where numbers and parse routines got a bad pattern score.
  • Fixed bug where 12:xx AM was printed as 0:xx AM on statusline.
  • Fixed bug which put location in scope in darkness.
  • Fixed bug in centering menus on screen, in ext_menu.h. Issue #55.

v1.7

05 Nov 15:49
Compare
Choose a tag to compare

Changes in functionality:

  • Added OPTIONAL_SHIP_DIRECTIONS which makes PunyInform recognize 'fore', 'f', 'aft', 'a', 'port', 'p', 'starboard', 'sb' as synonyms for north, south, west, east.
  • Added globals normal_directions_enabled and ship_directions_enabled to select which directions currently work.
  • Made 'unknown word' messages customizable
  • Objects which have scenery or concealed no longer get the chance to be printed by Look, even if they have initial, when_open, describe etc.
  • selfobj (the default player object) now has describe property, but not the unsupported before_implicit.
  • Added a test suite for regression checks
  • Added a code example in howto folder for having multiple player characters.
  • Replaced THEN_WORD with THEN1__WD for I6 compatibility
  • Improved incomplete switch command replies
  • PunyInform now informs when the score goes down, as well as up.

Bugfixes:

  • Fixed 'get all but X' didn't work like 'get all Xs but Y'
  • Fixed bug in MoveFloatingObjects which caused objects to disappear if one floating object had absent attribute.
  • Fixed dropping objects when on a supporter bug
  • Fixed InScope bug and added test files to verify that it is working.
  • The parser can now correctly handle input like 'get all but ' . Regression test added to getallfrom.inf to check this and similar patterns.

v1.6

19 Sep 11:32
Compare
Choose a tag to compare

Changes in functionality:

  • Changed unknown verb response to make reply clearer
  • Removed testlights.inf and nada.inf since they were more confusing than useful.
  • Fake action ##Going is now sent to destination room's before routine just before the player enters.
  • Improved disambiguation for plurals to make "get all red" work
  • Now allowing more than one word inputs in disambiguation
  • Changed disambiguation prompt
  • If bag is in box which is on table, and player is on table and types ENTER BAG, (s)he now gets "You have to enter the box first." instead of "You have to leave the table first."
  • Added a "howto" directory, for small games demonstrating how to do implement various clever objects and behaviours.
  • Added a howto-game with an object which has an initial description and shows its own contents both in room descriptions and when being examined.
  • Changed so LibraryMessages can only replace messages which the game has declared constants for, and it has to replace them. This also means it doesn't matter what LibraryMessages returns.
  • Improved minimal.inf to be clearer on what goes where.

Optimizations:

  • Simplifed the parser by making use of the meta attribute of all debug verbs

Bugfixes:

  • GET ALL FROM [supporter] could make parser complain that the supporter isn't open.
  • GET ALL FROM [object] would not take anything unless the object was a static or scenery object.
  • Missing full stop in parser error message "I don't understand that sentence."
  • creature_object wasn't properly handled by the parser.
  • When add_to_scope held a list of objects, each object and all siblings were added to scope.
  • Now inp1/inp2 are updated in PerformAction
  • Fixed 'drop X' parsing bug when X present but not held.
  • Look now sets the action to ##Look when calling AfterRoutines, even if Look was called by the Go action or some other action.
  • There was code in scope.h which would not compile if DEBUG_SCOPE was defined but not DEBUG.
  • Fixed so DROP with a single object doesn't print the object name first, unless it's a plural or ALL which happens to yield a single object.
  • Made plurals trigger that object names are printed, so "TAKE BALLS" may print "red ball: Taken."
  • Fixed a noun parsing bug which typically made purloin not work at all if any room provided a sw_to property.
  • Made purloin safer by not allowing you to pick up yourself or something you're in.
  • GET ALL FROM BOX issued a ##Remove action for the first item and then a ##Take action for each of the remaining objects.
  • In DEBUG mode, parse_name might print something due to it being an alias for sw_to This is now printed to memory instead.
  • Held (GrabIfNotHeld) didn't check implicit take status properly.
  • Fixed an error where "drop books" when not holding any books still referred to the first book in scope
  • Fixed wn offset error in GetNextNoun which caused problems with plurals
  • Wrong word order in disambiguation caused parse_name to fail
  • Fixed error where multiinside silently ignored some inputs
  • Fixed: bad combinations of adjectives and nouns messed up disambiguation code
  • Fixed double error messages when auto-taking objects.
  • Fixed bug in Library of Horror which could give player more than max score.

v1.5

09 Aug 10:57
Compare
Choose a tag to compare

New feature, optimization and bugfix release

Changes in functionality:

  • Before including globals.h, the game can now define the constant INITIAL_LOCATION_VALUE and set it to the object where the player should start. This makes sure location is set right when the game starts, so interpreters that display a statusline immediately (like the Gameboy interpreter) don't run into problems. If the game defines this constant, there is no need to set the location in the Initialise routine.
  • Printing the game banner has been moved to a routine named Banner(), just like in I6 lib.
  • A game can now make the library skip the game banner when the game starts, by returning 2 from Initialise(), just like in I6 lib.
  • with_key can now be a routine. The object which is currently being tested as key is held in second. with_key returns an object id, or false if nothing fits.

Optimizations:

  • Skipped compilation of code to automatically put things in sack object if SACK_OBJECT has not been defined.
  • Optimized check for correct key in Lock and Unlock.
  • Slight optimization in Look.

Bugfixes:

  • An extra newline was printed in Look if the player was in/on an object which didn't provide an inside_description.
  • A newline was missing in Look when a room description was not printed (when brief or superbrief lookmode was enabled).
  • The statusline showed the real location in z3, when the player was in darkness.
  • Run AfterRoutines() after taking inventory and it's not empty, just like I6 lib.
  • Changed so location.after() is printed if debug verb "routines" has been entered, regardless of whether location provides such a routine.
  • Fixed bug: Insert and PutOn checked the capacity of the object inserted rather than the container/supporter.
  • Made many library messages safer, in that they will work even if adding new grammar which use a different verb word. This also made the code smaller.

v1.4

02 Aug 13:14
Compare
Choose a tag to compare

New features, optimization and bug fix release

Changes in functionality:

  • Changed synonym 'yourself' for player to 'self', to harmonize with I6 lib, and because it makes sense.
  • Improved parsing of delimiters between direction commands.
  • Faster direction matches which appeared in v1.3 breaks old Infocom interpreters, due to lack of support for printing to memory. Changed implementation to not break. It is also smaller, but it gets less easy to change direction words.
  • Changed grammar of 'get' to match I6 lib. "get on object" and "get out of object" now work.
  • Added global receive_action to let receiving object know which action is happening.
  • Made _PrintContents() public, thus changing the name to PrintContents(). Changed the use of workflag to only print objects which have workflag set, just like WriteListFrom in I6 lib. Changed so initial string can be set to 0.
  • Changed so the invent property is consulted whenever a list of objects is presented by PrintContents, most notably also affecting object listings in room descriptions.
  • Added calls to object parent's before and after rules (if container or supporter) with LetGo action when taking object.
  • Changed so debug verb 'routines' prints calls to before routines and after routines even if object doesn't provide them.
  • Added printing to calls to before and after rules for fake actions Receiver and LetGo for when debug verb 'routines' has been entered.
  • A game programmer can check the version of PunyInform being used by looking at the values of constants PUNYINFORM_MAJOR_VERSION and PUNYINFORM_MINOR_VERSION.

Optimizations:

  • Optimized to skip parser phase 2 when possible for speed gains
  • Updated Library of Horror to use the new constant DIRECTION_COUNT.
  • Stop checking ObjectIsInvisible() for every object during parsing, since it's slow and shouldn't be necessary.
  • Smaller, faster code in PrintVerb.
  • _FindBarrier() was made shorter, and faster when set not to print.
  • Remove 'embrace' from PrintVerb when optional verbset is not enabled.
  • Changed a lot of checks in action routines from if(AfterRoutines() == 1) to just if(AfterRoutines()) and from if(keep_silent == 1) to if(keep_silent) to save 30 bytes.

Bugfixes:

  • "take obj" bug when already held has been fixed.
  • the pattern score was wrong when 'all' was used to match a multi token.
  • Fixed that PutOnSub didn't call before- or after-rules for Receiver, and that InsertSub didn't call before-rule for receiver.
  • Fixed bug in Search message.
  • Added checks to see if objects can be touched to many action routines.
  • Added call to AfterRoutines in WearSub.
  • Fixed TryToTakeNoun() so it clears concealed attribute when an object is picked up.