Whatchu talkin’ bout Willis?

I’ve spent most of my weekend trying to sort out a system for parsing text from an Ink script to display paragraph-by-paragraph when the user presses a button.  Easy enough in itself as the Unity integration allows you to call each individual line that makes up the body of the current ‘continue’ (i.e. all text before the start of the next choice list).  However, it becomes more problematic if the text is longer than the text view area.

What I essentially wanted was the following:

  1. If the line of text is shorter than a defined length (a variable found through trial and error) display that
  2. If not then split it into smaller chunks…
    1. If the text has a defined punctuation (. ? or !) then split it there
    2. If not…
      1. If there’s a comma roughly halfway through replace the comma with ellipses and split there
      2. If there’s not,  do the same but with a space

Again, doesn’t sound particularly problematic but had issues with trying to get it to work.  Such as:

  1. For some reason I went through this whole process of taking the text Unity/Ink automatically supplies and split it up myself initially, which took a fair while figuring that out.  It’s only when I started writing this I realised I could take the Unity/Ink currentText call and dump that into the string list instead.
  2. It took a while to figure out how to break up longer text based on punctuation and keep that punctuation in place (the Split function I was using was removing the character it was splitting on).
  3. Likewise, figuring out how to break long strings into shorter ones using ellipses took a while
  4. Had to figure out how to work around ‘unwanted’ punctuation.  The one that cropped up in my example text (entirely coincidental it was in there in the first place) was an e.g. which it was reading as being a full stop.  Similarly, don’t want it picking up duplicate or mixed punctuation (??, !! or !?!?).  Turns out the easiest way is to temporarily replace it with some dummy text and replace it back again.

When I write it down like that it makes me realise how little I know as that seems simple yet took me a fair while!

There’s still more to do though:

  1. Get the flow working as per the user input.  At the moment any non-broken line is printing when you hit enter, but anything broken up prints all the parts at once (mostly for me to test it is breaking up correctly)
  2. Currently doesn’t account for if a broken piece of text using ellipses is longer than two screens (for the purpose of testing I’ve just split it into two chunks, but in reality it could be more if its a very long piece of text with no sentences).
  3. Need to test with different text.  I set up a test text script, but want to check it is working properly using some more test scripts.
  4. Allow flexibility of the line length value depending on language
  5. Need to allow for a dictionary of sorts for the temporary text replacements and have Unity run through that and replace as/when it finds them, rather than just a series of hand-written replace functions at the moment.
  6. Ideally also have some way of knowing if punctuation is strung together (!?!?!) without having to write each possible variation

I’m sure there’s probably an asset or something I could have downloaded to do all this, although having a quick look most of the things I could find seem to predate Unity’s new(ish) UI system.  Although I didn’t look too hard.  Plus they’re not designed for Ink (although undoubtedly I would have been able to middleware it myself).

However, it was educational (if at times painful) so I’m happy I stuck with it.  Just need to finish it off, preferably before I go back home for Christmas.


We often talk about balance as only having two things to maintain; work and life, good and evil, credit and debit.  In terms of pursuing creative interests that is often unnecessarily reductive.  My life isn’t just about balancing the work I want to achieve with everything else, it’s about balancing all those components.

Life isn’t a scale of two equal containers that you try and level out, it’s one of many containers of various sizes that change frequently.  At presently I’m trying to balance the creative work I want to pursue with actual paid work along with trying to learn Italian, socialising/networking, exercise, resting (be it sleeping or just chilling out), general adult responsibilities and other responsibilities.

I have a tendency to try and do it all, to try and push ahead to do all sorts at once.  It leads to burn out and its where I’m heading to at the moment and guilt pushes a lot of it through.  I know things need to give, and unfortunately at the moment that’s primarily exercise and sleeping (the latter isn’t necessarily intentional as much as it is a consequence of being a bad sleeper anyway).

I constantly feel like I could, and should, be doing more to achieve my creative pursuits.  It’s an inferiority complex mixed in with impostor syndrome – look at that person, they’ve achieved so much and are younger because they work harder/smarter.

My “paid job” (as it gets known) recently asked if I want to extend my contract through to the end of July.  It’s easy work, well paid and flexible and part-time so it’s silly to say no, but every time I take on something like this it feels like I’m taking away from what I want to do.  It feels like I’m admitting failure.  “Oh yes, I’ll do this work because I’ve not been successful with the work I wish to do instead”.

I know this isn’t true.  I know that we often don’t see the toil and work people go through and focus on the end goals and the logical part of me can tell myself this, but there are still weeks where I look at what is ahead of me and how much time I’ll have to do my own stuff and feel guilty; guilty about having other plans, guilty about not doing enough.  It also doesn’t help that I’m still learning and still at the development stage of projects so there is little tangible output.  Little I can post for #screenshotsaturday and it doesn’t sound particularly exciting when someone asks me how my personal work is going if I say “not bad, managed to figure out how to parse particular phrases from a JSON query which I’ll then use to trigger actions”.  Even though this is an achievement it fails to look as impressive as a nice shiny gif.

I’m trying to take responsible steps to ease my workload and to keep my mind in a positive position, but self-doubt is a hard one to squish.  I guess I’m just typing this out to acknowledge how I’m feeling and where I’m at.  I’m my own biggest critic after all.  Since starting this pursuit I’ve been thinking a lot about mental welfare when it comes to creative pursuits.  There’s still this toxic attitude that success has to come at a cost to one’s state of being.  Suffer for your art.  Crunch is essential.  It will be worth it.

I guess I need a support network and even just thinking that makes me wonder how one would go about setting that up in the interest of the creativity community and I have to stop my mind from thinking about all of that.  I get distracted easily.  I have a desire to do too much at once.  I want to prove I can.  Prove I am as good as I want to be.

Scroll To Top