Any way to make chat bubbles dissapear faster?

If you’ve ever played arcane adventures, when you user a spell in that game, your character “chats” the name of the spell, so to say. A chat bubble appears over their head with the name of the spell.

I’ve already made it like this in my game, but I would like to know if it would be possible to make them disappear faster. It kind of clogs the screen when you combo attacks together.

I’ve considered making it “create” a welded part at the player’s head when they used a spell to make it so the part can just be destroyed, but that would very likely cause the player’s chat to overlay on top of the spell shout. It’s also probably not super visually pleasing, a chat bubble just vanishing instead of fading out like it usually does.

If it’s not possible, I’ll just limit my usage of it.

2 Likes

I believe there’s an option in the bubblechat script that permits you setting the time of a bubble chat, this however varies on the lenght of the message. So I highly suggest not editing it, but really on you. If not on bubblescript, then go to chatsettings.

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.

image

6 Likes

Suggestion C was exactly what I was looking for. Thanks!

https://gyazo.com/75d2dd4260863e4f92177098dd4ce07a

2 Likes