This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials
Create point and click adventures without coding. The free version covers up to 25 scenes per project. For more scenes or to earn money with your game, you need a license.
See the Indie Bundle Try it for free
function changeChar(c)
if getObject("Characters[" .. c .. "].CharacterConditions[activated]"):getBool(VConditionValue) and game:getLink(VGameCurrentCharacter):getName() ~= c then
game:setValue(VGameCurrentCharacter, getObject("Characters[" .. c .. "]"))
-- + --
if game:getLink(VGameCurrentScene):getName() ~= getObject("Game.GameCurrentCharacter.CharacterScene"):getName() then game:setValue(VGameCurrentScene, getObject("Game.GameCurrentCharacter.CharacterScene")) end
end
end
changeChar("tom") -- name is case sensitive
local scene = game:getLink(VGameCurrentScene)
local character = game:getLink(VGameCurrentCharacter)
if scene:getName() == "Roman Transporter" then
if character:getName() == "Tom" then
game:setValue(VGameCurrentScene, getObject("Scenes[Ancient Rome]"))
elseif character:getName() == "Dick" then
game:setValue(VGameCurrentScene, getObject("Scenes[Present Day Rome]"))
else
game:setValue(VGameCurrentScene, getObject("Scenes[Futuristic Rome]"))
end
end
local scn = game:getLink(VGameCurrentScene)
local char = game:getLink(VGameCurrentCharacter):getName()
local t = { tom = "a_", dick = "p_", harry = "f_" }
if scn:getName() == "Roman Transporter" then
game:setValue(VGameCurrentScene, getObject("Scenes[" .. t[char] .."Rome]")) -- would return a_Rome, p_Rome, or f_Rome...
end