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!
Field Researcher
Original Poster
#1 Old 25th Sep 2018 at 7:32 PM Last edited by Miss Puff : 25th Sep 2018 at 9:23 PM.
Default A (Hopefully) Quick Question about Autonmous Tests
I've been playing around with adding some more complicated tests for whether or not sims will do interactions autonomously, and I think I've figured out how it works, but I'm not 100% sure, so I just wanted some confirmation of whether I'm doing it right.

So, basically, it seems the syntax is like this:

<L n="test_autonomous">
<L>
<!-- Test 1 -->
</L>
<L>
<!-- Test 2 -->
</L>
<L>
<!-- Test 3 -->
</L>
</L>

And I'm guessing how it works is that if Test 1 succeeds, the sim can do the action, and it stops checking. If Test 1 fails, then it checks Test 2. If Test 2 succeeds it stops checking, if it fails, Test 3 is checked, and so on until it either finds one that succeeds or they all fail and the sim can't do the action autonomously.

I'm asking because I'm trying to mod the Make a Mess interaction that (among other things) only allows sims with very negative responsibility values to do it autonomously, but still won't allow them to do it if the cooldown buff for the interaction is still active. Will the following xml code do what I'm trying to do?

Code:
  <L n="test_autonomous">
    <L>
      <V t="buff">
        <U n="buff">
          <L n="blacklist">
            <T>168756<!--Buff: buffs_MakeAMess_Cooldown--></T>
          </L>
        </U>
      </V>
    </L>
    <L>
      <V t="buff">
        <U n="buff">
          <V n="whitelist" t="enabled">
            <L n="enabled">
              <T>168270<!--Buff: buff_LifeSkills_Autonomy_Responsibility_VeryNegative--></T>
            </L>
          </V>
        </U>
      </V>
    </L>
  <L>

Sorry if this seems obvious, but I've been messing around with this for awhile with a lot of trial and error to get to this point, and I just want to know if I've actually got it figured out now, or if I'm still off on my understanding somewhere.

EDIT:
The other option I'm thinking, is that if ANY of the tests are true they can do it autonomously, in which case I don't know if there's a way to do what I'm trying to do.
Advertisement
Deceased
#2 Old 25th Sep 2018 at 9:51 PM
Indeed, that's the basics of it. What is important to realize is that it is a list of LISTS of tests. Or another way to think of it is as a list of test sets. If everything in any one of the test sets is true, then the interaction can be considered for autonomous (still subject to all other tests in test_globals and tests). It's a list of ORS of ANDS is another way to think of it. So your basic example can be expanded on like so:
Code:
<L n="test_autonomous">
 <L>
    <!-- Test 1a -->
    <!-- Test 1b -->
  </L>
  <L>
    <!-- Test 2 -->
  </L>
  <L>
    <!-- Test 3a -->
    <!-- Test 3b -->
  </L>
</L>

and that is interpreted as:
Code:
IF (Test1a AND Test1b are true)
   OR (Test2 is true)
   OR (Test3a AND Test3b are true)
THEN allow auotonomy


So for your goal of testing that both the cooldown and responsibility tests are both true, you should put both tests into the same sub-list, like so:
Code:
<L n="test_autonomous">
  <L>
    <V t="buff">
      <U n="buff">
        <L n="blacklist">
          <T>168756<!--Buff: buffs_MakeAMess_Cooldown--></T>
        </L>
      </U>
    </V>
    <V t="buff">
      <U n="buff">
        <V n="whitelist" t="enabled">
          <L n="enabled">
            <T>168270<!--Buff: buff_LifeSkills_Autonomy_Responsibility_VeryNegative--></T>
          </L>
        </V>
      </U>
    </V>
  </L>
</L>
Field Researcher
Original Poster
#3 Old 25th Sep 2018 at 9:56 PM
Oh that's great, thank you, thank you! Makes perfect sense now.
Back to top