inkle / ink-unity-integration

Unity integration for the open source ink narrative scripting language.
http://www.inklestudios.com/ink
Other
570 stars 99 forks source link

How to transfer variable values from one Ink story to another Ink story? #194

Closed bigpng closed 2 months ago

bigpng commented 11 months ago

I have the following variable at globals.ink:

VAR affinity = ""

And the following in Scene1.ink:

~ affinity = "Shenzhen"

I want to pass affinity to Scene2.ink but I only get the variable value from globals.ink. I have tried to set value and get value through External functions, and tried to play with ObserveVariable. Nothing seems to work. And I cannot find any documentation on how to pass values to a different Ink story. I would appreciate any help.

tomkail commented 11 months ago

Not sure I follow? If scene 1 and 2 are part of the same story then you don’t need to do anything. If they’re separate stories then you’ll need to copy the value over like you say - I can’t see why setting the variable wouldn’t work. For debugging I recommend using the Ink Player Window in Unity. Can you re-explain?

On Tue, 3 Oct 2023 at 04:46, BIGPNG @.***> wrote:

I have the following variable at globals.ink:

VAR affinity = ""

And the following in Scene1.ink:

~ affinity = "Shenzhen"

I want to pass affinity to Scene2.ink but I only get the variable value from globals.ink. I have tried to set value and get value through External functions, and tried to play with ObserveVariable. Nothing seems to work. And I cannot find any documentation on how to pass values to a different Ink story. I would appreciate any help.

— Reply to this email directly, view it on GitHub https://github.com/inkle/ink-unity-integration/issues/194, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJR3UE7X2ONVG6OH4HJ6SLX5ODC3AVCNFSM6AAAAAA5QK2PW6VHI2DSMVQWIX3LMV43ASLTON2WKOZRHEZDGMRTGYZDCNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>