Difference between revisions of "LGR: SWE"

From Elma Wiki
Jump to navigation Jump to search
Line 28: Line 28:
 
Bilderna som krävs i LGR-filen börjar på bokstaven Q. På så sätt kan du enkel hitta dessa filer i en alfabetisk lista. Du måste ha samtliga dessa pcx-filer för att kunna skapa en LGR-fil.
 
Bilderna som krävs i LGR-filen börjar på bokstaven Q. På så sätt kan du enkel hitta dessa filer i en alfabetisk lista. Du måste ha samtliga dessa pcx-filer för att kunna skapa en LGR-fil.
  
=== Animations ===
+
=== Animationer ===
The apple, killer and flower objects are animations. In the LGR file they are represented by single pictures that contain all the frames of one animation. The QEXIT.PCX file is for example 50 copies of 40x40 pixels frames put together horizontally making one 2000x40 pixels image. It is up to you how many frames you put into an animation picture, but it must be 40 pixels tall and 40*N pixels wide. If you set the 'Animated Objects' off in the options menu in Elma, the first frame will be visible all the time instead of the animation.
+
Äpplet, "killer" och blomme-objekten är animationer. I LGR-filen representeras de av enskilda bilder som innehåller samtliga frames för en animation. QEXIT.PCX filen är till exempel 50 kopior av 40x40 pixlar stora frames horisontellt ihopsatta till en 2000x40 pixel bild. Det är upp till dig hur många frames du sätter in i en animationsbild, men den måste vara 40 pixlar hög och 40*N pixlar bred. Om du väljer att stänga av 'Animated Objects' i menyn Options i Elma, kommer den första framen synas hela tiden istället för animationen.
  
There is one animation for the flower object and one for the killer object in an LGR file (QEXIT.PCX and QKILLER.PCX). But there may be multiple apple animations. You must add at least one apple animation to the LGR file, the QFOOD1.PCX picture, but optionally you can add a QFOOD2.PCX, ..., QFOOD9.PCX picture into your LGR file too if you want.
+
Det finns en animation för blommeobjektet och en för "killer"-objektet i en LGR-fil (QEXIT.PCX och QKILLER.PCX), men det kan finnas flera äppel-animationer. Det måste finnas åtminstone en äppelanimation i LGR-filen, bilden QFOOD1.PCX, men du kan även lägga till bilderna QFOOD2.PCX, ..., QFOOD9.PCX i din LGR-fil om du vill.
  
The game will stop loading the sequence of these pictures if one is missing (so if you have QFOOD1,2,3,4 and 6, only the first 4 will be loaded).
+
Spelet kommer sluta ladda bildsekvensen om en bild saknas (så om du har QFOOD1,2,3,4 och 6, kommer bara de första 4 att laddas).
  
If you set the 'Food anim number' property of an apple object (by right clicking on it in the level editor) to 5 for example, the game will try to play the animation from the QFOOD5.PCX picture for this object. If this picture is not loaded, it will be substituted. You need to list the names of these food objects in pictures.lst (but not the exit and killer objects).
+
Om du ställer in 'Food anim number' egenskapen för ett äppelobjekt (genom att högerklicka på det i baneditorn) till t.ex. 5, kommet spelet försöka spela upp animationen i QFOOD5.PCX bilden. Om den bilden inte ärr laddad byts den ut. Du måste lista namnen på dessa äppleobjekt i pictures.lst (men inte blomme- och "killer" objekten).
  
 
=== Grass pictures ===
 
=== Grass pictures ===

Revision as of 08:50, 25 July 2010

Introduktion

LGRs är grafiksamlingarna som bestämmer hur Elma ser ut. Ingen vet exat vad förkortningen "LGR" står för. Kanske är det "Level GRaphics" eller "Level Graphics Resources".

En LGR fil innehåller bilder, både för objekt som motorcykeln och blomman, men även de rent dekorativa, som träden i original-LGR:en. Det finns också texturer och masker i en LGR. En mask definierar vilken yta en textur ska appliceras på.

Att välja LGRs

När du gör en banakan du använda level properties inställningen för att sätta vilken LGR som ska användas. Om den angivna LGR:en fattas, kommen original-LGR:en att användas i stället. Du kan välja en LGR mer permanent genom att ersätta den ursprungliga Default.lgr med en annan LGR fil som döpts om till default.lgr.

LGR Development Kit

Utvecklingskitet LGR DK är ett antal program och andra komponenter du kan använda för att skapa dina egna LGR:er.

make_lgr.exe programmet

Make_lgr.exe är ett program utan interface som plockar ihop pcx filer och bygger en LGR-fil som kan användas i Elma. För att make_lgr.exe ska veta vilka pcx-filer som ska stoppas in i LGR-filen, måste du lista namnen på pcx-filerna och lite annan information i en fil som heter pictures.lst.

LGR-filen måste innehålla vissa pcx-filer. Till exempel så måste cykelbilderna, cyklistens händer och fötter, bilderna på äpplet och några andra bilder finnas. Du behöver bara lista de nya bildfiler du vill lägga till i pictures.lst

Innan du kan skapa en LGR med programmet make_lgr.exe, måste du lägga alla pcx-filer i en mapp tillsammans med filen pictures.lst. Pcx-filerna skall vara i 8-bitar och ha en gemensam global palett. (LGR DK:t innehåller även verktyg för att konvertera true color-bilder till 8-bits pcx-bilder med gemensam palett.)

pictures.lst filen

I pictures.lst filen innehåller varje rad en beskrivning av en pcx-fil. Den första delen av raden är filnamnet utan tillägg. Nästa del a raden är den typ av bild det är; PICT, TEXT eller MASK.

Om typen är PICT, kommer bilden bli en vanlig bild där pixeln i övre vänstra hörnet bestämmer den genomskinliga färgen. Om typen är TEXT är det en textur, och om typen är MASK är det en mask. (Masker och texturer kan endast användas tillsammans). Okm typen inte är är MASK måste du även ange ett stanradavstånd och klippningsegenskap.

Avståndet måste vara mellan 1-999, medan klippningsegenskapen måste vara antingen 'U', 'S', eller 'G'. Motorcyklisten och äpplet, utgången och "killer" objekten ligger på avståndet 500.

Klippningsegenskap avgör om en bild syns ovanpå himlen, marken eller båda. (Detta gäller oberoenda av avstånd.) Så 'U' (Unclipped) innebär att bilden kommer synas ovanpå allt annat (såvida inte andra bilder döljer den). 'S' (Sky) innebär att bilden endast kommer ses på himlen (bakgrunden). 'G' (Ground)innebär att bilden endast kommer att ses ovnpå marken (förgrunden).

Bilderna som krävs i LGR-filen börjar på bokstaven Q. På så sätt kan du enkel hitta dessa filer i en alfabetisk lista. Du måste ha samtliga dessa pcx-filer för att kunna skapa en LGR-fil.

Animationer

Äpplet, "killer" och blomme-objekten är animationer. I LGR-filen representeras de av enskilda bilder som innehåller samtliga frames för en animation. QEXIT.PCX filen är till exempel 50 kopior av 40x40 pixlar stora frames horisontellt ihopsatta till en 2000x40 pixel bild. Det är upp till dig hur många frames du sätter in i en animationsbild, men den måste vara 40 pixlar hög och 40*N pixlar bred. Om du väljer att stänga av 'Animated Objects' i menyn Options i Elma, kommer den första framen synas hela tiden istället för animationen.

Det finns en animation för blommeobjektet och en för "killer"-objektet i en LGR-fil (QEXIT.PCX och QKILLER.PCX), men det kan finnas flera äppel-animationer. Det måste finnas åtminstone en äppelanimation i LGR-filen, bilden QFOOD1.PCX, men du kan även lägga till bilderna QFOOD2.PCX, ..., QFOOD9.PCX i din LGR-fil om du vill.

Spelet kommer sluta ladda bildsekvensen om en bild saknas (så om du har QFOOD1,2,3,4 och 6, kommer bara de första 4 att laddas).

Om du ställer in 'Food anim number' egenskapen för ett äppelobjekt (genom att högerklicka på det i baneditorn) till t.ex. 5, kommet spelet försöka spela upp animationen i QFOOD5.PCX bilden. Om den bilden inte ärr laddad byts den ut. Du måste lista namnen på dessa äppleobjekt i pictures.lst (men inte blomme- och "killer" objekten).

Grass pictures

When the program displays grass on a level, it builds it up from a texture that is stored in QGRASS.PCX, and from little grass pictures that makes the lower border of the grass. The names of these little border pictures are in the form of QUP_*.PCX and QDOWN_*.PCX. That means QUP_AA.PCX for example will be a grass picture automatically, but you need to list it in the pictures.lst file along with the QGRASS.PCX picture. (It doesn't matter what properties you give to these pictures.) If the picture is an 'UP' picture, the grass should be higher on the right side of the picture than on the left (the opposite for the 'DOWN').

If you do not list the QGRASS.PCX picture and at least two QUP_*.PCX or QDOWN_*.PCX pictures in the pictures.lst file, there will be no grass on the levels you play with this lgr file.

Default Sky and ground textures

If there is a SKY.PCX texture in an lgr file, it will be the default Sky. Similarly if there is a GROUND.PCX texture in an lgr file, it will be the default ground.

The LGRLIST.TXT file

If you don't want to replace the original default lgr file for all levels, just create an lgrlist.txt file:

Let's say you make your own file, called myfile.lgr, and you copy it to the Lgr subdirectory. Also, you create a file in the lgr subdirectory called lgrlist.txt, which has the following lines:

  • 5 myfile.lgr
  • 6 myfile.lgr
  • 8 myfile.lgr

In this case if you play on internal level 5, 6 and 8, your lgr file will be loaded.

Converting truecolor to 8-bit color

You can work with 8-bit color images in your paint program. But you may want to work with truecolor pictures in your paint program and then convert your pictures to 8-bit colors before building the LGR file.

To do this you can use the two programs included in the LGR DK, MERGEPIC.EXE and APARTPIC.EXE.

The MERGEPIC.EXE program takes the small truecolor Targa (.TGA) images from the current directory and creates a big picture named TMP.TGA which will contain the small Targa images. You have to convert this big truecolor image to an indexed colored image on your own (most paint programs can do this).

The APARTPIC.EXE takes the big TMP.PCX image and divides it into small PCX images.

These programs get the list of the image files they must manipulate in the same way as MAKE_LGR.EXE. They process the images listed in the pictures.lst file and in addition all fixed named images.

The two programs won't process the MASK images however (in the pictures.lst file they are listed as MASK). These pictures are used only for masking shapes in the game and it doesn't matter what color palette they have. So you can convert them individually to indexed colors (they need to have exactly 256 colors in their palette however).

Important: Turn off dithering when converting the TMP.TGA image to the TMP.PCX image.