Use variable scene name in Scenes[]

  • #1, z dionousSunday, 30. July 2017, 17:26 hodinky 7 years ago
    Hi all,

    I'm trying to use the following in the definition script: basically, i'd like to be able to check the current scene for any conditions named 'cutscene' and if they are set to true (so i can customize the skipping of the cutscene using keyhandlers). The problem is how can i use a variable name within the Scene[] ?

    Scenes[current_scene_name] is wrong apparently, is there any way to tell VS that this is a variable and not an actual scene name? 

        current_scene_name = game:getLink(VGameCurrentScene):getName()
    
        if getObject("Scenes[current_scene_name].SceneConditions[cutscene]") == true

    Thanks!

    Fanoušek fóra

    246 Posts


  • #2, z afrlmeSunday, 30. July 2017, 19:22 hodinky 7 years ago
    if game.CurrentScene.SceneConditions["cutscene"].ConditionValue then
     -- is true
    else
     -- is false
    end

    Imperátor

    7285 Posts

  • #3, z dionousSunday, 30. July 2017, 21:25 hodinky 7 years ago
    Well, simplicity is king i guess, thanks mate

    Fanoušek fóra

    246 Posts