💎 PREMIUM: Profile/jsk - Uncensored 2025

Skip to main content

Julian Kantor

8
Posts
21
Followers
1
Following
A member registered Dec 02, 2017 · View creator page →

Creator of

Recent community posts

Hey Ireth, this bug is now fixed. Thanks again for reporting the issue.

Thanks for the bug report Ireth! Will take a look at it when I get a chance.

Very happy to help, and thanks for asking questions on here as I'm sure solving your issues will help to improve the package for others as well. Good idea on the YouTube tutorial.

Check out Version 1.2.0! https://jsk.itch.io/ink-objects/devlog/357515/version-120-released

As an update I think it may easier than I anticipated to add this functionality so stay tuned

(4 edits)

Well there is no inherent issue with changing values of a Scriptable Object at runtime in Unity. Some people might not like it for stylistic reasons but it's certainly possible. But I don't think that is what is causing you problems in this case.

The issue you are running into is specifically with InkObjects and where they "live."

The InkObjectLibrary can only be modified while authoring the game/story. InkObjects is a tool which can be used to populate your Ink story with data that can be manipulated in Ink and read back by Unity. But once you export your library to Ink, your InkObjects live in Ink and can only be modified in Ink.

If you notice that the InkObject asset in your Unity project is grayed out and not editable during play mode, this is because there is a custom UnityEditor for InkObjects that is doing that manually and reflecting the values from the Runtime instance of that Library Object. This is because changing the Library Object after exporting the Library to Ink will have zero effect on your game (apart from being very confusing).

If you want the user to modify the player character, that will need to happen in Ink, just like any other part of the Ink story. I know some things might be difficult to achieve (for example text entry) but many things will be easy to change interactively within Ink through choices. Your app could skin the choices to make it look like a more typical character design interface.

I will look into potentially expanding the InkObject system so that you can push overrides to InkObjects from Unity to Ink at runtime. I agree that would be very useful, though in my basic research into Ink my understanding was that pushing data to Ink was unsafe (for example, the Ink docs do not recommend changing values via external function).

(7 edits)

Happy to help! I would suggest making use of lambdas - https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/lamb...

So in your case, something like this...

It is not necessary to store the lambda in a local variable ("conLambda"), typically I would just pass it directly as the second parameter of AddFieldCallback, but I broke it out into its own line for clarity.

The basic way I think about lambdas is that they declare a function that operates on a given set of parameters.

(param0, param1, etc.) => [turns into] [action on parameters]

In this case, your function operates on no parameters, hence the empty parentheses at the start of the lambda declaration.

From the perspective of the InkObjects system, using an Action with no parameters makes the most sense for a FieldCallback, as the system does not have any data that it needs to pass along when it invokes the action (though I could imagine a very complete system might want to pass along the name and value of the field that is being updated, and maybe I will push an update later that has that functionality, but it wouldn't accomplish what you are trying to do).

Anyway, let me know if you have further questions or encounter any other issues!

Hey Ireth. Great to hear you are making use of the Runtime Objects! Thanks for the idea - I just pushed version 1.1.1 with the functionality you are requesting. Check out the HealthBar example for how to use it and let me know if you have any more questions or requests!