Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

[Solved] Switch scene in lua

  • #1, by andy-rinaldi 12 years ago Zitieren
    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, by Alex 12 years ago Zitieren
    should be something like
    game:setLink(VGameCurrentScene, getObject('Scenes[scene_name]'))
    
  • #3, by afrlme 12 years ago Zitieren
    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 12 years ago Zitieren
    AFRLme is right. The script is working fine.

    Thanks.