-- let's create the function which sets the position of displayed text
function setTextPosHook(text)
-- if text owner is a character then...
if text:getLink(VTextOwner):getId().tableId == eCharacters then
text:setValue(VTextPosition, {x=630, y=625})
txt(game.CurrentCharacter)
return true
end
end
-- let's create the event listener for handling position of displayed text
registerHookFunction("setTextPosition", "setTextPosHook")
-- adding character name to dialog
function txt(obj)
return obj.Owner:getName() .. ": " .. obj.CurrentText
end
registerHookFunction("textText", "txt")
This seems to cause more trouble than I expected. Thank you everyone for chiming in.Character portrait would certainly be much simpler than trying to manipulate active text, but like they already mentioned before, you could simply insert the characters name manually yourself into the displayed text action part.Since text seems to be troublesome, would it be easier to just display a character portrait? Or would that cause other problems?
Not sure about adding the name in with the actual line. Seems fiddly since I have a lot of dialog. I will have to play around and see what I like.Those aren't the basics. More like advanced stuff.Are there any good resources for learning basic scripting for Visionaire?The stuff I've found so far has mostly been confusing to me. I would just like to understand the basics of how scripts work with Visionaire. For instance, how to play a sound, display a picture, show a piece of text, etc.
Also, you should check out the "script index" page on the wiki. I have provided various script examples of my own & other peoples. Most come with resource files & tutorials. Reverse engineering is always a great way for learning things.