- Joined
- Apr 16, 2008
- Messages
- 10
- Reaction score
- 0
Here is an image generator script for you all to use. Its quite easy to setup, given your server has the GD image extension of php and can support PNG. Most setups of php come with it preinstalled.
This script is not an entire ranking script, it is the image generator only. It takes get data parameters, and some examples of what it outputs are below:
The background can be edited by the user. The defaults are white and black respectively. These are named bg and bg2 and are .PNG. Feel free to edit them, change the size etc and even add your own background.
All I ask is that you keep my copyright in the top of the script.
Installing the Script
This is very easy. Just extract the archive as it is to where you want the script to be (preferrably in the web root folder), and then you are ready to go! I packed all the neccessary files in there.
Customisation - Font
If you need to change the font for the script search for this line:
And this one:
And replace the aggstock2.ttf with the font file you want to use. Just make sure the font file is in the same place as the font. I'll make this easier in a newer revision by making a variable which has the font name in it instead of having to change each part manually.
Customisation - Font Colours
If you need to change the colours for the fonts, look for these lines and change them respectively for the BG they represent:
BG = 0
Change the values in the imageColorAllocate to the R/G/B values you need.
BG = 1
Change the values in the imageColorAllocate to the R/G/B values you need.
Using the Script
To use the script simply place an image tag in your page like so:
Now this looks like a mess, but I'll explain. The script is using GET data to make it suitable for any purpose. It isn't tied to a database so it is compatible with anything.
I'll break down each parameter below:
h=31526 - Hair ID
e=21604 - Eye ID
w=1702136 - Weapon ID
a=1002568 - Hat ID
c=1102096 - Cape ID
t=1042056 - Top/Overall ID
b=1061007 - Bottom ID
g=1082162 - Glove ID
s=1072186 - Shoes ID
acc=1032020 - Accessory 1 (Eye/Ear/Face) ID
acc2=0 - Accessory 2 (Eye/Ear/Face)
acc3=0 - Accessory 3 (Eye/Ear/Face)
n=Soph - Name
j=SuperGM - Job - This needs to be written like this. You can change the names yourself by renaming the job images respectively. GM cannot be changed unless you edit the script though.
bg=0 - Background image - 0 or 1 for the image to use.
There are also some things you can change, I'll quote the code below:
Note: The data folder location refers to the location with all the .nms files in it. These contain the offsets for the images. (The .txt files in there are for hair and are also required)
If there is anything I have forgotten to add in this, or you have any questions feel free to ask me.
~Soph
This script is not an entire ranking script, it is the image generator only. It takes get data parameters, and some examples of what it outputs are below:

The background can be edited by the user. The defaults are white and black respectively. These are named bg and bg2 and are .PNG. Feel free to edit them, change the size etc and even add your own background.
All I ask is that you keep my copyright in the top of the script.
To view the content, you need to sign in or register
Installing the Script
This is very easy. Just extract the archive as it is to where you want the script to be (preferrably in the web root folder), and then you are ready to go! I packed all the neccessary files in there.
Customisation - Font
If you need to change the font for the script search for this line:
Code:
imagefttext($image, 20, 0, 110 + $glox, 85 + $gloy, $c1,'aggstock2.ttf' , 'GM');
And this one:
Code:
// WRITE CHAR NAME
imagefttext($image, 20, 0, 75 + $glox, 55 + $gloy, $c1,'aggstock2.ttf' , $gj);
And replace the aggstock2.ttf with the font file you want to use. Just make sure the font file is in the same place as the font. I'll make this easier in a newer revision by making a variable which has the font name in it instead of having to change each part manually.
Customisation - Font Colours
If you need to change the colours for the fonts, look for these lines and change them respectively for the BG they represent:
BG = 0
Code:
if ($_GET['bg'] == '0') {
$im = imagecreatefrompng("images/bg.png");
$image = $im;
// TEXT COLOUR
$c1 = imageColorAllocate($image, 0, 0, 0);
Change the values in the imageColorAllocate to the R/G/B values you need.
BG = 1
Code:
} else {
$im = imagecreatefrompng("images/bg2.png");
$image = $im;
// TEXT COLOUR
$c1 = imageColorAllocate($image, 255, 255, 255);
}
Change the values in the imageColorAllocate to the R/G/B values you need.
Using the Script
To use the script simply place an image tag in your page like so:
Code:
<img src="char.php?h=31526&e=21604&w=1702136&a=1002568&c=1102096&t=1042056&b=1061007&g=1082162&s=1072186&acc=1032020&acc2=0&acc3=0&n=Soph&j=SuperGM&bg=0">
Now this looks like a mess, but I'll explain. The script is using GET data to make it suitable for any purpose. It isn't tied to a database so it is compatible with anything.
I'll break down each parameter below:
h=31526 - Hair ID
e=21604 - Eye ID
w=1702136 - Weapon ID
a=1002568 - Hat ID
c=1102096 - Cape ID
t=1042056 - Top/Overall ID
b=1061007 - Bottom ID
g=1082162 - Glove ID
s=1072186 - Shoes ID
acc=1032020 - Accessory 1 (Eye/Ear/Face) ID
acc2=0 - Accessory 2 (Eye/Ear/Face)
acc3=0 - Accessory 3 (Eye/Ear/Face)
n=Soph - Name
j=SuperGM - Job - This needs to be written like this. You can change the names yourself by renaming the job images respectively. GM cannot be changed unless you edit the script though.
bg=0 - Background image - 0 or 1 for the image to use.
There are also some things you can change, I'll quote the code below:
Code:
// DATA FOLDER LOCATION
$ddir = 'images/character/alldata/';
// IMAGE FOLDER LOCATION
$idir = 'images/character/images/';
// GLOBAL POSITIONING OFFSET
$glox = 10;
$gloy = 30;
Note: The data folder location refers to the location with all the .nms files in it. These contain the offsets for the images. (The .txt files in there are for hair and are also required)
If there is anything I have forgotten to add in this, or you have any questions feel free to ask me.
~Soph
Last edited: