License from €75
DE EN FR ES IT CZ

[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. · 13 years ago
    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
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license. Forum readers get the Indie Bundle 15 % off with the code FORUM15: €84.15 instead of €99, valid until 31 Dec 2026.

    Get 15 % off Try it for free
  3. · 13 years ago
    should be something like
    game:setLink(VGameCurrentScene, getObject('Scenes[scene_name]'))
    
  4. · 13 years ago
    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)
    
  5. · 13 years ago
    AFRLme is right. The script is working fine.

    Thanks.

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?