License from €75 Log in
DE EN FR ES IT CZ

change scene with luo script

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 5 years ago
    hi

    I have seen here how to change scene with luo-script.
    But I dont get my character with me. In the editor I would give a position, to place my character, but with the luo game.scene command the is no object, to place the character.
    How to do that?

    regards Peter
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license.

    See licenses Try it for free
  3. · 5 years ago
    It would require multiple lines of code to do that with Lua script.

    1. you need to specify the scene you want to change the current scene to.
    2. you need to specify which scene the character is on.
    3. you need to specify the position you want the character to be placed at in the new scene.
    4. you need to specify the alignment for the character.

    definition script:
    function changeScene(scn, obj)
    
     game.CurrentScene = Scenes[scn]
    
     game.CurrentCharacter.Scene = Scenes[scn]
    
     game.CurrentCharacter.Position = Scenes[scn].Objects[obj].Position
    
     game.CurrentCharacter.Direction = Scenes[scn].Objects[obj].Direction
    
    end


    usage:
    changeScene("insert scene name here", "insert object name here")
  4. · 5 years ago
    Thanks - works perfect.

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?