Post by renyao on Jul 9, 2021 18:13:03 GMT -5
Hello!
This is my very very first attempt at adding a custom tuning file to an object (I've swapped around Maxis's default tuning files for different objects before, like adding the tuning from a nice bed to a lousy one). I'm trying to follow this excellent tutorial from HERE even though it's considerably more involved than what I'm trying to do, because it was the most detailed guide I could find on how to add custom tuning/XML files for objects.
In short, I'm trying to create a CC chair that behaves just like a normal chair, but also gradually increases all a sim's motives (Hunger, Energy, Bladder, Hygiene, Social and Fun) while they're sitting in it. Here's what I did:
1) Started out from S4S main menu with Object > Standalone Recolor, picked existing game object "Hard Boiler" (the egg-shaped chair)
2) In Warehouse tab under Object Definition I saw that by default, egg chair uses:
Tuning: object_sitLiving_EP02GEO
TuningID: 190225
3) Because I just wanted to clone and tweak its existing tuning, not completely replace it, I went to Tools > Extract Tuning. In here I looked for object_sitLiving_EP02GEO, then clicked "Add to Current package".
4) This created an 'Object Tuning' entry in the Warehouse tab.
5) Under Object Tuning, I went to the Data tab, which showed the name and TuningId above. I replaced the name with my own, which created a new TuningID:
Name: renyao:fun_chair_tuning_a
TuningID: 18129309537548270710
6) The tutorial says, "The last thing we will want to do is to change the Object Definition’s name and instance key." -- I went into the Object Definition entries, and under its Data tab l found Key, which had Group/Instance/Type below it, and Name a little further down. I changed these as follows:
Name: renyao:fun_chair_a
Instance: D96BEAAD56160CB6
** I did change the Name and Instance for all Object Definitions -- I had removed all but 2 swatches, so I changed the info above for both of the two remaining Object Definitions.
7) The tutorial says, "You need to add this instance key to the Object Catalog’s instance field as well, as they must match for it to work properly."
-- The Object Catalog entries (I had 2) also showed a "Key" header for Group / Instance / Type , so I changed the Key Instance to D96BEAAD56160CB6 in both files.
8) The tutorial says, "Next step is to copy the Name and TuningId of the object tuning from the data tab and paste it into the Object Definition’s tuning reference (Tuning and TuningId) in its data tab so it can reference it."
-- In both Object Definition entries, I replaced the default Tuning (object_sitLiving_EP02GEO) and TuningID (190225) with my own:
Tuning: renyao:fun_chair_tuning_a
TuningID: 18129309537548270710
** I discovered that typing the tuning name EXACTLY is very important, as the TuningID will be autofilled into its box -- but it will only match the TuningID I generated for my tuning file, if the name of the tuning file is spelled correctly.
9) After this I went into my Object Tuning entry and into the XML file, and confirmed it showed the following at the top:
<I c="GameObject" i="object" m="objects.game_object" n="renyao:fun_chair_tuning_a" s="18129309537548270710">
In the XML under "Autonomy Modifiers" I found this:
I replaced the XML above with what's shown below. (Obviously this only takes care of the Fun motive, but I wanted to make sure this worked before adding the rest.)
After doing all this work, I copied the .package file that I'd created into the Mods folder and....it didn't quite perform the way I hoped?
At least the chairs were visible in my game, and placeable/interactable....but (A) the chair appeared in the catalog twice (no clue why, I only added it to the mods folder once), and (B) though my sims could sit in it, it didn't buff their energy levels while sitting. And since I had 2 chair entries in the catalog, each with 2 swatches, I did place 4 separate chairs and let my Sims play musical chairs with them.
After this failure I entirely cut Buff_Object_SeatingComfort and Buff_Object_SeatingDiscomfort from the XML file, and changed the above to this:
And it halfway worked? Strangely, ONE Sim got the Fun boost from sitting in ONE of the four chairs. Even more strangely, it only happened to that one Sim -- other Sims who sat in the chair got nothing, and it didn't work the second time she tried it. She just couldn't get the same Fun boost again, either from the same chair or another one.
Thanks in advance to anyone who's taken the time to read through this, I hope it's not too long Please let me know where I screwed up in the XML file, and why there's 2 catalog entries in my Build/Buy menu.
This is my very very first attempt at adding a custom tuning file to an object (I've swapped around Maxis's default tuning files for different objects before, like adding the tuning from a nice bed to a lousy one). I'm trying to follow this excellent tutorial from HERE even though it's considerably more involved than what I'm trying to do, because it was the most detailed guide I could find on how to add custom tuning/XML files for objects.
In short, I'm trying to create a CC chair that behaves just like a normal chair, but also gradually increases all a sim's motives (Hunger, Energy, Bladder, Hygiene, Social and Fun) while they're sitting in it. Here's what I did:
1) Started out from S4S main menu with Object > Standalone Recolor, picked existing game object "Hard Boiler" (the egg-shaped chair)
2) In Warehouse tab under Object Definition I saw that by default, egg chair uses:
Tuning: object_sitLiving_EP02GEO
TuningID: 190225
3) Because I just wanted to clone and tweak its existing tuning, not completely replace it, I went to Tools > Extract Tuning. In here I looked for object_sitLiving_EP02GEO, then clicked "Add to Current package".
4) This created an 'Object Tuning' entry in the Warehouse tab.
5) Under Object Tuning, I went to the Data tab, which showed the name and TuningId above. I replaced the name with my own, which created a new TuningID:
Name: renyao:fun_chair_tuning_a
TuningID: 18129309537548270710
6) The tutorial says, "The last thing we will want to do is to change the Object Definition’s name and instance key." -- I went into the Object Definition entries, and under its Data tab l found Key, which had Group/Instance/Type below it, and Name a little further down. I changed these as follows:
Name: renyao:fun_chair_a
Instance: D96BEAAD56160CB6
** I did change the Name and Instance for all Object Definitions -- I had removed all but 2 swatches, so I changed the info above for both of the two remaining Object Definitions.
7) The tutorial says, "You need to add this instance key to the Object Catalog’s instance field as well, as they must match for it to work properly."
-- The Object Catalog entries (I had 2) also showed a "Key" header for Group / Instance / Type , so I changed the Key Instance to D96BEAAD56160CB6 in both files.
8) The tutorial says, "Next step is to copy the Name and TuningId of the object tuning from the data tab and paste it into the Object Definition’s tuning reference (Tuning and TuningId) in its data tab so it can reference it."
-- In both Object Definition entries, I replaced the default Tuning (object_sitLiving_EP02GEO) and TuningID (190225) with my own:
Tuning: renyao:fun_chair_tuning_a
TuningID: 18129309537548270710
** I discovered that typing the tuning name EXACTLY is very important, as the TuningID will be autofilled into its box -- but it will only match the TuningID I generated for my tuning file, if the name of the tuning file is spelled correctly.
9) After this I went into my Object Tuning entry and into the XML file, and confirmed it showed the following at the top:
<I c="GameObject" i="object" m="objects.game_object" n="renyao:fun_chair_tuning_a" s="18129309537548270710">
In the XML under "Autonomy Modifiers" I found this:
{Some of the original XML}
<L n="autonomy_modifiers">
<U>
<L n="stat_use_multiplier">
<U>
<T n="key">24998<!--commodity_Buff_Object_SeatingDiscomfort--></T>
<U n="value">
<E n="apply_direction">BOTH</E>
<T n="multiplier">1E-05</T>
</U>
</U>
<U>
<T n="key">25002<!--commodity_Buff_Object_SeatingComfort--></T>
<U n="value">
<E n="apply_direction">INCREASE</E>
<T n="multiplier">1.74</T>
</U>
</U>
</L>
<V n="subject" t="apply_on_interaction_to_participant">
<V n="apply_on_interaction_to_participant" t="enabled">
<L n="enabled">
<E>Actor</E>
</L>
</V>
</V>
</U>
</L>
<L n="autonomy_modifiers">
<U>
<L n="stat_use_multiplier">
<U>
<T n="key">24998<!--commodity_Buff_Object_SeatingDiscomfort--></T>
<U n="value">
<E n="apply_direction">BOTH</E>
<T n="multiplier">1E-05</T>
</U>
</U>
<U>
<T n="key">25002<!--commodity_Buff_Object_SeatingComfort--></T>
<U n="value">
<E n="apply_direction">INCREASE</E>
<T n="multiplier">1.74</T>
</U>
</U>
</L>
<V n="subject" t="apply_on_interaction_to_participant">
<V n="apply_on_interaction_to_participant" t="enabled">
<L n="enabled">
<E>Actor</E>
</L>
</V>
</V>
</U>
</L>
I replaced the XML above with what's shown below. (Obviously this only takes care of the Fun motive, but I wanted to make sure this worked before adding the rest.)
{More XML}
<L n="autonomy_modifiers">
<U>
<L n="stat_use_multiplier">
<U>
<T n="key">24998<!--commodity_Buff_Object_SeatingDiscomfort--></T>
<U n="value">
<E n="apply_direction">BOTH</E>
<T n="multiplier">1E-05</T>
</U>
</U>
<U>
<T n="key">25002<!--commodity_Buff_Object_SeatingComfort--></T>
<U n="value">
<E n="apply_direction">INCREASE</E>
<T n="multiplier">1.74</T>
</U>
</U>
</L>
<V n="subject" t="apply_on_interaction_to_participant">
<V n="apply_on_interaction_to_participant" t="enabled">
<L n="enabled">
<E>Actor</E>
</L>
</V>
</V>
</U>
<U>
<L n="stat_use_multiplier">
<U>
<T n="key">16655<!--motive_Fun--></T>
<U n="value">
<E n="apply_direction">INCREASE</E>
<T n="multiplier">2.5</T>
</U>
</U>
</L>
<V n="subject" t="apply_on_interaction_to_participant">
<V n="apply_on_interaction_to_participant" t="enabled">
<L n="enabled">
<E>Actor</E>
</L>
</V>
</V>
</U>
</L>
<L n="autonomy_modifiers">
<U>
<L n="stat_use_multiplier">
<U>
<T n="key">24998<!--commodity_Buff_Object_SeatingDiscomfort--></T>
<U n="value">
<E n="apply_direction">BOTH</E>
<T n="multiplier">1E-05</T>
</U>
</U>
<U>
<T n="key">25002<!--commodity_Buff_Object_SeatingComfort--></T>
<U n="value">
<E n="apply_direction">INCREASE</E>
<T n="multiplier">1.74</T>
</U>
</U>
</L>
<V n="subject" t="apply_on_interaction_to_participant">
<V n="apply_on_interaction_to_participant" t="enabled">
<L n="enabled">
<E>Actor</E>
</L>
</V>
</V>
</U>
<U>
<L n="stat_use_multiplier">
<U>
<T n="key">16655<!--motive_Fun--></T>
<U n="value">
<E n="apply_direction">INCREASE</E>
<T n="multiplier">2.5</T>
</U>
</U>
</L>
<V n="subject" t="apply_on_interaction_to_participant">
<V n="apply_on_interaction_to_participant" t="enabled">
<L n="enabled">
<E>Actor</E>
</L>
</V>
</V>
</U>
</L>
After doing all this work, I copied the .package file that I'd created into the Mods folder and....it didn't quite perform the way I hoped?
At least the chairs were visible in my game, and placeable/interactable....but (A) the chair appeared in the catalog twice (no clue why, I only added it to the mods folder once), and (B) though my sims could sit in it, it didn't buff their energy levels while sitting. And since I had 2 chair entries in the catalog, each with 2 swatches, I did place 4 separate chairs and let my Sims play musical chairs with them.
After this failure I entirely cut Buff_Object_SeatingComfort and Buff_Object_SeatingDiscomfort from the XML file, and changed the above to this:
{Even more XML}
<L n="autonomy_modifiers">
<U>
<L n="stat_use_multiplier">
<U>
<T n="key">16655<!--motive_Fun--></T>
<U n="value">
<E n="apply_direction">INCREASE</E>
<T n="multiplier">2.5</T>
</U>
</U>
</L>
<V n="subject" t="apply_on_interaction_to_participant">
<V n="apply_on_interaction_to_participant" t="enabled">
<L n="enabled">
<E>Actor</E>
</L>
</V>
</V>
</U>
</L>
<L n="autonomy_modifiers">
<U>
<L n="stat_use_multiplier">
<U>
<T n="key">16655<!--motive_Fun--></T>
<U n="value">
<E n="apply_direction">INCREASE</E>
<T n="multiplier">2.5</T>
</U>
</U>
</L>
<V n="subject" t="apply_on_interaction_to_participant">
<V n="apply_on_interaction_to_participant" t="enabled">
<L n="enabled">
<E>Actor</E>
</L>
</V>
</V>
</U>
</L>
And it halfway worked? Strangely, ONE Sim got the Fun boost from sitting in ONE of the four chairs. Even more strangely, it only happened to that one Sim -- other Sims who sat in the chair got nothing, and it didn't work the second time she tried it. She just couldn't get the same Fun boost again, either from the same chair or another one.
Thanks in advance to anyone who's taken the time to read through this, I hope it's not too long Please let me know where I screwed up in the XML file, and why there's 2 catalog entries in my Build/Buy menu.