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 03-19-2011, 07:10 PM
AlexanderK AlexanderK is offline
Registered User
AlexanderK's Avatar
Join Date: Mar 2006
Location: Germany
Posts: 79
AlexanderK is on a distinguished road
Send a message via MSN to AlexanderK
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?
Reply With Quote
  #2  
Old 03-19-2011, 07:14 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Attach it to a player attr solves the problem
& wow that looks laggy
__________________
Reply With Quote
  #3  
Old 03-19-2011, 07:19 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 xAndrewx View Post
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.
__________________
Reply With Quote
  #4  
Old 03-19-2011, 07:20 PM
AlexanderK AlexanderK is offline
Registered User
AlexanderK's Avatar
Join Date: Mar 2006
Location: Germany
Posts: 79
AlexanderK is on a distinguished road
Send a message via MSN to AlexanderK
Quote:
Originally Posted by xAndrewx View Post
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 View Post
& wow that looks laggy
Well I'm trying...
Reply With Quote
  #5  
Old 03-19-2011, 07:29 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
ganis in attr[] should work, use attachtoowner or so instead of displaying the nick in an endless loop
Reply With Quote
  #6  
Old 03-20-2011, 01:13 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
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.
Reply With Quote
  #7  
Old 08-30-2011, 05:14 AM
0PiX0 0PiX0 is offline
Coder
0PiX0's Avatar
Join Date: Jan 2011
Posts: 130
0PiX0 is a jewel in the rough0PiX0 is a jewel in the rough
Bump.
Quote:
Originally Posted by WhiteDragon View Post
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.
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:23 AM.


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