Hey, I know I've seen this kind of thing done before, but I'm not sure how to find the examples again.
What I'd like do do is something like this:
<<widget "setStats">><<set $player.str to $startingStats.$args[0]+$args[1][0]>><</widget>>
Given that $args[0]+$args[1] = "humanmale", and that $startingStats.humanmale holds an array of numbers, the first of which is 17. I'm thinking I should be able to get to those numbers like this somehow, but, I can't remember what syntax I need for this. I know this is possible, just... can't figure out how to do this.
So, we've got :
$args[0] = "human"
$args[1] = "male"
$startingStats.humanmale[0] = 17
How do I properly join and then evaluate the property in order to access it?
Comments
<<widget "setStats">><<set $player.str to $startingStats[$args[0]+$args[1]][0]>><</widget>>
(ie, without the dot notation.)