Modifying the User Interface: Difference between revisions

From FreeAllegiance Wiki
Jump to navigationJump to search
Line 8: Line 8:
* the game engine calls and interprets the text-mdl files, and some image-mdl files.
* the game engine calls and interprets the text-mdl files, and some image-mdl files.
* the text-mdl files contain formatting, behaviour and placement instructions for the images and text.
* the text-mdl files contain formatting, behaviour and placement instructions for the images and text.
* Images can be in the form of image-mdls, which are basically bitmaps wrapped in some code, or PNG files (and [http://freeimage.sourceforge.net/features.html many more formates]).
* Images can be in the form of image-mdls, which are basically bitmaps wrapped in some code, or PNG files (and [http://freeimage.sourceforge.net/features.html many more formats]).


= The Game Engine =
= The Game Engine =

Revision as of 12:14, 22 April 2010

Edit.png
Stub This article is incomplete

This is an article about a topic that should be covered in more detail by the FreeAllegiance Wiki, but is lacking in content.

You can help by improving it!


introduction

Allegiance's User Interface can be modified to an extensive degree. Several Mods have been made, and more are in progress of being developed.

Allegiance User Interfaces are determined by three sources

  • the game engine calls and interprets the text-mdl files, and some image-mdl files.
  • the text-mdl files contain formatting, behaviour and placement instructions for the images and text.
  • Images can be in the form of image-mdls, which are basically bitmaps wrapped in some code, or PNG files (and many more formats).

The Game Engine

Understandably, not much can be altered here.

MDL

This is where modders spend most of their time. MDL is unfortunately both very limited as a language, and very particular about its grammar. To understand what it does, it's helpful to think of an MDL-file as a relatively easy way to feed the game engine layout instructions.

An mdl-file can't do anything on its own; it merely contains a variable that the game engine wants. A Modder gets to decide what that variable contains, but only up to a point.

Common MDL Instructions

Some instructions get used more than others. It makes sense to discuss some of those here. For a complete reference of the MDL language, see Ksero's MDL Language Documentation.

Color

ColorA

ImportImage

ImportImage("imagebmp", boolean) imports an imagebmp.mdl file from the Artwork folder to the current textmdl. This is a bitmap 'wrapped' in a MDL-header. Note that the file extension is left out in this call. This file must be in the Artwork folder. It's not certain what the boolean operator does.

Example: ImportImage("softgaugebmp", true)

ImportImage3D

ImportImage("image_mdl_bmp", [[#Color|Color(R,G,B)]],boolean) does largely the same as plain ImportImage, only with the addition of a Colorvalue. The imported image is 'painted' with this color. In the example below "white" is used instead of a Colorvalue. "White" is a color constant; a hardcoded variable.
Example: ImportImage3D("softteamcolorbmp", white, true)

ImportImageFromFile

ImportImageFromFile("folder/folder/imagefile.png", boolean) imports images in many formats, .png being a favorite for many reasons, not the least of which is good support for 8-bit alpha channels. Since the alpha channel determines the opacity of a given pixel, creating a smooth transition between a given image and your ship's surroundings is easy, provided the image in question has an alpha channel. Unlike older Allegiance artwork, transparency is not achieved through using a black background and have transparent bits fade to black. You create your image with transparency and a transparent background. You import it and the engine does the rest.
Example: ImportImageFromFile("mods/CortUI/media/cortui_fp1_target_shield_gauge.png", true)

Images

Creating or altering images is not difficult, given some experience with a decent graphics program.