Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 17th Dec 2015 at 8:14 AM
Default How to make objects cleanable before they get completely dirty
In previous series, sims could clean objects now and then to prevent them from becoming dirty. I don't understand why EA changed this in SIMS 4 and want to have it fixed.
But I don't know how to do that.Will it be a tuning mod or it needs some scripting?
Besides,I found this in ServiceNPC.tdes
Quote:
<TunableTuple name="fake_perform_job" class="TunableModifyAllLotItems" display="Fake Perform Job" muid="2ECD61842C2172FD" description="Tune modifications to apply to all objects on a lot.&#xA;Can do state changes, destroy certain items, etc.&#xA;&#xA;EX: for auto cleaning, tune to have objects with Dirtiness state that&#xA;equals dirty to be set to the clean state and tune to have dirty dishes&#xA;and spoiled food to be deleted" Deprecated="False" filter="0" group="General">

Dose it mean that in order to make the change works on maids,I have to edit their files as well?

Maids are completely useless presently.Every day when maids come to your house,things are not dirty.Every time when things need cleanning,maids are not in your house.In fact,this is the most important reason why I want to modify it.

Or maybe someone else could make this mod because I am grand new to modding perhaps it's too difficult and I'm not able to make it.

Thanks.
Pettifogging Legalist!
retired moderator
#2 Old 17th Dec 2015 at 9:27 AM Last edited by plasticbox : 17th Dec 2015 at 9:43 AM.
The objects have a dirty state that also fires the "UglySmell" broadcaster - i.e. a thing is either dirty or not as far as sims are concerned, there is no "a little dirty". The cleaning interactions are checking for that state:

Code:
    <V t="state">
      <U n="state">
        <E n="operator">EQUAL</E>
        <T n="value">15131<!--ObjectStateValue: DirtyState_Dirty--></T>
      </U>
    </V>


(from S4_E882D22F_00000000_000000000000379F.xml, sink_Clean, in test_globals)

so if you'd remove that test, it should result in the item always being cleanable. Unless I'm forgetting something, that shoudl be a pretty simple tuning mod (or rather, a handful of them since there's various different cleaning interactions) -- seems very do-able even if you haven't made any tuning mods before.


It might be possible to override/remove that sort of test via a script as well, but I can't really tell you how to do that. That might come with the advantage that you don't need to update every time a patch modifies the object tuning .. OTOH, finding those tests looks not very complicated (search the entire XML folder, save all to a new location, batch search + replace and save), so it wouldn't necessarily be a big annoyance.


ETA: you could also change the test to check for dirty *or* neutral -- I haven't checked if all objects can have a neutral state, but the state itself exists (there's three of them: clean, neutral, dirty). That way your sims wouldn't appear quite so neurotic, cleaning perfectly clean sinks all the time =P


(Requests are not permitted on this site btw.)

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Test Subject
Original Poster
#3 Old 17th Dec 2015 at 10:42 AM
Quote: Originally posted by plasticbox
The objects have a dirty state that also fires the "UglySmell" broadcaster - i.e. a thing is either dirty or not as far as sims are concerned, there is no "a little dirty". The cleaning interactions are checking for that state:

Code:
    <V t="state">
      <U n="state">
        <E n="operator">EQUAL</E>
        <T n="value">15131<!--ObjectStateValue: DirtyState_Dirty--></T>
      </U>
    </V>


(from S4_E882D22F_00000000_000000000000379F.xml, sink_Clean, in test_globals)

so if you'd remove that test, it should result in the item always being cleanable. Unless I'm forgetting something, that shoudl be a pretty simple tuning mod (or rather, a handful of them since there's various different cleaning interactions) -- seems very do-able even if you haven't made any tuning mods before.


It might be possible to override/remove that sort of test via a script as well, but I can't really tell you how to do that. That might come with the advantage that you don't need to update every time a patch modifies the object tuning .. OTOH, finding those tests looks not very complicated (search the entire XML folder, save all to a new location, batch search + replace and save), so it wouldn't necessarily be a big annoyance.


ETA: you could also change the test to check for dirty *or* neutral -- I haven't checked if all objects can have a neutral state, but the state itself exists (there's three of them: clean, neutral, dirty). That way your sims wouldn't appear quite so neurotic, cleaning perfectly clean sinks all the time =P


(Requests are not permitted on this site btw.)

Thanks,I'll try the neutral state.

My original thought on this :
Since objects become dirty after several use there must be a property or something stored somewhere to record that.Mabye I can change the test from checking for dirty state to directly checking that value .
Pettifogging Legalist!
retired moderator
#4 Old 17th Dec 2015 at 11:47 AM
Yes there is a range (16575, commodity_dirtiness); the Dirty state gets set when that is above 50 IIRC. See CommodityBasedObjectStateValue.tdesc (and also Commodity.tdesc, in Statistics):

"The commodity range this state maps to. The ranges between the commodity values must have some overlap in order for the state to transition properly. For instance, let's say you have two states, DIRTY and CLEAN. If you set the DIRTY state to have a range between 0 and 20, and you set CLEAN state to have a range of 21 to 100, the states will not change properly because of the void created (between 20 and 21). At the very least, the lower bounds of one needs to be the same as the upper bound for the next (i.e. DIRTY from 0 to 20 and CLEAN from 20 to 100)."

This gets increased every time a sim uses the item.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Test Subject
Original Poster
#5 Old 17th Dec 2015 at 1:37 PM
Well,I think I messed something up.Some objects became dirty after one use and there wasn't the "Clean" interaction,others seems to have no difference.
What I did is adding a new element to the tesing section,like this
Quote:
<V t="state">
<U n="state">
<E n="operator">EQUAL</E>
<T n="value">15131<!--ObjectStateValue: DirtyState_Dirty--></T>
<E n="who">Object</E>
</U>
</V>
<V t="state">
<U n="state">
<E n="operator">EQUAL</E>
<T n="value">101103<!--ObjectStateValue: DirtyState_Neutrality--></T>
<E n="who">Object</E>
</U>
</V>
Test Subject
Original Poster
#6 Old 17th Dec 2015 at 2:45 PM
I think I get it.
Every interaction has two types of tests:test_globals and test.
test_gloabls specific the basic requirements of the interaction,such as age,buff,basic ObjectState ect. and they are in one <L> element so all the requirements must be met.
Quote:
test
is used to specific more detailed requirements , you can use several <L> elements to set individual requirements.

The "Clean" interaction didn't show up because I put two conditions in one single <L> element ,which means object must be dirty and neutral at the same time in order to make the interaction valid.

And I fount this in the xml file of messageTable_clean
Quote:
<L>
<V t="situation_job_test">
<U n="situation_job_test">
<L n="situation_jobs">
<T>118593<!--SituationJob: jobs_MassageTherapist_Service--></T>
<T>117815<!--SituationJob: jobs_RelaxationVenue_MassageTherapist--></T>
</L>
</U>
</V>
<V t="statistic">
<U n="statistic">
<T n="stat">16575<!--Commodity: commodity_dirtiness--></T>
<V n="threshold" t="value_threshold">
<U n="value_threshold">
<E n="comparison">LESS_OR_EQUAL</E>
<T n="value">50</T>
</U>
</V>
<E n="who">Object</E>
</U>
</V>
</L>
</L>


It says when actors have the corresponding job,they can clean the message table if commodity_dirtiness is less than or equal to 50.
According to this,I changed the sink_Clean file to this:
Quote:
<L n="test_globals">
<V t="buff">
<U n="buff">
<L n="blacklist">
<T>26171<!--Buff: buff_Sim_IsDying--></T>
</L>
</U>
</V>
<V t="sim_info">
<U n="sim_info">
<V t="specified" n="ages">
<L n="specified">
<E>TEEN</E>
<E>YOUNGADULT</E>
<E>ADULT</E>
<E>ELDER</E>
</L>
</V>
<E n="who">Actor</E>
</U>
</V>
<V t="statistic">
<U n="statistic">
<T n="stat">16575<!--Commodity: commodity_dirtiness--></T>
<V n="threshold" t="value_threshold">
<U n="value_threshold">
<E n="comparison">LESS_OR_EQUAL</E>
<T n="value">60</T>
</U>
</V>
<E n="who">Object</E>
</U>
</V>

<V t="location">
<U n="location">
<U n="location_tests">
<V n="is_in_slot" t="enabled">
<U n="enabled">
<T n="require_slotted">False</T>
<V t="enabled" n="slot_type">
<T n="enabled">slotSet_ApplianceSurface</T>
</V>
</U>
</V>
</U>
<E n="subject">Object</E>
</U>
</V>
<V t="mood">
<U n="mood">
<T n="disallow">True</T>
<T n="mood">14633<!--Mood: Mood_Bored--></T>
<V n="tooltip" t="enabled">
<T n="enabled">0x95B2F454</T>
</V>
</U>
</V>
</L>

It works!
Now sims can clean sink after 5 use.
Pettifogging Legalist!
retired moderator
#7 Old 17th Dec 2015 at 8:00 PM
Good job! Thanks for sharing your progress =)

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Test Subject
Original Poster
#8 Old 19th Dec 2015 at 5:23 AM
I plan to improve this further more.
Sims with different traits will have the interactions available at different dirtiness value.
Maids should be able to clean things after a single use,which guarantees they clean the house every day.
And I also have to slower the clean speed or it will complete too quickly.
Besides,I want to add a debuff to the sim who cleans a completely dirty toilet.

Well,a lot of things to do.
Back to top