How to Use AGIPAL

From AGI Wiki
Jump to navigationJump to search

Introduction

AGIPAL is a patch for AGI created by dark minister to change the palette in your game.

How To Create an AGI Palette with AGIPAL

Firstly, you must create a palette. This can be done using PCX2PAL, a DOS command line program.

Open a image editing program, (such as Paint Shop Pro) to create the image which PCX2PAL will extract the palette from. It doesn't matter what the image looks like, all that matters is that it is a 256 color PCX image and that the first 16 colors of it's palette are the ones that you want to use. Paint Shop Pro has a great palette editing feature which is very simple to use.

When you have created that palette, go to DOS and then to the directory which PCX2PAL is located. Once in the directory, type 'PCX2PAL [PCXFILE] [PALETTEFILE]' and press 'enter'. As an example, if I had a PCX file called image.pcx and wanted to create a palette file called pal.101, I would do the following:

C:\>cd pcx2pal [Enter] C:\>pcx2pal image.pcx pal.101 [Enter]

To create the palette more easily, you can also use PCX2PAL for Win95 also available on the AGI Utilities page.

And now the palette is done! How To Use The Picture In Your Game

Once the palette is created, using AGI PAL is very easy. The different palette is loaded into the your game with the command "shake.screen( )" and up to ten different palettes can be used. Each palette should be named "pal.100" to "pal.109".

For example, to load PAL.101 you would type the following:

shake.screen(101);

Just as a note, don't worry, "shake.screen( )" remains operational for any value other than 100 to 109!

To see a full example of the usage of AGI PAL in the logic:

Code:

<syntaxhighlight lang="agi">


// **************************************************************************** // // AGI PAL Example // // ****************************************************************************

  1. include "defines.txt"

if (new_room) {

 load.pic(room_no);
 draw.pic(room_no);
 discard.pic(room_no);
 set.horizon(50);
 status.line.off();
 prevent.input();
 program.control();
 shake.screen(101); 
 show.pic();
 display(23,1,"         Intro/Opening screen");

}

if (have.key()) {

 set(menu_enabled);
 clear.lines(22, 24, 0);
 stop.motion(ego);
 reset(disable_game_functions);
 new.room(2);

}

return(); </syntaxhighlight>