|
Post by sprealty on Oct 28, 2024 12:18:33 GMT -5
Hello,
I'm just starting out learning how to do object tuning and I'm a bit confused. I'd like to give an object's interaction (eg: washing machine -> wash clothes) a cost per use (eg: 3 simoleons). I've had no luck finding information on how to add this to the tuning, and I'm curious if there's a good place to start. Thanks in advance!
|
|
|
Post by CatDevPete on Oct 28, 2024 17:55:09 GMT -5
So from what I've encountered with drinks modding such as with the fountain & the wedding stories tea set, you should be able to add in payment via adding a "payment" snippet into the "basic_extras" tag (or create the basic_extras into your interaction tuning if it doesn't exist). For example:
<L n="basic_extras"> <V t="payment"> <U n="payment"> <V n="payment" t="literal"> <U n="literal"> <V n="payment_cost" t="amount"> <U n="amount"> <T n="amount">200</T> </U> </V> </U> </V> </U> </V> </L> For tuning examples where they've used it, take a look at say "fruitPunchFountain_FillWith_Cider".
|
|
|
Post by sprealty on Oct 28, 2024 19:50:22 GMT -5
Edit 2: I think I figured it out. Is this the appropriate insertion point?
Also, how do I import this tuning back into the object?
<?xml version="1.0" encoding="utf-8"?>
<I c="SuperInteraction" i="interaction" m="interactions.base.super_interaction" n="laundry_WashingMachine_Wash_Clothes" s="175875">
<V n="_saveable" t="enabled" />
<L n="_static_commodities">
<U>
<T n="desire">1</T>
<T n="static_commodity">33808<!--StaticCommodity_MaidClean--></T>
</U>
<U>
<T n="static_commodity">178176<!--staticCommodity_Laundry_WashClothes--></T>
</U>
<U>
<T n="static_commodity">16440<!--StaticCommodity_Tidy--></T>
</U>
</L>
<T n="attention_cost">0.5</T>
<V n="basic_content" t="one_shot">
<U n="one_shot">
<U n="animation_ref">
<T n="factory">176740<!--laundry_WashingMachine_Actions_WashCycle--></T>
</U>
<V n="periodic_stat_change" t="enabled">
<U n="enabled">
<T n="trigger_gain_on_start">True</T>
</U>
</V>
</U>
</V>
<L n="basic_extras">
<V t="payment">
<U n="payment">
<V n="payment" t="literal">
<U n="literal">
<V n="payment_cost" t="amount">
<U n="amount">
<T n="amount">5</T>
</U>
</V>
</U>
</V>
</U>
</V>
<V t="loot">
<U n="loot">
<L n="loot_list">
<T>354192<!--loot_ObjectReward_Gemology_Effects--></T>
</L>
</U>
</V>
</L>
<V n="content_score" t="disabled" />
<T n="display_name">0x79D2E0B9<!--Wash Laundry--></T>
<U n="display_name_text_tokens">
<L n="tokens">
<V t="participant_type">
<U n="participant_type">
<V n="objects" t="from_participant">
<U n="from_participant">
<E n="participant">Actor</E>
</U>
</V>
</U>
</V>
<V t="participant_type">
<U n="participant_type">
<V n="objects" t="from_participant">
<U n="from_participant">
<E n="participant">Object</E>
</U>
</V>
</U>
</V>
</L>
</U>
<L n="interaction_category_tags">
<E>Interaction_Super</E>
<E>Interaction_All</E>
<E>Interaction_Laundry</E>
</L>
<V n="outcome" t="single">
<U n="single">
<U n="actions">
<L n="basic_extras">
<V t="state_change">
<U n="state_change">
<V n="new_value" t="single_value">
<U n="single_value">
<T n="new_value">175878<!--laundry_WashingMachine_Cleaning_Phase_Values_Pre_Wash--></T>
</U>
</V>
</U>
</V>
</L>
<L n="loot_list">
<T>179376<!--loot_Laundry_Cleaning_Additive--></T>
</L>
</U>
</U>
</V>
<T n="pie_menu_priority">7</T>
<V n="privacy" t="enabled">
<U n="enabled">
<T n="animate_shoo">False</T>
<V n="privacy_snippet" t="reference">
<T n="reference">142957<!--privacy_SurfaceShoo--></T>
</V>
</U>
</V>
<E n="scoring_priority">NORMAL</E>
<T n="subaction_selection_weight">1</T>
<E n="target_type">OBJECT</E>
<L n="test_globals">
<V t="sim_info">
<U n="sim_info">
<V n="ages" t="specified">
<L n="specified">
<E>TEEN</E>
<E>YOUNGADULT</E>
<E>ADULT</E>
<E>ELDER</E>
<E>CHILD</E>
</L>
</V>
<V n="species" t="specified">
<U n="specified">
<L n="species">
<E />
</L>
</U>
</V>
<E n="who">Actor</E>
</U>
</V>
<V t="state">
<U n="state">
<E n="operator">NOTEQUAL</E>
<T n="value">15080<!--BrokenState_Broken--></T>
</U>
</V>
<V t="state">
<U n="state">
<E n="operator">LESS_OR_EQUAL</E>
<T n="value">179013<!--laundry_WashingMachine_Cleaning_Phase_Values_Done--></T>
</U>
</V>
<V t="state">
<U n="state">
<T n="value">175917<!--laundry_WashingMachine_Values_Capacity_Full--></T>
</U>
</V>
<V t="state">
<U n="state">
<E n="operator">LESS</E>
<T n="value">175407<!--laundry_Cleanliness_Values_Clean--></T>
</U>
</V>
<V t="state">
<U n="state">
<E n="operator">NOTEQUAL</E>
<V n="tooltip" t="enabled">
<T n="enabled">0x11E9A292<!--{0.SimFirstName} cannot upgrade this object while it is broken.--></T>
</V>
<T n="value">177041<!--laundry_WashingMachine_Brokeness_Plumbing_Broken--></T>
</U>
</V>
</L>
<T n="time_overhead">30</T>
<V n="utility_info" t="enabled">
<L n="enabled">
<U>
<E n="key">POWER</E>
</U>
<U>
<E n="key">WATER</E>
</U>
</L>
</V>
</I>
|
|
|
Post by CatDevPete on Oct 29, 2024 1:24:43 GMT -5
That looks good so far đź‘Ť
For applying it, as long as you haven't modified the tuning Id (and name, but not sure if that has an effect), it should override the original tuning's behaviour I think. Just make sure the file that tuning's in is in your mods folder, ofc. Just give it a try in the game, there should be a price (§5) on the right of the interaction if it's working.
|
|
|
Post by sprealty on Oct 29, 2024 1:30:01 GMT -5
That looks good so far 👍 For applying it, as long as you haven't modified the tuning Id (and name, but not sure if that has an effect), it should override the original tuning's behaviour I think. Just make sure the file that tuning's in is in your mods folder, ofc. Just give it a try in the game, there should be a price (§5) on the right of the interaction if it's working. How would I go about applying this to a specific object? I have a consumer and a commercial (coin-op) version of the machines in a mod (separate .package files) and I’d want to keep the consumer version without cost. I presume if I stick this in the mods folder it will set all washing machines to pay-per-use?
|
|
|
Post by CatDevPete on Oct 29, 2024 3:42:48 GMT -5
That's correct, presumably. Though, I would still try that first to make sure it works.
If/Once you want to apply this to a specific object rather than make it an override, that will become more involved. Not only that, the WM (washing machine) utilises a state for whether it's been loaded with laundry, which will add extra steps.
To write out the steps you'll likely need to take, in your commercial WM mod package: 1. Make the 'wash clothes' interaction use a unique tuningId, so it doesn't override the original tuning. 2. If you don't already have it, add in the WM object tuning & make sure it also has a unique tuningId, and the WM's object definition adopts that tuningId as well. 3. Add in the object state tuning for the WM's full state. Specifically 'laundry_WashingMachine_Values_Capacity_Full' (175917). Also make its TuningId unique. 4. Inside your now-custom object state tuning for the WM's full state, replace the original wash clothes interaction value with your own one (the one from step 1). 5. Inside the custom WM object tuning, replace all instance of the WM's full state object state tuning (175917) with the new tuning you'd have generated from step 3.
If everything's done correctly, and this is all possible in the first place, then hopefully that should make your modded commercial washing machines now money-operated, whilst not affecting the consumer (nor any other) ones.
I'm assuming that you already know how to make the tuningId unique, but just holler if you need a short guide on that, or for any other steps.
|
|
|
Post by sprealty on Oct 29, 2024 12:34:53 GMT -5
I appreciate all the help so far. When it comes to a unique tuningID, can I just make one up (eg: 19999987) so it doesn’t conflict with other default IDs? Or is there some kind of generator/formatting law I have to use?
|
|
|
Post by sprealty on Oct 29, 2024 15:05:49 GMT -5
That looks good so far 👍 For applying it, as long as you haven't modified the tuning Id (and name, but not sure if that has an effect), it should override the original tuning's behaviour I think. Just make sure the file that tuning's in is in your mods folder, ofc. Just give it a try in the game, there should be a price (§5) on the right of the interaction if it's working. So I tried this, I put the .xml file that I modified into the mods folder and it didn’t have any impact.
|
|
|
Post by CatDevPete on Oct 29, 2024 18:26:12 GMT -5
That looks good so far 👍 For applying it, as long as you haven't modified the tuning Id (and name, but not sure if that has an effect), it should override the original tuning's behaviour I think. Just make sure the file that tuning's in is in your mods folder, ofc. Just give it a try in the game, there should be a price (§5) on the right of the interaction if it's working. So I tried this, I put the .xml file that I modified into the mods folder and it didn’t have any impact. That's strange, although it's a good thing you've caught this now, rather than later when there's a lot more going on to troubleshoot. I've just gave this a quick shot on my end, and I can confirm it does work if done properly. Assuming that you've already loaded in laundry into the WM (so seeing the "Wash Laundry" interaction is not the issue), it's worth noting that the tuning needs to be in a .package file in order to be read by The Sims 4. It can't be a naked .xml file. See below for how I've done it.
|
|
|
Post by sprealty on Oct 29, 2024 18:39:42 GMT -5
Ahh that makes sense. How would I bring this xml file into a .package file?
ed2: nope, I think I see now. I needed to create a new blank package and add “interaction tuning”, import the xml and save?
|
|
|
Post by CatDevPete on Oct 29, 2024 19:00:12 GMT -5
I appreciate all the help so far. When it comes to a unique tuningID, can I just make one up (eg: 19999987) so it doesn’t conflict with other default IDs? Or is there some kind of generator/formatting law I have to use? It's possible to just make one up. But generally, it's good practice to use S4S's own built-in generator for it to ensure it's always unique. All you need to do is just prefix the tuning with a string followed by ':'. eg. sprealty:laundry_WashingMachine_Wash_Clothes If done correctly, the TuningId & Instance field should both change. Instance is sometimes used to get object reference, and you'd also want to apply it to a tuning's associated Sim Data if it comes with one, primarily for certain UI to associated & read from it (afaik). But TuningId is likely what you'll be concerned about & using mostly.
|
|
|
Post by CatDevPete on Oct 29, 2024 19:01:18 GMT -5
Ahh that makes sense. How would I bring this xml file into a .package file? ed2: nope, I think I see now. I needed to create a new blank package and add “interaction tuning”, import the xml and save? Yup, that's right. Either import the xml, or you can go to Tools > Export Tuning and search for the relevant tuning to add into the package.
|
|
|
Post by sprealty on Oct 29, 2024 19:09:30 GMT -5
I appreciate all the help so far. When it comes to a unique tuningID, can I just make one up (eg: 19999987) so it doesn’t conflict with other default IDs? Or is there some kind of generator/formatting law I have to use? It's possible to just make one up. But generally, it's good practice to use S4S's own built-in generator for it to ensure it's always unique. All you need to do is just prefix the tuning with a string followed by ':'. eg. sprealty:laundry_WashingMachine_Wash_Clothes If done correctly, the TuningId & Instance field should both change. Instance is sometimes used to get object reference, and you'd also want to apply it to a tuning's associated Sim Data if it comes with one, primarily for certain UI to associated & read from it (afaik). But TuningId is likely what you'll be concerned about & using mostly. Got it. So now I’ve got this package file with the interaction tuning with a new tuningID, what’s the next step in the chain? What else needs to be modified and how would one do that?
|
|
|
Post by CatDevPete on Oct 29, 2024 20:13:16 GMT -5
Got it. So now I’ve got this package file with the interaction tuning with a new tuningID, what’s the next step in the chain? What else needs to be modified and how would one do that? So for my step 2, you'll want to open up your commercial WM package. I'm going to assume you've already cloned it properly, and it appears in the sims 4 BB catalogue without issue. In the commercial WM package, I'll also assume that you don't have the washing machine object tuning in it yet (if you do, you can skip the following bit). The object tuning is called "object_laundry_WashingMachine" (TuningId: 175587), so you'll either want to import the xml for that into the package, or go to Tools > Export Tuning to find & add it in. Once the above is all fine, you'll want to do something similar to this for the WM's object tuning, so it generates a unique tuningId. If you've added in the tuning via S4S (i.e. via Tools > Export Tuning), there would also be a "Sim Data" along with it. I'm not sure if it's important for the WM, but I'd still name it similarly & copy the Instance from the Object Tuning over into the Sim Data just in case (adding 'sprealty:' to the Sim Data's name won't regenerate the Instance like in Tunings, so you'll need to manually copy it over to be associated together).
|
|
|
Post by sprealty on Oct 29, 2024 20:22:21 GMT -5
Got it. Object tuning and sim data added to the washing machine object package with the same instance ID. I also went ahead and used the swatch -> tuning tab to remove the default one and insert the sprealty: version, and applied to all swatches.
Then I added the object state tuning, changed the ID for "wash clothes", went back to object tuning, changed the ID for the full state (all) and saved.
|
|