Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Custom Nick Display, general showimg questions (https://forums.graalonline.com/forums/showthread.php?t=134262472)

AlexanderK 03-19-2011 07:10 PM

Custom Nick Display, general showimg questions
 
What is the best way to do this?
Right now I'm using showimgs like that:
PHP Code:

//#CLIENTSIDE
function onCreated() setTimer(0.1);

function 
onTimeOut() {
  
temp.0;
  for (
plplayers) {
    
with(findimg(500 temp.i)) {
      
pl.1.5;
      
pl.3.5;
      
red blue green 1;
      
textshadow true;
      
shadowcolor = {000};

      if (
pl.clientr.invincible == true)
        
text "(" SPC pl.nick SPC ")";
      else
        
text pl.nick;

      
zoom alpha 0.7;
      
style "c";
    }
    
temp.i++;
  }
  
setTimer(0.05);


But it kind of drags behind the player character when he walks.
Is there a way to prevent that?
I've read here that showimgs can be attached to an owner, how does that work?
Also, I've read somewhere on here that there are indexes for showimgs that make them visible for all players, can I use this somehow?

xAndrewx 03-19-2011 07:14 PM

Attach it to a player attr solves the problem ^^
& wow that looks laggy

cbk1994 03-19-2011 07:19 PM

Quote:

Originally Posted by xAndrewx (Post 1637382)
Attach it to a player attr solves the problem ^^
& wow that looks laggy

Nooo, player attributes are far laggier than a script like his -- Stefan has stated so several times before. Era's originally used attributes and it caused a lot more lag than the custom one does now.

The only way I know how to solve the problem is if you use a custom movement system and call the nick system after moving the player. There may be ways to make it work with the default, but I don't know of them.

AlexanderK 03-19-2011 07:20 PM

Quote:

Originally Posted by xAndrewx (Post 1637382)
Attach it to a player attr solves the problem ^^

How do I do that? Graal has like no documentation of things like that.
Quote:

Originally Posted by xAndrewx (Post 1637382)
& wow that looks laggy

Well I'm trying... :D

Admins 03-19-2011 07:29 PM

ganis in attr[] should work, use attachtoowner or so instead of displaying the nick in an endless loop

WhiteDragon 03-20-2011 01:13 AM

Stefan, you should provide a TLevelObject.attachto(TServerPlayer player).

Presumably it would be handled at a lower level so it would be faster than a GS loop.

0PiX0 08-30-2011 05:14 AM

Bump.
Quote:

Originally Posted by WhiteDragon (Post 1637509)
Stefan, you should provide a TLevelObject.attachto(TServerPlayer player).

Presumably it would be handled at a lower level so it would be faster than a GS loop.

This or
TShowImg.attachto(TServerPlayer player)
and
GuiShowImgCtrl.attachto(TServerPlayer player)
would be very useful for optimizing many effects.


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

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