- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Discussion >
- Outfit change based on traits
- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Discussion >
- Outfit change based on traits
Replies: 5 (Who?), Viewed: 3140 times.
#1
12th May 2018 at 2:51 PM
Posts: 91
Thanks: 1231 in 6 Posts
Outfit change based on traits
Hi everyone! I'm trying to change the outfit worn by Sims when performing fitness activities (steamroom, massage and yoga) based on a particular traitE. G. When a Sim with the trait, for example, Romantic, is given a massage on the massage table, rather than switching to the towel, he will switch to nude, but he will switch to towel if he's not romantic
This is the string of the code (placed in the xml posture_MassageTable):
Code:
<V n="outfit_change" t="for_reason"> <U n="for_reason"> <V t="enabled" n="on_entry"> <L n="tests"> <L> <V t="trait> <U n="trait"> <L n="whitelist_traits"> <T><!--the trait goes here. Can't remember its code--></T> </L> </U> </V> </L> </L> <E n="enabled">EnterBathing</E> </V> </U> </V>
The code part which makes the Sim switch to the towel is missing, as is the remaining part of the code
Consider, however, that with this code the mod doesn't work:
- if I place the string <E n="enabled">EnterBathing</E> BEFORE <L n="tests">, anyone, regardless of the trait, will switch to nude
- if I place the string <E n="enabled">EnterBathing</E> AFTER the </L> of <L n="tests">, no one, regardless of the trait, will switch outfit and will keep their current one
What am I mistaking?
Advertisement
#2
14th May 2018 at 2:06 AM
Posts: 2,671
Thanks: 62739 in 190 Posts
The TDesc file for postures doesn't indicate that tests are available for the outfit_change tuning. So if you put the enabled EnterBathing prior to tests it works always (no test is run) but if you put it after the tests it is ignored since the tests tag triggers an XML error and the rest of that tuning is ignored.
#3
14th May 2018 at 11:56 AM
Posts: 91
Thanks: 1231 in 6 Posts
Thank you for the answer! I thought it was something like that, but I wasn't sure, as I never fully understood TDesc files and the various types of XML tags (V, U, T, etc...)
So, is there not a workaround to accomplish this? Maybe by working on interactions and creating separate interactions for Sims with the trait, and ordinary Sims?
So, is there not a workaround to accomplish this? Maybe by working on interactions and creating separate interactions for Sims with the trait, and ordinary Sims?
#4
15th May 2018 at 6:57 AM
Posts: 2,671
Thanks: 62739 in 190 Posts
Quote: Originally posted by DrHouse93
Thank you for the answer! I thought it was something like that, but I wasn't sure, as I never fully understood TDesc files and the various types of XML tags (V, U, T, etc...) |
First, I'd recommend going to the Tech Discussions section of The Sims Forums. From the Maxis Documentation topic there you can download the TS4 Custom Content Guide (outdated in some places, but explains what those tags are) and you can get the latest TDesc files from 1.39.74 : TDESCs topic on there as well.
To read the TDescs, you'll want to use the TDesc Browser to avoid going crazy. This reads all the TDesc files in and formats them in a tree view for browsing.
Quote:
So, is there not a workaround to accomplish this? Maybe by working on interactions and creating separate interactions for Sims with the trait, and ordinary Sims? |
The only thing I can think of would be to create a second posture which specifies the clothing change you desire, and override whatever triggers thst posture to make the choice of whether to use the original posture or your new one. I'm not entirely sure if that's even possible, though.
Actually, another alternative would be to create a new posture tuning class that changes the outfit change to a list, where each list item has a test attached to allow it to select one from the list. This would certainly work, but would require writing a new Python script to support the new tuning class. The biggest problem with this approach would be maintaining the code once EAxis decides to totally change how the posture class works and having to update the script appropriately.
#5
15th May 2018 at 12:36 PM
Posts: 91
Thanks: 1231 in 6 Posts
I didn't even know about the existance of a TDesc Browser, thank you! That helped a lot
Anyway, I tried by creating a new SocialSuperInteraction, which leads to the default posture if the Sim doesn't have the required trait, and leads to a new custom posture (which is the same as the default, but with a different clothing change) if it has the trait. I also created the script to add the interaction to the Massage Table
However, each time I try to give or ask for a massage, the Sims are unable to perform the interaction, because it gives me a route fail error (I tried with just the Swedish Massage, but the error occurs with any type of massage)
I'm attaching the .package and the .zip files containing the script (I'm sorry it's a .zip file, but I still don't know how to create .ts4script files)
Anyway, I tried by creating a new SocialSuperInteraction, which leads to the default posture if the Sim doesn't have the required trait, and leads to a new custom posture (which is the same as the default, but with a different clothing change) if it has the trait. I also created the script to add the interaction to the Massage Table
However, each time I try to give or ask for a massage, the Sims are unable to perform the interaction, because it gives me a route fail error (I tried with just the Swedish Massage, but the error occurs with any type of massage)
I'm attaching the .package and the .zip files containing the script (I'm sorry it's a .zip file, but I still don't know how to create .ts4script files)
Attached files:
DrHouse93_FitnessActivies_NudeMassage.rar (4.7 KB, 13 downloads) - View custom content | ||||||||||
----------- --------- -------- ----- -------- ----- -------- ---- ..A.... 4770 4751 99% 15-05-18 12:40 87956B61 DrHouse93_FitnessActivies_NudeMassage.package ----------- --------- -------- ----- -------- ----- -------- ---- 4770 4751 99% 1 |
||||||||||
DrHouse93_NudeMassage_MassageTableNewSA.zip (2.7 KB, 14 downloads) - View custom content | ||||||||||
1349 2018-05-14 19:22 DrHouse93_NudeMassage_MassageTableNewSA.py 1646 2018-05-14 19:23 DrHouse93_NudeMassage_MassageTableNewSA.pyo 889 2014-09-30 03:25 injector.py 1533 2015-11-30 01:29 injector.pyo --------- ------- 5417 4 files |
#6
24th May 2018 at 12:26 PM
Posts: 91
Thanks: 1231 in 6 Posts
This is honestly DRIVING ME CRAZY. After a lot of tests and troubleshooting, I managed to make the script work, and the proper interactions are now correctly added to the Massage Table object. However, there is an UNKNOWN bug in the "mixer_social_GiveMassage_Swedish_Friendly_alwaysOn" resource, which causes this:
- If the sim to give a massage to hasn't the trait required for the test (in this case, the Vampire trait), it runs the ordinary interaction for giving a massage and the Sim switches to the Towel outfit. EVERYTHING WORKS FINE HERE
- If the sim to give a massage to is a Vampire, he's supposed to switch to his nude outfit, rather than the towel. However, even if the game recognizes the test as true, the XML slows down the game incredibly, only to run the ordinary interaction after "years" (as if the test never occurred)
What am I getting wrong?
- If the sim to give a massage to hasn't the trait required for the test (in this case, the Vampire trait), it runs the ordinary interaction for giving a massage and the Sim switches to the Towel outfit. EVERYTHING WORKS FINE HERE
- If the sim to give a massage to is a Vampire, he's supposed to switch to his nude outfit, rather than the towel. However, even if the game recognizes the test as true, the XML slows down the game incredibly, only to run the ordinary interaction after "years" (as if the test never occurred)
What am I getting wrong?
Attached files:
DrHouse93_FitnessActivities_NudeMassage.zip (9.0 KB, 13 downloads) - View custom content | ||||||||||
6438 2018-05-24 13:02 DrHouse93_FitnessActivies_NudeMassage.package 5129 2018-05-24 12:41 DrHouse93_Doc_NudeMassage.ts4script --------- ------- 11567 2 files |
Who Posted
|