Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-14-2003, 07:58 PM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Question showimg error?

NPC Code:

function InitializeImageArrays()
{
this.imageCount = 3; // Change this accordingly
setarray this.imageShow, this.imageCount; // 1 = auto show, 0 = no auto show
setarray this.imageIndex, this.imageCount;
setarray this.imagePosX, this.imageCount;
setarray this.imagePosY, this.imageCount;
setarray this.imageStartX, this.imageCount;
setarray this.imageStaryY, this.imageCount;
setarray this.imageWidth, this.imageCount;
setarray this.imageHeight, this.imageCount;
setarray this.imageLayer, this.imageCount;

// The main image
this.imageShow[0] = 1;
this.imageIndex[0] = 1;
this.imagePosX[0] = 0;
this.imagePosY[0] = screenheight - 118;
this.imageStartX[0] = 0;
this.imageStartY[0] = 71;
this.imageWidth[0] = 487;
this.imageHeight[0] = 118;
this.imageLayer[0] = 5;

// The HP bar
this.imageShow[1] = 1;
this.imageIndex[1] = 2;
this.imagePosX[1] = 15;
this.imagePosY[1] = screenheight - 72;
this.imageStartX[1] = 10;
this.imageStartY[1] = 29;
this.imageWidth[1] = 5;
this.imageHeight[1] = 27;
this.imageLayer[1] = 4;
}

function ShowImages()
{
for ( i = 0; i != this.imageCount; i++ )
{
if (this.imageShow[i] == 1)
{
showimg this.imageIndex[i], gui1.gif, this.imagePosX[i], this.imagePosY[i];
changeimgpart this.imageIndex[i], this.imageStartX[i], this.imageStartY[i], this.imageWidth[i], this.imageHeight[i];
changeimgvis this.imageIndex[i], this.imageLayer[i];
}
}
}



Does anyone know why this wont work? Both of there function are called when the npc gets created. The InitializeImageArrays function is called first. Then the ShowImages function.

I I set the imageCount to 1 then it doesnt cause an error, but then that defeats the whole purpose of what I am trying to do.

If it is an error in my script I just can't see what it is. What I believe is it is an error with the showimg command placed in a 'for loop'. I am just not sure so if anyone who knows what the problem is would post an answer I would greatly appreciate it.
__________________
new account: Trevor
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.