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 01-07-2010, 03:39 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
GANI scripts in attributes; updating

I'm having trouble with GANI scripts used in player attributes to show an HP bar. It works for the first display, but then doesn't always update.

This is the code (serverside):

PHP Code:
this.attr[3] = "era_hpbar.gani," @ (this.health this.initialHealth); 
and this is the GANI script:

PHP Code:
SCRIPT
function onCreated() {
  
showBar(params[0]);
}

function 
onPlayerEnters() {
  
onCreated();
}

function 
showBar(percent) {
  
with (findimg(200)) {
    
image "erai_hpbar.png";
    
    
this.0.25;
    
this.1.5;
    
layer 1;
    
    
attachtoowner true;
  }
  
  
changeImgPart(200004111);
  
  
with (findimg(201)) {
    
image "erai_hpbar.png";
    
    
this.0.25;
    
this.1.5;
    
    
layer 2;
    
    
attachtoowner true;
  }
  
  
changeImgPart(201012max(141 percent), 11);
}
SCRIPTEND 
The bar will always show correctly if I try to display it when the bar isn't already showing, but if it is already showing, it won't update.
__________________
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:02 PM.


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