Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Custom Inline Tags?

A topic by digiwombat created May 12, 2021 Views: 185 Replies: 2
Viewing posts 1 to 3
(1 edit)

Hey,

Is there a way to add custom inline tags? I know that <e> can be used, though it is a bit limiting as far as expanding beyond single calls. I could do <e=something,something> and do delimiter splitting and so on, but that could get a bit heavy, but it would be great if we could get a way to inject our own custom tags to really tie the reader into our own logic more deeply if there's not already a way.

Asking in case I missed it, otherwise I'd like to request it as a general "please give it a look" type thing. It would certainly help me out a bunch.

Alright, I'm back off to the code mines. Thanks for your time. :D

Developer

Hey!

So, in the example folders there's a script called "STMPreparse3.cs" which I think does what you're after. (The preparsing scripts' Parse method should be invoked with STM's OnPreparseEvent in the inspector.) This one example script demonstrates a <transcribe> tag that changes all instances of "A" inside it to "aaa" and all instances of "B" inside it to "bbb" until it is cancelled with </transcribe>, as an example. In reality, this type of thing is really useful if you have something like... a custom event tag you'll be typing a LOT. You can have "<g>" get replaced with "<e=myReallyReallyLongCustomEvent>" and STM should know what to do with it.

I hope this works for you! What did you have in mind for your project in terms of custom tags? I can help write up a custom preparsing script if the example doesn't work for your situation.

There's a lot of functions like this that STM has that are hidden away in additional components... (ruby text, alternate outline generator, pagination) I'm thinking of making these system either easier to use or entirely built-in to the STM components for a future major update, but that'll probably be STM 2.0! Someday...

Thanks for pointing me in the right direction, I'll take a look at it.

And STM 2.0 will happen one day. I believe in you! WE ALL DO!