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 12-24-2012, 05:17 AM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Text display issue

PHP Code:
 showText(100this.xthis.y-3"showg""b""" @(player.clientr.hitpoints));
   
with (findImg(100)) {
    
font "showg";
    
style "b";
    
layer 23;
    
zoom 1;} 
This is on an NPC (Whole script is serverside)

Number of issues...
1. The zoom doesn't go past 1, and I want larger number text.
2. I don't know how to change the color. (Looking to make it red)
3. What is the most efficient way to make it rise then delete.
-With that, what if another hitpoint is generated before the current one is still in rising effect?

I know a way to make rising text, but it wouldn't be pretty....
Reply With Quote
  #2  
Old 12-24-2012, 06:33 AM
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
For displaying text, especially text that you want to change, the only good solution is to do it clientside (serverside showtext has issues with updating and stuff like zoom, as you're seeing). Either use showani or a player attribute to show your hit damage text (or whatever), and use a GANI script to do the effects/display. I think there are examples of this in the Code Gallery.
__________________
Reply With Quote
  #3  
Old 12-24-2012, 07:44 AM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
I have this on a NPC that is created.

PHP Code:
function onCreated() {
 
showcharacter();
 
setcharani("hiteffect""");
 
this.attr[20] = "hiteffect.png";
 
this.dir 2;
 
setTimer(0.25);
 }
 
function 
onTimeOut()
{
destroy();
}

//#CLIENTSIDE
function onCreated() {
 
showText(200this.xthis.y"showg""b""" @(player.clientr.hitpoints));
   
with (findImg(200)) {
    
font "showg";
    
style "b";
    
layer 23;
    
zoom 2;}
    
sleep(2);
    
showText(10000"showg""b""");
    } 
It works, but I guess in clientside it doesn't know where it's own x and y value is... :/
Reply With Quote
  #4  
Old 12-24-2012, 05:17 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
Quote:
Originally Posted by brokk View Post
It works, but I guess in clientside it doesn't know where it's own x and y value is... :/
I doubt that's the problem but it's hard to tell because your code isn't properly formatted and it seems like you're trying to do it several different ways (attributes and GANIs and clientside text all at once?)

What are you trying to do?
__________________
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 12:11 AM.


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