ERROR:SCRIPT: richtext/richtext.lua:586: attempt to index local 'word' (a nil value)
stack traceback:
richtext/richtext.lua:586: in function on_click
main/main.gui_script:64: in function <main/main.gui_script:63>
Example code that works:
local text = "Words outside an a tag.\n<a=message_id>clickable message.</a>"
local settings = {
fonts = {
pixel = {
regular = hash("system_font"),
},
},
size = 1.25,
width = 900,
parent = gui.get_node("center"),
position = vmath.vector3(0, 0, 0),
align = richtext.ALIGN_CENTER,
combine_words = true
}
self.rt_text = richtext.create(text, "pixel", settings)
And when you add some words on the same line as the tag:
local text = "Words outside an a tag.\nThis is <a=message_id>clickable message.</a>"
This will give the above error.
However I noticed if you change it to this:
local text = "Words outside an a tag.\nThis is a <a=message_id>clickable message.</a>"
When
combine_words = true
, and you have an tag that shares a line with words not in the tag, you get the following error.Example code that works:
And when you add some words on the same line as the tag:
This will give the above error.
However I noticed if you change it to this:
Suddenly it works again.
When
combine_words = false
none of this breaks.