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 05-14-2008, 06:49 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Keeping track of images...

I'm using a 'progressive indexing' sort of image display for my GUI. Basically, I've created custom functions for displaying images, and create an index var that increases every time it's called. This lets me easily show images without having to worrying about placing a free index on it.

Pseudo-code:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
imgid=200;
  for (
i=0;i<player.fullhearts;i++) imgshow(crap);
}
function 
imgshow(paramstuff) {
  
showimg(imgid,imgcrap);
  
imgid++;

Would display images for each of the player hearts. Problem is, because it is a HUD, it is displaying a lot of dynamic statistics. Hearts lower, rupees decline and so on. This creates a problem I have with if, say, my player hearts lower, the hearts don't disappear because I haven't hidden them. Because I am using a system where images won't always have the same index, I'm having a hard time figuring out how to hide images that are no longer needed.

Any idea how to fix this? I figure I'm going to have to find a way to compare the last number of images being displayed with the next amount of images to be displayed, but I'm having a problem figuring out how to do that because the only way to do that would be to 'predict' how many images are going to be displayed next.
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 07:37 PM.


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