Register for your free account! | Forgot your password?

You last visited: Today at 02:00

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



NPC Chat length ?

Discussion on NPC Chat length ? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2009
Posts: 9
Received Thanks: 0
Exclamation NPC Chat length ?

iam some what confused why some NPC's chats that are long show and wen i made this script i seem to only get so much of my chat text the last bit to be displayed is red is there a limit to chat lenght or size of chatbubble


thanx in advance
}
if (Control == 1)
{
GC.AddSend(Packets.NPCSay("Every week there's a LastMan Standing Tournament with 1 winner emerging to claim a Handsome prize. You'll see a broadcast 10 minite's before start come see me to sign up and i'll teleport you to the waiting area. Its a 1 v 1 match randomly selected.Loser leaves,winner goes to next stage.Match's continue untill 1 player left standing.NO healing of any kind. "));
GC.AddSend(Packets.NPCLink("Can i have more details?", 11));
GC.AddSend(Packets.NPCLink("Sounds cool...", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
Donyboi is offline  
Old 10/05/2010, 09:09   #2


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
You have to send 2 NPCSay packets, because each packet has a character limit.
Korvacs is offline  
Thanks
2 Users
Old 10/05/2010, 22:09   #3
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by Korvacs View Post
You have to send 2 NPCSay packets, because each packet has a character limit.
killersub is offline  
Old 10/06/2010, 03:59   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Note: the string length is using a byte so therefor the max chars you can use for the string packet msg is 255. If I were you in your send chat function I'd check the length of what you want to submit and split it into individual packets and send them all.

Sec... I feel like writing it up.

<edit>

Fully working afaik. Check incoming string for length. If it's short enough for one packet send as one. If not split into as many as needed.

Code:
public static void LongChat(string text, Client Client)
        {
            if (text.Length < 255)
            {
                Text(text, Client);
                return;
            }            
            string[] Words = text.Split(' ');
            string Final = "";
            foreach (string Word in Words)
            {
                if (Final.Length + Word.Length + 1 < 255)
                    Final += Word + " ";
                else
                {
                    Text(Final, Client);
                    Final = Word + " ";
                }
            }
            Text(Final, Client);
        }
pro4never is offline  
Reply


Similar Threads Similar Threads
g_vfs_done():ad0s1d[WRITE(offset=2119712768, length=2048)]error = 6
08/09/2010 - Metin2 Private Server - 4 Replies
Hi, bei unserem Dyndns Server kommt immer der fehler in FreeBsd. Das wird dauerhaft geschrieben und cpu geht auf 100%^^ g_vfs_done():ad0s1derror = 6 Kennt sich jemand damit aus? Vermute irgendwas mit Festplatte, stimmt das?
[Help] Getting Length and Width of the DMaps
08/03/2010 - CO2 Private Server - 3 Replies
I use spatial indexing for my server, which could be optimized a little, by adding the length and width of each map. I know it can be read from the map files, or some different file for sure, but I do not know how to do this, as I have no experience with maps. What I want is a simple text file including: MapID - X or Width - Y or Length where - is a space, so: 1002 1024 1024 I need this for all maps except for special maps such as houses, ships, new maps, explaining me how to do it...
Black Dragon Respawn Length?
11/05/2009 - Dekaron - 4 Replies
i was jw if any1 knows the length 4 the respawn of the black dragon:confused:
Server Error:..... Wrong Length.............
08/09/2009 - Dekaron Private Server - 2 Replies
http://upic.me/i/b7/wrong.jpg i run server around 1 week but i just saw this problem, and i don't know what that mean,i try to fix it by my self with 2 days (not success) i'm so sad and so trie if anyone know how to fix this ,please share for my noob:(. btw thank you so much.
Combo wait length
03/07/2008 - Cabal Online - 10 Replies
Hi this is my first post here this has been bothering me i cant find it anywhere and i cant come across it of my own i am trying to make a script right now to do combos but i cant tell how long it takes for the bar to fill up to where the combo actually works so can anyone tell me the length between combo 1-10 then 11-13 then 13+ it be much appreciated thanks.



All times are GMT +2. The time now is 02:00.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.