New in v1.07: Scenario Attachments (a.k.a. auto-bundling)

February 16, 2015 · Posted in Command 

prod_icon256Ever since Command’s initial release, the players have been asking us for an automated, reasonably idiot-proof way of bundling various content items (primarily map overlays but also other types) together with their scenarios and have them referenced correctly regardless of the scen file’s actual location.

Scenario Attachments, a.k.a. auto-bundling, is our response to this request. It is one of the flagship new features of the v1.07 update.

Scenario attachments are “things” (anything from a single file to a massive directory tree) that you can provide as attachments to a scenario (similar to attaching a file to an email message) and then use them via a new Lua command “ScenEdit_UseAttachment”. What exactly happens when you use them obviously depends on the attachment type. When a scenario packaged with attachments is loaded, its attachments are transparently copied to the local repository and can then be re-used on any other scenario (much like .inst files). The use of a single-point repository solves the “I moved my scen file around and now it cannot find its attachments” problem (this may be familiar to anyone who moves saved web pages around in the file system without their accompanied images etc.).

Here is a concrete example:

a) Author-A constructs a scenario and wishes to enrich it with imagery of an area. From the “Editor” menu, he selects “Scenario Attachments”. This brings up a window listing the attachments currently associated with the scenario:

Here we see we can construct a new attachment, use an existing one or modify (rename/delete) any already on the repository. Clicking on the “Create new of type: […]” will prompt us to locate the source material for the attachment, in this case a geo-referenced image file (map overlay). Clicking on “use existing” brings up another window which lists all attachments already available on the local repository:

Selecting the desired attachment and clicking on “Use selected” will add the attachment to the scenario.

We can then select, from the “Editor” menu, the command “Package scenario for distribution”. A file-dialog will pop up to prompt us for where to save the packaged scenario file. The “packaging” is essentially the process of properly bundling the scenario with the selected attachments on a single zip file, so that they can be correctly identified and loaded (automatically) by end users.

Author-A then distributes the bundled scenario as usual. User-A unzips the bundle file to “\Scenarios” (or anywhere else) and loads up the scenario. Under the hood, the program sees the unzipped “attachments” folder side-by-side with the scenario file and automatically copies the attachments (each one on its dedicated folder, uniquely identified with a GUID) to the user’s local repository.

To use a referenced attachment, you can use the new Lua command “ScenEdit_UseAttachment”, which accepts either an attachment’s name or its GUID. So in this case, by bundling an image overlay to a scenario and creating an “on scen load” event that triggers its use, we can display map-overlay images to the end user without any manual action of his own.

Of course this infrastructure is meant to eventually exploit multiple attachment types, ranging from media files (audio, video etc.) to pre-fab Lua scripts, arbitrary text or binary files etc.

Comments

Leave a Reply

You must be logged in to post a comment.