Forum Announcement, Click Here to Read More From EA_Cade.

Quick question about commodities

TriplisTriplis Posts: 3,048 Member
So, code probably still displaying weirdly, but I'll try to copy/paste anyway for demonstration (edit: oh yay, code tags seem to be working right again):

This is straight from commodity_Trait_Toddler_Silly_RandomlyGetsPlayful
<?xml version="1.0" encoding="utf-8"?>
<I c="Commodity" i="statistic" m="statistics.commodity" n="commodity_Trait_Toddler_Silly_RandomlyGetsPlayful" s="143288">
  <T n="_add_if_not_in_tracker">False</T>
  <T n="_default_convergence_value">0</T>
  <U n="arrow_data">
    <T n="negative_double_arrow">-20</T>
    <T n="negative_single_arrow">-1</T>
    <T n="negative_triple_arrow">-30</T>
    <T n="positive_double_arrow">20</T>
    <T n="positive_single_arrow">1</T>
    <T n="positive_triple_arrow">30</T>
  </U>
  <T n="auto_satisfy_curve_random_time_offset">120</T>
  <T n="decay_rate">1</T>
  <U n="initial_tuning">
    <T n="_use_auto_satisfy_curve_as_initial_value">False</T>
    <T n="_use_stat_value_on_init">True</T>
    <T n="_value">400</T>
  </U>
  <T n="max_value_tuning">1680</T>
  <T n="maximum_auto_satisfy_time">1440</T>
  <T n="min_value_tuning">0</T>
  <T n="remove_on_convergence">False</T>
  <L n="states">
    <U>
      <L n="loot_list_on_enter">
        <T>143289<!--LootActions: loot_Buff_Trait_Toddler_Silly_GetSilly--></T>
      </L>
      <T n="value">0</T>
    </U>
    <U>
      <T n="value">1</T>
    </U>
  </L>
  <T n="ui_sort_order">0</T>
  <T n="ui_visible_distress_threshold">0</T>
  <T n="weight">1</T>
</I>

My question is, I'm pretty sure I get that under "states" 0 is literally just 0. It's when the commodity hits the min_value_tuning.

But I'm not totally getting the purpose of the 1 state. Is it just a programming quirk of a true/false structure where there needs to be a binary 1/0 with a state for each and that's all it serves a purpose in being? Cause it clearly doesn't have an attribute that triggers from it. It just exists as an alternative to 0.

I'm guessing I'm just struggling with this because I'm very tired. Something tells me that the reason it's there, is if it wasn't, the commodity would default to the 0 state, no matter what numerical value the commodity was at, simply because it's the only state that exists.

Whereas with 1 existing, it somehow knows to treat it as "1 or greater"? And then it treats that as the state for anything above 0?
Mods moved from MTS, now hosted at: https://triplis.github.io
Sign In or Register to comment.
Return to top