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 09-24-2011, 08:08 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
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?
__________________
Reply With Quote
  #2  
Old 09-24-2011, 08:29 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
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);

__________________
Reply With Quote
  #3  
Old 09-24-2011, 08:32 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Thank's it works. I created a class and joined the NPC's to it.
__________________
Reply With Quote
  #4  
Old 09-24-2011, 08:50 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 Emera View Post
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.
__________________
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 09:26 PM.


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