-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature proposal] Tags #122
Comments
This would be excellent and save me a lot of work, because I planned on adding precisely such functionality to PalimpsestNW, since it seems like something I could use in a game I'm working on (especially knot and location tags). |
Same here, I was definitely going to need something like that so i'm quite in favor of adding such a feature. Why the change from |
The change from Either way, you can escape out the character to have it appear within the game: |
Well I've been working on a Command system for my own games. To add a new command I'd have to only create a new class inheriting my own Command abstract class, add the C# attribute I think it's pretty solid, but the addition of tags could even make it easier. I'm keeping a curious eye on this feature! |
This would be massively helpful for me, too. I've been looking for ways to integrate voiceover audio for dialog in Ink, and was looking at implementing a special-case tagging system for it. I'd much rather have this system be general-purpose and baked in to the engine as you propose! Line level as well as knot/stitch level would be ideal. Then I could do something like: === cave_conversation === DELILAH: I don't know. Rocks? @wavid:1235 |
I've been using something similar, though I've baked the feature into comments in order to limit compatibility issues, e.g. //@img, etc. |
I'll throw my hat in the ring as a vote for a tagging system. I like what is proposed in the original post, with the amendment of using # as the tag symbol. However if the choice of # causes problems with legacy Ink scripts, then I'd support using @. |
Yeah, alright, using |
Another vote for this feature for reasons of invoking external game actions (commands) |
Is there an ETA on when tags would be implemented? I'm working on something that could greatly benefit from this feature and I'm wondering if I can reasonably wait for it to be implemented or go ahead and make something of my own for the time being. |
Random thought: could you achieve the same effect with external functions? {location("Paris")} Or whatever..? Jon
|
@isakgrozny sorry no ETA right now :-( it's quite high on my list of ink stuff to work on, but right now lots of our game stuff is higher. @joningold the main thing with global and knot level tags is to be able to extract them without actually running content. Was thinking of working on this as a wider metadata feature that might also include source line numbers (if you want them), and function signatures etc. Currently there's no way to validate that you're passing the right number of arguments when calling an ink function from C#. |
Okay, the feature is ready, it's in the tags branch: https://github.com/inkle/ink/tree/tags This post is mainly to give @y-lohse a chance to catch up with the JS version before I release an update to Inky :-) (no hurry, just let me know when you're ready!) I went with the
I decided not to have any formal dictionary structure, but instead just make them strings for simplicity, which echoes the way that ink works in general. The global and knot tags are actually just normal line tags, but easily accessible "statically" i.e. without running the ink, by peeking into the content. For example:
In C# if you call However, when running your ink, if you divert into the knot and call Finally, since it's on a separate line that comes after a valid line of content, you'll have to call |
Thanks for the heads up! And the engine changes seem quite small (again!) so that's good to see. |
I'd suggest we agree on a standard global tag format convention for basic story metadata. This won't be useful for many circumstances since ink is designed primarily as a single layer in a stack. But, it's good to have nonetheless - my proposal is simple:
(So the strings extracted by ink will be literally Could also make use of this information in Inky in order to set the I also wrote some quick instructions for how to grab the global tags out of an ink's json if you don't want to fully load up the story. This might be of dubious usefulness, but anyway: To get global tags from a story's JSON without actually loading the full story:
|
I'll be happy to add title-snarfing support to Lectrote when this is released in inkjs. A method on Story that returns the global tags (as described in previous comment) would be ideal. |
@joethephish I'm done porting the changes! Would you mind providing me with an ink file that has some tags in it so I can see if it works as expected? |
Nice! Maybe take a look at the tags unit test? |
That looks good but I need the compiled version of the ink, and I don't believe the public versions of inklecate can do this at the moment? |
Good point! There's a branch, but it's easy for me to just give it to you, so here you go:
Which was compiled from:
|
Perfect, thanks! I'll play with that. |
Everything seems to work as expected on my end, so we can go ahead with the release whenever you want :-) |
Okay, 0.6.0 is out now. Will release new version of inky when inkjs is ready :) (phew!) |
Hmm, I'm getting an error when running a hello world program:
This is when running in Chrome, so I guess it's not because it's a modern JS feature? |
Ehm... where did you find that code block? 😕 I just checked the source from release 1.3.0 again and can't find it..? |
Oh, odd! I'm pulling 1.3.0 from npm, and ink.js does indeed seem to be different from the version on github, and it tells me the modification date is 3rd October... (I'm an npm noob, not sure if I'm doing something wrong? I did |
Aaah, I see. If you update to 1.3.1, everything should be ok. Longer version: inkjs has these 3 files (ink, ink.min and ink-es2015) but only the es-2015 is useful for node.js, so my intention was to only publish that one via npm — and I thought I was. But it turns out npm publishes whatever it finds inside my local |
Wonderful! That works great. Next Inky release incoming :) |
There have been a few requirements for some kind of tagging / metadata in ink, and after giving it some thought, I was thinking of something like the following.
The basic syntax is a
@
character, followed by a user-string that is terminated by the end of a line.Global tags
Useful for adding metadata to a (root) ink file at global scope. There would be a way to access a global tags dictionary, or a simple array of strings.
author
andtitle
are defined by convention rather than being specific syntax - they're just keys, or they're part of the full string following@
. They could be used to set up properties when exporting to web from Inky, and when loading up an ink story in @erkyrath's Lectrote.Knot tags
It might be useful to associate arbitrary metadata to knots (and stitches), so that it's possible to query certain properties about them without running them. For example, this could've been used 80 Days to determine the pre-condition for travel to a particular location, to be used on the game layer.
Line tags
Finally, the tags could be generalised to any line at all, with it possible to get a
currentTags
property at the same time as getting main content from the engine. And tags which are seen by the engine while evaluating will be added to an array. e.g....where
face:surly
is a tag string that can be parsed by the game so that a specific portrait can be displayed.Currently we're using a
#
convention, with the string being extracted by the game by hand. And that works fine, but it just seems like a built-in system might be useful more widely.The text was updated successfully, but these errors were encountered: