Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 8th May 2024 at 4:09 PM
Default Trying to understaand weighted lists
There are multiple places where lists are weighted to make some possibilities more or less likely. But I rarely see anything other that "0" for the weight. And I also don't know if weights can be added to any list, or only ones that are already weighted.

For example, could I add weights to the random selector to make it so firefighters are more likely to get skills like handiness while nannies are more likely to get knitting?

This snippet of the "tunableWeightedTagList_Style_Default" file shows what I'm talking about. All these weights are "0", so no option is favored.
Code:
<U>
      <E n="tag">Style_FashionDistrict</E>
      <T n="weight">0</T>
    </U>
    <U>
      <E n="tag">Style_Festival_Blossom</E>
      <T n="weight">0</T>
    </U>
    <U>
      <E n="tag">Style_Festival_Dark</E>
      <T n="weight">0</T>
    </U>


If I changed it to this, would that make "FashionDistrict" five times as common as "Festival_Dark"?
Code:
<U>
      <E n="tag">Style_FashionDistrict</E>
      <T n="weight">5</T>
    </U>
    <U>
      <E n="tag">Style_Festival_Blossom</E>
      <T n="weight">2</T>
    </U>
    <U>
      <E n="tag">Style_Festival_Dark</E>
      <T n="weight">0</T>
    </U>



And could I add weights to this list to manipulate how likely certain outcomes were?
Code:
<U n="_skills">
    <V n="random" t="additional_random">
      <U n="additional_random">
        <L n="choices">
          <U>
            <T n="skill">16695<!--Skill: statistic_Skill_AdultMajor_Bartending--></T>
          </U>
          <U>
            <T n="skill">16699<!--Skill: statistic_Skill_AdultMajor_Charisma--></T>
          </U>
          <U>
            <T n="skill">16698<!--Skill: statistic_Skill_AdultMajor_Comedy--></T>
          </U>
          <U>
            <T n="skill">39397<!--Skill: statistic_Skill_AdultMajor_Fishing--></T>
          </U>
          <U>
            <T n="skill">16700<!--Skill: statistic_Skill_AdultMajor_Gardening--></T>
          </U>
          <U>
            <T n="skill">16702<!--Skill: statistic_Skill_AdultMajor_Guitar--></T>
          </U>
          <U>
            <T n="skill">16704<!--Skill: statistic_Skill_AdultMajor_Handiness--></T>
          </U>
          <U>
            <T n="skill">16705<!--Skill: statistic_Skill_AdultMajor_HomestyleCooking--></T>
          </U>
          <U>
            <T n="skill">16706<!--Skill: statistic_Skill_AdultMajor_Logic--></T>
          </U>
          <U>
            <T n="skill">16707<!--Skill: statistic_Skill_AdultMajor_Mischief--></T>
          </U>
          <U>
            <T n="skill">16708<!--Skill: statistic_Skill_AdultMajor_Painting--></T>
          </U>
          <U>
            <T n="skill">16709<!--Skill: statistic_Skill_AdultMajor_Piano--></T>
          </U>
          <U>
            <T n="skill">16703<!--Skill: statistic_Skill_AdultMajor_Programming--></T>
          </U>
          <U>
            <T n="skill">16710<!--Skill: statistic_Skill_AdultMajor_RocketScience--></T>
          </U>
          <U>
            <T n="skill">16712<!--Skill: statistic_Skill_AdultMajor_VideoGaming--></T>
          </U>
          <U>
            <T n="skill">16713<!--Skill: statistic_Skill_AdultMajor_Violin--></T>
          </U>
          <U>
            <T n="skill">16714<!--Skill: statistic_Skill_AdultMajor_Writing--></T>
          </U>
        </L>
        <U n="interval">
          <T n="lower_bound">2</T>
          <T n="upper_bound">4</T>
        </U>
      </U>
    </V>


Like so.
Code:
<U n="_skills">
    <V n="random" t="additional_random">
      <U n="additional_random">
        <L n="choices">
          <U>
            <T n="skill">16695<!--Skill: statistic_Skill_AdultMajor_Bartending--></T>
            <T n="weight">5</T>
          </U>
          <U>
            <T n="skill">16699<!--Skill: statistic_Skill_AdultMajor_Charisma--></T>
            <T n="weight">0</T>
          </U>
          <U>
            <T n="skill">16698<!--Skill: statistic_Skill_AdultMajor_Comedy--></T>
            <T n="weight">0</T>
          </U>
          <U>
            <T n="skill">39397<!--Skill: statistic_Skill_AdultMajor_Fishing--></T>
            <T n="weight">3</T>
          </U>
          <U>
            <T n="skill">16700<!--Skill: statistic_Skill_AdultMajor_Gardening--></T>
            <T n="weight">6</T>
          </U>
          <U>
            <T n="skill">16702<!--Skill: statistic_Skill_AdultMajor_Guitar--></T>
            <T n="weight">0</T>
          </U>
          <U>
            <T n="skill">16704<!--Skill: statistic_Skill_AdultMajor_Handiness--></T>
            <T n="weight">8</T>
          </U>
          <U>
            <T n="skill">16705<!--Skill: statistic_Skill_AdultMajor_HomestyleCooking--></T>
            <T n="weight">4</T>
          </U>
          <U>
            <T n="skill">16706<!--Skill: statistic_Skill_AdultMajor_Logic--></T>
            <T n="weight">5</T>
          </U>
          <U>
            <T n="skill">16707<!--Skill: statistic_Skill_AdultMajor_Mischief--></T>
            <T n="weight">0</T>
          </U>
          <U>
            <T n="skill">16708<!--Skill: statistic_Skill_AdultMajor_Painting--></T>
            <T n="weight">0</T>
          </U>
          <U>
            <T n="skill">16709<!--Skill: statistic_Skill_AdultMajor_Piano--></T>
            <T n="weight">0</T>
          </U>
          <U>
            <T n="skill">16703<!--Skill: statistic_Skill_AdultMajor_Programming--></T>
            <T n="weight">3</T>
          </U>
          <U>
            <T n="skill">16710<!--Skill: statistic_Skill_AdultMajor_RocketScience--></T>
            <T n="weight">1</T>
          </U>
          <U>
            <T n="skill">16712<!--Skill: statistic_Skill_AdultMajor_VideoGaming--></T>
            <T n="weight">0</T>
          </U>
          <U>
            <T n="skill">16713<!--Skill: statistic_Skill_AdultMajor_Violin--></T>
            <T n="weight">0</T>
          </U>
          <U>
            <T n="skill">16714<!--Skill: statistic_Skill_AdultMajor_Writing--></T>
            <T n="weight">2</T>
          </U>
        </L>
        <U n="interval">
          <T n="lower_bound">2</T>
          <T n="upper_bound">4</T>
        </U>
      </U>
    </V>


I can't find anything online about weighted lists. So I'm assuming it's a Maxis thing, not a standard XML feature. My guess is that the weights are just a value passed to the parser. Which means you can't add weights to a list that didn't come with them. I'm hoping I'm wrong.
Back to top