Modifying the User Interface: Difference between revisions

From FreeAllegiance Wiki
Jump to navigationJump to search
(→‎introduction: link to FreeImage Project)
Line 14: Line 14:


= MDL =  
= MDL =  
This is where modders spend most of their time.  
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 [[MDL|Ksero's MDL Language Documentation]].
 
==== Color ====
 
==== ColorA ====
 
==== ImportImage ====
{{tt|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.<br>
 
Example: {{tt|ImportImage("softgaugebmp", true)}}
 
==== ImportImage3D ====
{{tt|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. <br>
Example: {{tt|ImportImage3D("softteamcolorbmp", white, true)}}
 
==== ImportImageFromFile ====
{{tt|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 as easy as:<br>
Example: {{tt|ImportImageFromFile("mods/CortUI/media/cortui_fp1_target_shield_gauge.png", true)}}


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

Revision as of 13:43, 19 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 formates).

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(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 as easy as:
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.