Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

[Harlowe] Making characters from a string "leak" into another using string positions and (live:)?

edited September 2016 in Help! with 2.0
Hey all,
I'm working on a piece about corroding memories and I've managed to get the following working to my liking:
(live: $corruptionspeed)[(put: (either: ...$replacementstring) into $memory03's (random: 1, $memory03's length))]

This is taking a random character from $replacementstring and inserting it randomly into $memory03.

What I'd like to be able to do next is take a random character from $memory02 and place it into the *same position* in $memory03. I've tried a couple variations on the following but it's just not having it:
(live: $corruptionspeed)[(set: $leakposition to (random: 1, $memory02's length))(set: $leakingchar to $memory02's $leakposition)(put: $leakingchar into $memory03's $leakposition)]

I don't seem to be able to use $leakposition as a numerical (e.g. nth) position in a string.
Any ideas?

Comments

  • Similar issues using (put:) have come up before.

    Try one of the following, they should both work:
    <!-- Use (set:) instead of (put:). -->
    (set: $memory03's $leakposition to $leakingchar)
    
    <!-- Use (put:), but wrap $leakingchar within (text:). -->
    (put: (text: $leakingchar) into $memory03's $leakposition)
    
  • Ah superb. I used to 2nd method; works a charm.
Sign In or Register to comment.