Hi Julian. Thank you so much! I had never heard of lambdas before. It's silly that simply adding " () => " in front of the function magically makes it work as an Action (well, I guess the action is to call that function). I had been trying to do just that for the longest time.
Now I just need to solve one last challenge that has to do with InkObjects... something that I'm starting to fear might be impossible. I hope I'm wrong! I want players to be able to create their own characters, and use them inside the Ink story.
The way I'm trying to accomplish that is by replacing the values in the InkObject I call "Hero", which is a type of InkObjectHero I created, with the values introduced by the player right before the story starts. This seems like the simpler approach, but the Internet doesn't seem to like the idea of modifying scriptable objects at runtime. Instead of finding tutorials on how to do it, all I find are people saying "don't do that!".
So the other thing I tried is creating a new InkObjectHero at runtime and assigning it as the LibraryObject to observe. However, I've run into a couple problems with this method. Firstly, the ObjectLibrary needs to be rebuilt at runtime in order to include the new Hero, which I don't know how to do (or even if it's possible). And secondly, assuming I could do that, when I add new heroes to the Resources folder they are assigned a new ID, and my story is currently written to use the first ID (0) as the original Hero. I'd somehow need to pass the ID of the Hero the player created to the story. Or maybe change the order in which the Objects are specified in the "Specified Objects List" before updating the Library at runtime, in order to make the new Hero be the first.
I don't know, maybe there is a much easier way to approach this that I'm not seeing. I hope you can shed some light! Or, at least, let me know if it's even possible to do! Thank you so much in advance!