Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Custom Chat Display (https://forums.graalonline.com/forums/showthread.php?t=134264628)

Emera 09-24-2011 08:08 PM

Custom Chat Display
 
I was reading through some old threads on a custom chat system by littlekinky, and I say a post by FowlPlay4 that really grabbed my attention. Here is the thread. Here is the post. I added fowlplays post to my server and saw that it could be edited to make a really nice chat display. I was having an issue though. I couldn't for the life of me work out how to make NPC's chat display with it. Can anybody help me out?

cbk1994 09-24-2011 08:29 PM

npcs is the array of NPCs near the player. You can do the same thing as you do with players (haven't tested but should work):

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
// Enablefeatures except for chat text
  
enablefeatures(allfeatures-0x80);
  
// Begin looping
  
setTimer(0.05);
}

function 
onTimeout() {
  
// Hide Last Drawn Chat
  
hideimgs(2001000);
  
// Loop through Players in the level
  
temp.index 0;
  
  for (
temp.a: {playersnpcs}) {
    for (
temp.temp.a) {
      
// Record their chat and trim it.
      
temp.player_chat temp.p.chat.trim();
      if (
temp.p.chat != "") {
        
// Draw the Text over the player.
        
with (findimg(200 temp.index)) {
          
temp.p.1.5;
          
temp.p.0.5;
          
style "c";
          
text temp.player_chat;
        }
      }
      
      
temp.index ++;
    }
  }
  
// Continue Looping
  
setTimer(0.05);



Emera 09-24-2011 08:32 PM

Thank's it works. I created a class and joined the NPC's to it.

cbk1994 09-24-2011 08:50 PM

Quote:

Originally Posted by Emera (Post 1669024)
Thank's it works. I created a class and joined the NPC's to it.

What? That should go in a weapon script, not in a class.


All times are GMT +2. The time now is 09:37 PM.

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