Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Chat Bubbles on Eclipse Origins?


Ironcomics
 Share

Recommended Posts

@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 ? XD
You dont have to show me how it would prob take long :/
Link to comment
Share on other sites

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

@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 want

May I suggest re-doing this code to write multiple lines instead of one long one? :P
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

@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

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

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...
Link to comment
Share on other sites

@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 section
Under:

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

@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 ' bottom
Else ' single line
    SendActionMsg GetPlayerMap(Index),message,35), Yellow, ACTIONMSG_STATIC, GetPlayerX(Index), (GetPlayerY(Index) * 32) - 25
End If
Link to comment
Share on other sites

@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 = Text
End Function
```
But yes, Robin is right, do it by width
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...