Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Dynamic Creation of a Variable Name in Harlowe?

$
0
0
I'm creating Roman names at random as needed to create characters in my experimental interactive historical text Path of Honors (philome.la/gamingthepast
For reasons that I've sort of forgotten, I have five arrays each of 10 strings that are plebeian family names called $plebNomen1, $plebNomen2, $plebNomen3, $plebNomen4, and $plebNomen5.

Is there a way in Harlow to randomly choose one of these lists to draw from using dynamic naming instead of using a cumbersome set of conditionals? So is something like this possible:

1. Create a random number from 1 to 5 and store it in an variable, call it $index for sake of argument
2. Concatenate the "$" + "plebNomen" + $index and use the whole thing as the variable name "$plebNomen1" , $plebNomen2" and so on?

I should add that what I need at the moment is to generate syntax like this (if it can be done):
$plebNomenList1's $index
So I can pick a random element within one of the $pleNomen list arrays

Thanks!!!

Viewing all articles
Browse latest Browse all 1844

Trending Articles