0 votes
by (330 points)

So I'm wondering if there's any way to use part of one variable as a second variable. The game I'm building includes a mistaken-identity foul-up, so what I'd like to do is set up a quasi-random name change based on the character's first name. Therefore, I'll be using textboxes to allow the player to input his first and last names, and I'd like to use the variable $firstname to determine the second variable, $initial. I'd then be using the $initial variable later on to give the character a name and identity (s)he wasn't born with and probably definitely doesn't want, using random numbers and a short list of first and last names.

1 Answer

0 votes
by (68.6k points)
selected by
 
Best answer

If you're asking how to assign the first character of the $firstname variable to the $initial variable, then you may do something like the following:

<<set $initial to $firstname[0]>>

 

by (330 points)
Jesus, that was FAR too easy! Why are so many Twine commands kinda-SORTA like javascript commands, but just different enough to screw you up when you try to use them?  ;)

Anyway, thanks a lot!
...