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

Getting a number from adding strings of variables?

$
0
0
Basically I'm setting monsters race, $npc.race, as either "$race1", "$race2" etc and having the actual $race1 etc being objects that house that race of monsters stats. I need to get to a number that is say, kept in $race1.variable.

So I need to be able to add $npc.race (returns $race1) and .variable together to get at the number kept in $race1.variable.

The only way I am able to figure out how to do this, it gives me strings. I have also tried Number() and parseInt(), but those return blank.

What trick am I missing?

Viewing all articles
Browse latest Browse all 1844

Trending Articles