inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
4.07k stars 489 forks source link

Change scene from ink #767

Open neekocy opened 2 years ago

neekocy commented 2 years ago

I want that after my character stops talking, unity changes to another scene. I think it should be made with tags but i can't seem to get it right.

btarg commented 2 years ago

You can do this with an external function, see this page: https://github.com/inkle/ink/blob/master/Documentation/RunningYourInk.md

halotroop2288 commented 2 years ago

You may need to implement this change as a listener in Unity. Ink is a language that has no specific implementation. Unity integration is a separate project. "Change scene" might not have any function in a different implementation such as Inky.

So I recommend printing a keyword for a Unity C# script to listen for, and respond to. For instance, you could simply return a magic string in the story like:

VAR sceneFileName = "Scene1"

What would you like to do?
    * Change Level
        unityChangeScene {sceneFileName} // listen for this line
        -> DONE // Unreachable
    * End Story
        GAME OVER.
        -> END