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

"Masking" scene name for use in script

  • #1, by santachaos 6 months ago Zitieren
    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
  • #2, by esmeralda 6 months ago Zitieren
    yeah, accessing names that start with a number via .name does not work.
    use
     
    Scenes["206_Emong_Hung"]

  • #3, by santachaos 6 months ago Zitieren
    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