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 08-29-2006, 05:52 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
ShowText/Showpoly in joined classes

Hello, I'm trying to use showtext and showpoly from the class and it just wont work.

The class has //#CLIENTSIDE at the top so I assumed it would work and it's being joined to a clientside object. The error I get in the F2 window is:

Quote:
GraalScript: Function showtext not found in script of
Is it not possible to use showtext or showpoly from joined classes?
Reply With Quote
  #2  
Old 08-29-2006, 06:01 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Yes, it is. Mind showing us the script thats not working?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 08-29-2006, 06:18 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
I'm trying to make a mouseover class.

PHP Code:
//#CLIENTSIDE
public function onCreated() {
setTimer(1);
}
public function 
setToolTip(text) {
  
this.text text;
  
setTimer(1);
}

function 
onTimeout() {
  if (
mousescreenx-12 in |this.x,this.x+this.width*4| && mousescreeny-6 in |this.y,this.y+this.height*8|) {
    
showTooltip();
  }
  else {
   
hideimg(350);
  }
  
setTimer(1);
  
}

function 
showTooltip() {
  echo(
this.text); //shows correctly in F2 window on mouseover
  
showtext(3502020"Arial""b"this.text ).zoom 0.6//gives error in F2 window
  
changeimgvis(350,7);

Heres how I'm using it:
PHP Code:
findimg(i).join("mouseover");
findimg(i).setToolTip("test text"); 
Reply With Quote
  #4  
Old 08-29-2006, 08:09 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Uhh.. do this:

PHP Code:
showtext(3502020"Arial""b"this.text );
changeimgzoom(3500.6); 
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #5  
Old 08-29-2006, 09:03 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
it's worked how i have it in other places. Just saves a line. But, removing .zoom() from the end doesn't solve the problem. F2 window still reports that the function cant be found.
Reply With Quote
  #6  
Old 08-29-2006, 10:09 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
There are ways to work around having to use showtext.
controlling script:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.imgs = new [5];
  
temp.texts = {
                 
"I am testing.",
                 
"No really, I am.",
                 
"C'mon! I seriously am!",
                 
"Why don't you believe me?",
                 
"Fine, be that way! :("
               
};
  
this.tlen this.imgs.size();
  for (
temp.i=0;temp.i<this.tlen;temp.i++) {
    
this.imgs[temp.i] = showtext(200+temp.i,20,20+14*temp.i,"Arial","",temp.texts[temp.i]);
    
this.imgs[temp.i].parent this;
    
with (this.imgs[temp.i]) {
      
this.layer 5;
      
this.zoom 12/23;
      
this.join("mouseover");
      
this.setToolTip("test text");
      
this.tooltip findimg(350+temp.i);
      
this.width gettextwidth(12/23,"","Arial",temp.texts[temp.i]);
      
this.height gettextheight(12/23,"","Arial");
    }
  }

mouseover class:
PHP Code:
//#CLIENTSIDE
public function setToolTip(text) {
  
this.tooltext text;
  
setTimer(0.05);
}
function 
onTimeout() {
  if (
mousescreenx in |this.x,this.x+this.width
    && 
mousescreeny in |this.y,this.y+this.height|) {
    
showTooltip();
  }
  elseif (
this.wait 0this.wait --;
  else {
    
thiso.tooltip.text "";
  }
  
setTimer(0.05);
}
function 
showTooltip() {
  for (
temp.i=0;temp.i<this.parent.tlen;temp.i++) {
    
this.parent.imgs[temp.i].wait 0;
    
this.parent.imgs[temp.i].tooltip.text "";
  }
  
this.wait 20;
  echo(
this.tooltext);
  
this.tooltip.zoom 12/23;
  
this.tooltip.layer 7;
  
this.tooltip.text this.tooltext;
  
this.tooltip.style "b";
  
this.tooltip.mousescreenx 14;
  
this.tooltip.mousescreeny 2;

__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #7  
Old 08-31-2006, 03:05 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
so are you saying showpoly/showtext cant be used the normal way from a joined class?

If theres not I can put the showtext/showpoly parts in the weapon NPC thats calling it. It'd just be nicer to have it in a class
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 07:50 PM.


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