adventuregamestudio / ags

AGS editor and engine source code
Other
707 stars 159 forks source link

AGS 4: support room templates in AGS 4 format #2562

Open ivan-mogilko opened 3 weeks ago

ivan-mogilko commented 3 weeks ago

In AGS 4 branch Editor still creates and unpacks room templates using old pre-AGS 4 logic, where it would pack just 2 files: roomN.crm and roomN.asc, presumable from the project's root directory.

This has to be rewritten in AGS 4.

  1. Template includes all files found in a directory, but packs them without directory path (we do not need room template to include "Room/N/" structure).
  2. There has to be an indication that the template has a AGS 3 or AGS 4 format. Either use presence of "crm" file, or metadata, or both.
  3. When unpacking a AGS 3 template, use "ConvertRoomFromCrmToOpenFormat" method.
  4. When unpacking a AGS 4 template, simply unpack the template files into the corresponding subdirectory.

NOTE: I tag this as a bug, because "Create a template from room" command does not do an expected thing, and also relies on a presence of a compiled room file, which is not guaranteed in AGS 4.