I have hit yet another brick wall on my skills. This time, on random npc generation of love interests for the player.
A npc has more or less skills depending on age, and I don't know how to apply this condition to a random generation sheet.
In an ideal solution, it would generate always an opposite sex npc, a random race, and distribute a certain amount of points between the skills on their sheet.
I know what I'm asking is rather complicated and possibly can't be done, but I like forcing the limits.
(set: $sex to (either: "male", "female"), $race to (either: "human", "elf", "half elf", "half orc", "dwarf", "halfling", "gnome", "half ogre"), $Bartering to (random: 5,10), $Computers to (random: 0,10), $Construction to (random: 0,10), $Cooking to (random: 0,10), $Driving to (random: 0,10))
Comments
The code I pasted works just fine, but it's just an example. It can't auto-assign the points at npc generation.
Sorry for the lack of explanation. My mind is burned at this point.
You click on the "random" option, and it creates a random, ready to play character for you.
The following also uses both Collapsing whitespace markup and Escaped line break markup to reduce the number of blank lines showing in the resulting page which are caused by using extra line-breaks to make the code more readable.
(link: "Random")[(set: $sex to (either: "male", "female"), $race to (either: "human", "elf", "half elf", "half orc", "dwarf", "halfling", "gnome", "half ogre"), $Bartering to (random: 5,10), $Computers to (random: 0,10), $Construction to (random: 0,10), $Cooking to (random: 0,10), $Driving to (random: 0,10)) ] That's just the code that you said worked but didn't work, but it runs when someone clicks the random button. Sorry if this sounds offensive. I'm just confused.
Thank you! your answer worked like a charm, with one exception: I modified the first part of the code to set the skills at 0 instead of being random, because otherwise the total skill points were higher than the pool, and some skills even went further than 10.
I really don't understand. What's wrong with the code that works but doesn't work? Surely just put that in a link macro or something and it would work. It randomly assigns skills to people?