"Masking" scene name for use in script

  • #1, by santachaosFriday, 19. September, 09:29 2 days ago
    Hello everyone,


    I have a problem with accessing a scene in one of my scripts.
    I wrote a little script for do some actions on the mouse click if a specifc scene is active:

    if game.CurrentScene== Scenes.Emong_Hunt then
      --do something
    end

    Everything worked fine until a renamed my scene in 206_Emong_Hunt (all my scenes start with an number for the chapter and Scene identification).

    if game.CurrentScene== Scenes.206_Emong_Hunt then
      --do something
    end

    It looks like the script has a problem with accessing an item name starting with a number.
    So my question is: Is there a way for masking such a name or do I have to change all my scene names as e.g. s_206_Emong_Hunt so they don't start with a number anymore?


    Kind regards

    Christian

    Newbie

    4 Posts


  • #2, by esmeraldaFriday, 19. September, 10:12 Yesterday
    yeah, accessing names that start with a number via .name does not work.
    use
     
    Scenes["206_Emong_Hung"]

    Key Killer

    559 Posts

  • #3, by santachaosFriday, 19. September, 10:26 Yesterday
    yeah, accessing names that start with a number via .name does not work.
    use
     
    Scenes["206_Emong_Hung"]

    Thank you, it worked fine that way

    Newbie

    4 Posts

Write post