DE EN FR ES IT CZ
Back Back to top

[Solved] Switch scene in lua

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  • #1, by andy-rinaldi 13 years ago Quote
    Hi,
    I'm not able to find the correct syntax in order to switch a scene in lua code.

    game:getLink("Scene[0015commands_errorENG]")
    


    ??

    grin
  • New to Visionaire Studio?

    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
  • #2, by Alex 13 years ago Quote
    should be something like
    game:setLink(VGameCurrentScene, getObject('Scenes[scene_name]'))
    
  • #3, by afrlme 13 years ago Quote
    It's setValue not setLink. smile
    game:setValue( VGameCurrentScene, getObject("Scenes[scene_name]") )
    

    ...setLink returns a nil value.

    Changing data structure tables is always done via the setValue function. game: is only used for accessing/setting entries in the game table. Aside from that, almost everything else can be accessed via getObject; actually the game table can also be accessed via getObject also...
    getObject("Game.GameCurrentScene") -- is the same as...
    game:getLink(VGameCurrentScene)
    
  • #4, by andy-rinaldi 13 years ago Quote
    AFRLme is right. The script is working fine.

    Thanks.