Ironcomics Posted March 1, 2011 Author Share Posted March 1, 2011 Im hosting an Eclipse Origins server and I dont really like the way that all the chat is at the bottom.Is there a way to get them on Eclipse Origins or a code or something?Thanks Link to comment Share on other sites More sharing options...
Ironcomics Posted March 1, 2011 Author Share Posted March 1, 2011 Everyone is too afraid to answer question… :'(. I'd appreciate an I dont know XD jk Link to comment Share on other sites More sharing options...
Joyce Posted March 1, 2011 Share Posted March 1, 2011 There is, but it'll require you to look at how the old versions of Eclipse did it, and modify that code to work with Origins. :) Link to comment Share on other sites More sharing options...
zdearborn Posted March 1, 2011 Share Posted March 1, 2011 How I did it was on handling saymsg (server side), I just sent a static action msg that would include the player's say text.However, this method doesn't have a graphical appeal like a physical chat bubble, just text. Link to comment Share on other sites More sharing options...
Ironcomics Posted March 1, 2011 Author Share Posted March 1, 2011 @Yami:> There is, but it'll require you to look at how the old versions of Eclipse did it, and modify that code to work with Origins. :)Is there a place i could learn to do that ? XDYou dont have to show me how it would prob take long :/ Link to comment Share on other sites More sharing options...
Joyce Posted March 1, 2011 Share Posted March 1, 2011 Nope, there isn't. You can either fiddle with it and see if you can get it to work yourself, or beg someone to make the changes for you. :) Or perhaps follow zdear's solution, which seems the most simple. Link to comment Share on other sites More sharing options...
zdearborn Posted March 1, 2011 Share Posted March 1, 2011 No, it wouldn't take long at all.. here:(Server)In modServerTcp, sub SayMsg_Map - add this after Set Buffer = Nothing```SendActionMsg GetPlayerMap(Index), message, Yellow, ACTIONMSG_STATIC, GetPlayerX(Index) * 32, (GetPlayerY(Index) * 32) - 25 ' - 25 so it is above the player```Of course there are many things you will have to tweak to get it to look like you want Link to comment Share on other sites More sharing options...
Joyce Posted March 1, 2011 Share Posted March 1, 2011 zdear, I believe he meant converting the old bubble code over would take long.. Which it might, depending on your proficiency. But your way is far easier and quicker of course. :) Link to comment Share on other sites More sharing options...
zdearborn Posted March 1, 2011 Share Posted March 1, 2011 Oops! should've recognized that after he quoted you. If that's what you want, ironcomics, ignore my previous post :P Link to comment Share on other sites More sharing options...
Yxxe Posted March 1, 2011 Share Posted March 1, 2011 @zdearborn:> No, it wouldn't take long at all.. here:> > (Server)> In modServerTcp, sub SayMsg_Map - add this after Set Buffer = Nothing> ```> SendActionMsg GetPlayerMap(Index), message, Yellow, ACTIONMSG_STATIC, GetPlayerX(Index) * 32, (GetPlayerY(Index) * 32) - 25 ' - 25 so it is above the player> > ```> Of course there are many things you will have to tweak to get it to look like you wantMay I suggest re-doing this code to write multiple lines instead of one long one? :P Link to comment Share on other sites More sharing options...
zdearborn Posted March 1, 2011 Share Posted March 1, 2011 it's mainly just a copy and paste of the existing sendactionmsg's, with edits, and it doesn't look nearly as bad in the editor as it does in the code tagsbut if you've got some kind of incurable OCD with the length of your lines you could just set all the parameters in variables earlier in the sub. Link to comment Share on other sites More sharing options...
Ironcomics Posted March 1, 2011 Author Share Posted March 1, 2011 Thanks for all your help. Will that code work? Link to comment Share on other sites More sharing options...
zdearborn Posted March 1, 2011 Share Posted March 1, 2011 Yes Link to comment Share on other sites More sharing options...
The New World Posted March 1, 2011 Share Posted March 1, 2011 @zdearborn:> it's mainly just a copy and paste of the existing sendactionmsg's, with edits, and it doesn't look nearly as bad in the editor as it does in the code tags> > but if you've got some kind of incurable OCD with the length of your lines you could just set all the parameters in variables earlier in the sub.He meant the message length. It'll show a long line of text above the player's head. Link to comment Share on other sites More sharing options...
zdearborn Posted March 1, 2011 Share Posted March 1, 2011 Wow I'm off today.It wouldn't be hard too check the length of the message and split it up accordingly Link to comment Share on other sites More sharing options...
Ironcomics Posted March 1, 2011 Author Share Posted March 1, 2011 Oh ok, Is there a way to make the text under each other but i can live with this though. Link to comment Share on other sites More sharing options...
The New World Posted March 1, 2011 Share Posted March 1, 2011 When you render the message, just get the amount of characters in the string and split it accordingly after a certain amount. It's kind of easy, just google a method of splitting strings in Visual Basic 6.0, and apply your new knowledge. :) Link to comment Share on other sites More sharing options...
shadowwulf Posted March 1, 2011 Share Posted March 1, 2011 I am messing with this also.What I have done is setup the sendmsg to put action messages above player's heads.I put a limit on how much people can type before they need to hit enter…This makes it so people type shorter sentences and keep spam to a minimum.In regards to the text not being appealing, at think a static bubble pic can be displayed just above the player when the message is up but I haven't tried anything yet....I don't know If we can just take a graphic and just call it in the blt functions or my fall back idea is to make an animation behind player... lol Link to comment Share on other sites More sharing options...
Robin Posted March 1, 2011 Share Posted March 1, 2011 Word wrap functions are common on the internet. You'll find some easily. Link to comment Share on other sites More sharing options...
Ironcomics Posted March 1, 2011 Author Share Posted March 1, 2011 Will i type vb6 word warps to make it diferentSorry i don't know anything about this vb6 stuff :/ Link to comment Share on other sites More sharing options...
zdearborn Posted March 1, 2011 Share Posted March 1, 2011 Yeah, do something like```If Len(message) > 35 Then ' length more than 35 chars SendActionMsg GetPlayerMap(Index), Left$(Trim$(message),35), Yellow, ACTIONMSG_STATIC, GetPlayerX(Index), (GetPlayerY(Index) * 32) - 40 ' top SendActionMsg GetPlayerMap(Index), Mid$(Trim$(message), 36, 70) & "...", Yellow, ACTIONMSG_STATIC, GetPlayerX(Index), (GetPlayerY(Index) * 32) - 25 ' bottomElse ' single line SendActionMsg GetPlayerMap(Index),message,35), Yellow, ACTIONMSG_STATIC, GetPlayerX(Index), (GetPlayerY(Index) * 32) - 25End If ```This just draws 2 lines of text, the second row just ends with "…" in case the length of the message exceeds the split checks. If you apply word wrap like Robin mentioned, you'll have no need for this.p.s. this doesnt split by words/spaces, it splits by characters so you may end up with something like:This is a bubble chat message. Blah Blah Blah... Link to comment Share on other sites More sharing options...
Ironcomics Posted March 1, 2011 Author Share Posted March 1, 2011 @zdearborn:> Yeah, do something like> ```> If Len(message) > 35 Then ' length more than 35 chars > SendActionMsg GetPlayerMap(Index), Left$(Trim$(message),35), Yellow, ACTIONMSG_STATIC, GetPlayerX(Index), (GetPlayerY(Index) * 32) - 40 ' top> SendActionMsg GetPlayerMap(Index), Mid$(Trim$(message), 36, 70) & "...", Yellow, ACTIONMSG_STATIC, GetPlayerX(Index), (GetPlayerY(Index) * 32) - 25 ' bottom> Else ' single line> SendActionMsg GetPlayerMap(Index),message,35), Yellow, ACTIONMSG_STATIC, GetPlayerX(Index), (GetPlayerY(Index) * 32) - 25> End If > > ```> This just draws 2 lines of text, the second row just ends with "…" in case the length of the message exceeds the split checks. If you apply word wrap like Robin mentioned, you'll have no need for this.> > p.s. this doesnt split by words/spaces, it splits by characters so you may end up with something like:> > This is a bubble chat mess> age. Blah Blah Blah...Will i put it under modServerTcp, sub SayMsg_Map sectionUnder:Sub SayMsg_Map(ByVal mapNum As Long, ByVal index As Long, ByVal message As String, ByVal saycolour As Long) Dim Buffer As clsBuffer? Link to comment Share on other sites More sharing options...
Robin Posted March 1, 2011 Share Posted March 1, 2011 Doing do it by length. You'll end up with stupidly short messages getting wrapped. Do it by text width. Link to comment Share on other sites More sharing options...
Ironcomics Posted March 1, 2011 Author Share Posted March 1, 2011 @Robin:> Doing do it by length. You'll end up with stupidly short messages getting wrapped. Do it by text width.Will this work? i tried changing it so it will show by length :/. i swapped (Trim$ for UBound()Because i read that"use UBound() in VBScript where you would use .length in Javascript, but remember, "I dont know alot about VB :/>! If Len(message) > 35 Then ' length more than 35 chars SendActionMsg GetPlayerMap(Index), Left$UBound()(message),35), Yellow, ACTIONMSG_STATIC, GetPlayerX(Index), (GetPlayerY(Index) * 32) - 40 ' top SendActionMsg GetPlayerMap(Index), Mid$UBound()(message), 36, 70) & "…", Yellow, ACTIONMSG_STATIC, GetPlayerX(Index), (GetPlayerY(Index) * 32) - 25 ' bottomElse ' single line SendActionMsg GetPlayerMap(Index),message,35), Yellow, ACTIONMSG_STATIC, GetPlayerX(Index), (GetPlayerY(Index) * 32) - 25End If Link to comment Share on other sites More sharing options...
evilbunnie Posted March 2, 2011 Share Posted March 2, 2011 @Ironcomics:> Will I type vb6 word warps to make it diferent> Sorry I don't know anything about this vb6 stuff :/Here is a simple word wrap code:```Function WordWrap(ByVal Text As String, Optional ByVal MaxLineLen As Integer = 70)Dim I As Integer For I = 1 To Len(Text) / MaxLineLen Text = Mid(Text, 1, MaxLineLen * I - 1) & Replace(Text, " ", vbCrLf, MaxLineLen * I, 1, vbTextCompare) Next I WordWrap = TextEnd Function```But yes, Robin is right, do it by width Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now