[Solved] Switch scene in lua

  • #1, by andy-rinaldiWednesday, 24. September 2014, 23:45 6 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]")
    1
    2


    ??

    grin

    Forum Fan

    160 Posts


  • #2, by AlexThursday, 25. September 2014, 00:06 6 years ago
    should be something like
    game:setLink(VGameCurrentScene, getObject('Scenes[scene_name]'))
    1
    2

    Great Poster

    378 Posts

  • #3, by afrlmeThursday, 25. September 2014, 02:25 6 years ago
    It's setValue not setLink. smile
    game:setValue( VGameCurrentScene, getObject("Scenes[scene_name]") )
    1
    2

    ...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)
    1
    2
    3

    Imperator

    6862 Posts

  • #4, by andy-rinaldiThursday, 25. September 2014, 10:52 6 years ago
    AFRLme is right. The script is working fine.

    Thanks.

    Forum Fan

    160 Posts

Write post