Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Text display issue (https://forums.graalonline.com/forums/showthread.php?t=134267636)

brokk 12-24-2012 05:17 AM

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....

cbk1994 12-24-2012 06:33 AM

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.

brokk 12-24-2012 07:44 AM

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... :/

cbk1994 12-24-2012 05:17 PM

Quote:

Originally Posted by brokk (Post 1710412)
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?


All times are GMT +2. The time now is 10:05 AM.

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