registerEventHandler("textStarted", "textStarted")
registerEventHandler("textStopped", "textStopped")
registerHookFunction("setTextPosition", "setTextPos")
pos={x=0,y=0}
hook=false
function textStarted(text)
local data = text:getLink(VTextSavedObject)
textOwner = text:getLink(VTextOwner) //this one is global
if textOwner:getId().tableId == eCharacters then //only for Characters
// now you should switch which bubble to show
getObject("Conditions[bubble1]"):setValue(VConditionValue, true) //best way to have a condition for the bubble
pos = {x=100, y=100} //example position
hook = true
end
end
function setTextPos(text)
if hook then
if textOwner:getId().tableId == eCharacters
text:setValue(VTextPosition, pos)
end
end
end
function textStopped(text)
if hook then
hook = false
//hide all bubbles
end
end