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!
Test Subject
Original Poster
#1 Old 3rd Jul 2018 at 9:51 AM
Default Custrom statistic, use as motive for interaction
I have a custom statistic, which I can use to trigger applying a buff etc so seems to be working.

I have also made an interaction which works fine when triggered manually. I would like to make the sim use the interaction when the custom statistic has a certain value (like how a sim eats when hungry etc).

I am not sure how this works, I have tried using the below but it does not work, anyone have any ideas?

Code:
<L n="test_autonomous">
    <V t="motive">
        <U n="motive">
          <L n="stats"> 
            <T>[myStatisticID]</T>
          </L>
          <U n="threshold">
            <E n="comparison">GREATER_OR_EQUAL</E>
            <T n="value">1</T>
          </U>
    	</U>
	</V>
</L>
Advertisement
Deceased
#2 Old 3rd Jul 2018 at 10:02 PM
What you've posted will test to see if the Sim is allowed to do the interaction autonomously, but it won't push that interaction onto the Sim. What you want is to set a commodity_distress or failure on the statistic itself, and that can then push an interaction (see motive_hunger for example).

Now, as I understand it, you're wanting the interaction to occur when the statistic goes high, correct? If there's no easy way for you to change that to the other direction (trigger interaction when it goes low) then you will not want to use a commodity_distress as it can't have a comparison direction tuned for the threshold, it will only trigger when a statistic goes lower than the threshold.

Commodity failure, on the other hand, can have a comparison tuned for the threshold, and by default is set to check if the statistic is greater or equal to the threshold (default of -100). This is why in the commodity_failure of motive_hunger, the value isn't set (so defaults to -100) but the comparison is set to LESS_OR_EQUAL so Sims die when hunger motive goes low. By leaving the comparison to default (or explicitly setting to GREATER_OR_EQUAL) then the interaction will trigger whenever the statistic goes over the value you set for the threshold.

Hope this makes sense and is helpful.
Test Subject
Original Poster
#3 Old 4th Jul 2018 at 9:31 AM
Quote: Originally posted by scumbumbo
Hope this makes sense and is helpful.


It does make sense, but still not working. I have the below in my statistic but the interaction never happens. If I apply a buff instead that appears just fine. The interaction is on an object (not the actor) does that make a difference?
Code:
<?xml version="1.0" encoding="utf-8"?>
<I c="Commodity" i="statistic" m="statistics.commodity" n="commodity_MyCommodity" s="465481">
  <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">0</T>
  <U n="initial_tuning">
    <T n="_use_auto_satisfy_curve_as_initial_value">False</T>
    <T n="_value">0</T>
  </U>
  <T n="max_value_tuning">5</T>
  <T n="maximum_auto_satisfy_time">1440</T>
  <T n="min_value_tuning">0</T>
  <T n="ui_sort_order">0</T>
  <T n="ui_visible_distress_threshold">0</T>
  <T n="visible">False</T>
  <T n="weight">1</T>
  <V n="commodity_failure" t="enabled">
    <U n="enabled">
      <L n="failure_interactions">
        <T>3805315801953806928</T>
      </L>
      <U n="threshold">
        <E n="comparison">GREATER_OR_EQUAL</E>
        <T n="value">4</T>
      </U>
    </U>
  </V>
</I>
Deceased
#4 Old 4th Jul 2018 at 10:18 AM
Quote: Originally posted by theronlas
The interaction is on an object (not the actor) does that make a difference?

Yes, that seems highly likely.
Deceased
#5 Old 4th Jul 2018 at 7:42 PM
Looking at the sims bladder distress, it triggers a non-autonomous animation-only action onto the Sim, sim_BladderDistress, which then uses a post_run_autonomy_commodities tuning to indicate that the Sim should choose an autonomous action to solve the motive_Bladder commodity. This then would seek out an autonomous action (which could be on an object then, e.g. toilet-use-sitting) to solve for the commodity. Of course, this is just to force the action to occur - if you don't want it to be forced then it shouldn't need to be pushed.

Most importantly -- are you sure the autonomy code for the action is setup properly that it will ever occur autonomously? It should have at least something to suggest to the Sim that the interaction will solve that commodity, either an autonomous desire or an advertised statistics change (could be a false advertisement, of course).

I definitely think having the statistic want to be high, and trigger when it goes low, would be a good design change. For instance, a statistic_change advertisement has the SIm wanting a postiive change to the commodity, a negative change to a statistic does not make that autonomous action desireable to a Sim. Motive commoditys decay to a low value and SIm's want to bring them back to high which is encouraged by the statistic advertisements.
Back to top