Turning an inky function into a variable (getting the players name, then turning it into a variable) #773
-
Hello, I am a total noob at inky so you might need to teach me some things. I am trying to use inky to activate an external function that will ask the player's name for the story. I used this article to get the basics: Article "This is up to the individual game to implement. Ink's primary goal is to be a single layer within the technology stack of a game. The fact that it's also increasingly useable as a standalone IF language is sort of a side-effect, but we'd always expect you to customize the interface, whether it's by modifying the default Inky template, or by creating something in Unity. So, what you'd need to do is pop up a dialogue box to ask for the player's name, and then poke it in directly by setting an ink variable from the game side." How would "I poke it into a variable?" Note: I am not using Unity. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
Hi, It would depend on the language you're using. All the time, there is a way to write directly to the variable itself. All I would have to tell you, is either tell us what the port you are using (with what language?) and to look at the documentation. |
Beta Was this translation helpful? Give feedback.
Hi,
It would depend on the language you're using. All the time, there is a way to write directly to the variable itself.
For example in js I will do
story.variablesState.$("namePCInk", namePCJs);
supposing the the first is the ink name of the variablenamePCInk
and I fill it with the value ofnamePCJs
that is the name and the value of my js variable I already have filled with the current element I want to have.All I would have to tell you, is either tell us what the port you are using (with what language?) and to look at the documentation.
You especially want to part where the port is explaining how to do this part of the official explanation https://github.com/inkle/ink/blob/master/Docu…