Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-10-2011, 03:50 PM
AlexanderK AlexanderK is offline
Registered User
AlexanderK's Avatar
Join Date: Mar 2006
Location: Germany
Posts: 79
AlexanderK is on a distinguished road
Send a message via MSN to AlexanderK
Showimg HUD, possible V6 beta bug?

I just downloaded the new V6 beta and my hud is messed up.
This is my script:
PHP Code:
//FULLHEARTS

  
if (!this.heartsfirstdisplayed || this.maxhearts != clientr.maxhearts) {
    
hideimgs(11001299);
    for (
0clientr.maxheartsi++) {
      
showimg(1100 i"sorna_hud_heart_background.png"64 110 18 i12);
      
changeimgvis(1100 i5);

      
showimg(1200 i"sorna_hud_heart.png"64 110 18 112);
      
changeimgvis(1200 i5);
    }
    
this.maxhearts clientr.maxhearts;
    
this.hearts clientr.maxhearts 1;
    
this.heartsfirstdisplayed true;
  }

  
//HEARTS

  
if (this.hearts != clientr.hearts) {
    for (
0;clientr.maxheartsi++) {
      if (
clientr.hearts i) {
        
findimg(1200 i).image "sorna_hud_heart.png";
        
findimg(1200 i).alpha 1;
        if (
clientr.hearts 1)
          switch (
clientr.hearts 1) {
            case 
0:
              
findimg(1200 i).image "sorna_hud_heart.png";
              break;
            case 
0.25:
              
findimg(1200 i).image "sorna_hud_heart_quarter.png";
              break;
            case 
0.5:
              
findimg(1200 i).image "sorna_hud_heart_half.png";
              break;
            case 
0.75:
              
findimg(1200 i).image "sorna_hud_heart_threequarters.png";
              break;
          }

      } else {
        
findimg(1200 i).alpha 0;
      }
    }
    
this.hearts clientr.hearts;
  } 
There are always some extra hearts displayed next to the actual hearts and I have no idea why. On V5 it works fine and I think it did on the last beta too.

Also somehow my ALT+2 is messed up and everything is blue. :/
Attached Thumbnails
Click image for larger version

Name:	graal_1299763755.png
Views:	306
Size:	36.6 KB
ID:	52524  
Reply With Quote
  #2  
Old 03-10-2011, 10:48 PM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Smurf Server? o.o
__________________

Reply With Quote
  #3  
Old 03-10-2011, 11:17 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Why are you using images over index 1000? Over 200 is clientside anyway
__________________
Reply With Quote
  #4  
Old 03-10-2011, 11:29 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
I remember that setting the alpha of showimgs to zero is not necessary making it hide, but it was the same in v5.
Reply With Quote
  #5  
Old 03-11-2011, 12:17 AM
AlexanderK AlexanderK is offline
Registered User
AlexanderK's Avatar
Join Date: Mar 2006
Location: Germany
Posts: 79
AlexanderK is on a distinguished road
Send a message via MSN to AlexanderK
Quote:
Originally Posted by oo_jazz_oo View Post
Smurf Server? o.o
See my original post:
Quote:
Originally Posted by AlexanderK View Post
Also somehow my ALT+2 is messed up and everything is blue. :/
This is the possible V6 bug I mention in the title. The colors of screenshots I make with ALT+2 are messed up.
Quote:
Originally Posted by xAndrewx View Post
Why are you using images over index 1000? Over 200 is clientside anyway
I just picked the indexes at random, but that doesn't cause the problem, I just temporaryly replaced them and it was still the same.

Quote:
Originally Posted by Stefan View Post
I remember that setting the alpha of showimgs to zero is not necessary making it hide, but it was the same in v5.
I just replaced the alpha-part with hideimg and showimg and it still doesn't work.




I still don't understand this at all. It works fine for me in V5, it worked fine for me in the last beta.
Displaying mana uses the exact same script, only a little lower, with higher indexes and different variables and images and it works fine too.

It just doesn't make sense that there are 3 extra images displayed.
If I put hideimgs(1200,1202); behind the code I posted above, all the heart images disappear, so it seems like the extra images are somehow displayed within the showimgs? I don't get it.
Reply With Quote
  #6  
Old 03-11-2011, 12:24 AM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by AlexanderK View Post
It just doesn't make sense that there are 3 extra images displayed.
If I put hideimgs(1200,1202); behind the code I posted above, all the heart images disappear, so it seems like the extra images are somehow displayed within the showimgs? I don't get it.

i think of it like this, hideimgs(from, to);

so, if i had showimg's at 200, 201, 203, 204, putting (201,203) would hide the index'es 201, 202 and 203
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #7  
Old 03-11-2011, 12:59 AM
AlexanderK AlexanderK is offline
Registered User
AlexanderK's Avatar
Join Date: Mar 2006
Location: Germany
Posts: 79
AlexanderK is on a distinguished road
Send a message via MSN to AlexanderK
Quote:
Originally Posted by Deas_Voice View Post
i think of it like this, hideimgs(from, to);

so, if i had showimg's at 200, 201, 203, 204, putting (201,203) would hide the index'es 201, 202 and 203
I know that. And I'm not confused about hideimgs(). I only mentioned that here to emphasise my problem.
The images I want displayed have the indexes 1200,1201,1202. But somehow, within these TShowImgs are 3 extra images that shouldn't be there. Check the attachment in my original post, next to the three heart images in the hud, that are supposed to be there, there are 3 extra ones.

It's frustrating how none of the posts in this thread seem to respond to my problem.
Reply With Quote
  #8  
Old 03-11-2011, 03:34 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Well I checked the server (I´m running v5) and also have the same with the extra hearts, but at mine everything got the original color (no blue effect). So I don´t think the problem is on v6 with the hearts.
Reply With Quote
  #9  
Old 03-11-2011, 04:27 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
I would try using a variable other than "this.hearts" it may be getting messed around with by the engine.

Try this:

PHP Code:
//#CLIENTSIDE

function drawHearts() {
  if (
clientr.maxhearts != this.lastmaxhearts) {
    
hideimgs(11001230);
    for (
temp.0temp.clientr.maxheartstemp.i++) {
      
with (findimg(1100 temp.i)) {
        
64 110 18 temp.1;
        
12;
        
layer 5;
        
image "sorna_hud_heart_background.png";
      }
    }
    
this.lastmaxhearts clientr.maxhearts;
    
updateHearts(true);
  } else {
    
updateHearts();
  } 
}

function 
updateHearts(force) {
  if (
clientr.hearts != this.lasthearts || force) {
    
hideimgs(12001230);
    for (
temp.0temp.clientr.heartstemp.i++) {
      if ((
temp.i+1) > clientr.hearts) {
        
temp.heartpart temp.1;
      } else {
        
temp.heartpart 0;
      }
      
with (findimg(1200 temp.i)) {
        
64 110 18 temp.1;
        
12;
        
layer 6;
        switch (
temp.heartpart) {
          case    
0image "sorna_hud_heart.png"; break;
          case 
0.25image "sorna_hud_heart_quarter.png"; break;
          case 
0.50image "sorna_hud_heart_half.png"; break;
          case 
0.75image "sorna_hud_heart_threequarters.png"; break;
        }
      }
    }
    
this.lasthearts clientr.hearts;
  }  

__________________
Quote:

Last edited by fowlplay4; 03-11-2011 at 04:37 AM..
Reply With Quote
  #10  
Old 03-11-2011, 11:25 AM
AlexanderK AlexanderK is offline
Registered User
AlexanderK's Avatar
Join Date: Mar 2006
Location: Germany
Posts: 79
AlexanderK is on a distinguished road
Send a message via MSN to AlexanderK
It's working now, thanks!
Reply With Quote
Reply


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 10:00 AM.


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