Bubble disappear time is calculated by a function in the BubbleChat script called ComputeBubbleLifetime. It is changed dynamically based on the length of the message. The two relevant functions are lerpLength and ComputeBubbleLifetime, which is a member function of a table returned by the function createChatLine.
In the table returned by createChatLine, there is a table member named BubbleDieDelay. This is set by the ComputeBubbleLifetime function, which is made to dynamically change how long a bubble should last for based on the length of the text.
In order to change how quickly bubbles disappear, forking the BubbleChat script is required. From there, you only really need to make one edit. Where you choose to make that edit depends:
A. Replace the lifetime computer with a number of your choosing, whether it’s dynamically computed or if you want a concrete delay regardless of any message sent.
local function createChatLine(message, bubbleColor, isLocalPlayer)
local this = {}
function this:ComputeBubbleLifetime(msg, isSelf)
if isSelf then
return lerpLength(msg,8,15)
else
return lerpLength(msg,12,20)
end
end
this.Origin = nil
this.RenderBubble = nil
this.Message = message
- this.BubbleDieDelay = this:ComputeBubbleLifetime(message, isLocalPlayer)
+ this.BubbleDieDelay = 5
this.BubbleColor = bubbleColor
this.IsLocalPlayer = isLocalPlayer
return this
end
B. Change where BubbleDieDelay is used.
- delay(line.BubbleDieDelay, function()
+ delay(5, function()
this:DestroyBubble(fifo, chatBubbleRender)
end)
C. Change the Lua Chat System up a bit such that you can specify the message type as a spell, then the BubbleChat script will use a lower lifetime for bubbles if the message type is “spellcast” or whatever, but will use standard procedures if it isn’t. How you do this is up to you.
On a separate note, you can locally change these settings for yourself as well. In Settings under Game Options, there’s a couple of things related to bubble chat. Won’t affect other players though, just yourself.
