In my game, I've created a set of NPCs with randomly generated traits.
<<set _npcNameList to [
'Minsc',
'Jaheira',
'Dynaheir',
'Imoen',
'Dorn',
'Viconia']>>
<<set $npc1 to {},
$npc1.name to _npcNameList.pluck(),
$npc1.strength to random(3,18),
$npc1.intelligence to random(3,18),
$npc1.dexterity to random(3,18)>>
<<set $npc2 to {},
$npc2.name to _npcNameList.pluck(),
$npc2.strength to random(3,18),
$npc2.intelligence to random(3,18),
$npc2.dexterity to random(3,18)>>
<<set $npc3 to {},
$npc3.name to _npcNameList.pluck(),
$npc3.strength to random(3,18),
$npc3.intelligence to random(3,18),
$npc3.dexterity to random(3,18)>>
This creates three NPCs with a random name and random ability scores.
What I'd really like is for the game to display a comparative analysis of the new NPCs. Something like:
Dorn is the strongest. Dynaheir and Imoen are the most intelligent. Imoen is the most dextrous.
I could do this with a million <<if>> statements, but is there a more intelligent way to go about this?