A'llo, here is a small function I wrote a little while back that lets you change the name of pretty much anything.
Quick note: names are not stored in the save game files but values & conditions are, so taking that into consideration it's possible to store the name inside of the string section of a value or inside of Lua tables.
1. Go to the script section of the Visionaire Studio editor, create a new script (leave it as a definition type script) & paste this code into it
function changeName(txt)
local obj = game.CurrentObject.Name.TextLanguages
-- + --
for i = 1, #obj do
obj[i].text = txt
end
-- + --
game.CurrentObject.Name.TextLanguages = obj
end
2. Create a value on each of the characters you plan on changing the names of & in the string section type what you want their initial names to be, such as "???" or "some strange looking alien". Now rename the value(s) to "name".
3. Now go to the actions tab for each of the characters you want to change the name of & create a
cursor enters character area action & then create an
execute a script action part in this & add this code to it...
changeName(game.CurrentObject.Values["name"].String)
4. Whenever you want to change the name of the character you just need to create an execute a script action part somewhere (in the relevant action block where you want to update the name) & then you will need to add a small line of code to change the string section of the value you created for the character...
Characters["insert characters name here"].Values["name"].String = "insert new name here"
Now when you hover back over the character the new name should be displayed.
Quick note: the same changeName() function can also be used for changing the names of scene objects too, but the value method won't work for that if you plan on releasing the game with multiple language options. Instead you would need to use Lua tables/arrays to store the new names into. Here's a quick example of what you would need to include inside of an on mouse enters action for a scene object.
if Conditions["name_known"] is true
execute a script >
local t = {
English = "new name in english",
German = "new name in german"
}
changeName( t[ game.StandardLanguage:getName() ] )
end if
The language names might need to be changed in the script, if that's not what you called them. The condition can be called whatever you want, but again make sure it's changed to whatever you call it inside of the script too.
& a final quick note: all names are case sensitive, so make sure you type them out exactly the same as they are inside of the Visionaire Studio editor.
P.S: I forgot to mention that you will get much faster support on our Discord server @
https://discord.gg/g5zFejW, than on here as we only check in on the forum every now & then, but are online most of time on Discord.