Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-01-2011, 05:01 AM
PhilSmith PhilSmith is offline
Workin' on It
PhilSmith's Avatar
Join Date: Mar 2011
Location: Chicago
Posts: 38
PhilSmith is on a distinguished road
TShowImg ?

I'm working with an hud system and I'm trying to display the health via hearts (similar to what the normal hud has). My problem is, is that I'm having trouble getting the hearts to show and/or reset when you get hit. I suspect it is the way I am calling the image. I have done a little research and am trying to look into using TShowImg, however, I can't seem to find examples of how to use it. I don't know if it is similar to calling a GUI or calling showimg() or something completely different. I don't want someone to post what MY script should look like, rather an example on how to use TShowImg, and, if I have more questions, we'll go from there. Thx!
__________________
Nothing to say...
Reply With Quote
  #2  
Old 04-01-2011, 05:33 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
It's an internal data-type used by Graal.

I'm fairly sure showimg/findimg objects and GuiShowImgCtrl() inherit it's functionality.

Go GUI if you want the additional functionality of GuiControl, otherwise showimg/findimg will work perfectly fine.
__________________
Quote:
Reply With Quote
  #3  
Old 04-01-2011, 06:32 AM
PhilSmith PhilSmith is offline
Workin' on It
PhilSmith's Avatar
Join Date: Mar 2011
Location: Chicago
Posts: 38
PhilSmith is on a distinguished road
Ive been trying to work with GUI's but I can't get them to update in a timeout.

PHP Code:
function onTimeout(){
  for(
temp.i=0;temp.i<player.heartstemp.i++){
    new 
GUIShowImgControl("PhilSmith_Hearts_"@i){
      
//set the hearts and stuff
    
}
  }
  
setTimer(.05);

Would this work? Is it possible, given the correct values, that the script would just "delete"(not show) an image? Just wondering if you can edit a GUIShowImg() by setting new values to the same name.
__________________
Nothing to say...
Reply With Quote
  #4  
Old 04-01-2011, 06:49 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
The thing about GUIs is that you create them first, then update/edit them later. I.e:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
createGUI();
  
setTimer(0.05);
}

function 
createGUI() {
  for (
temp.0temp.player.fullheartstemp.i++) {
    new 
GuiShowImgCtrl("GUIHearts_" temp.i) {
      
// hearts and stuff
    
}
  }
  
this.lastfullhearts player.fullhearts;
}

function 
onTimeout() {
  
// Check for change in full hearts
  
if (this.lastfullhearts != player.fullhearts) {
    
// Re-create GUI
    
createGUI();
  }
  
// Update hearts
  
for (temp.0temp.player.fullheartstemp.i++) {
    
// Toggle Heart Visibility
    
(@"GUIHearts_" temp.i).visible = (player.hearts >= temp.i);
  }
  
setTimer(0.05);

__________________
Quote:

Last edited by fowlplay4; 04-01-2011 at 07:11 AM..
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 01:01 AM.


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