Replies: 9 (Who?), Viewed: 601 times.
Test Subject
Original Poster
#1 Old 5th Aug 2020 at 7:51 PM
Default How do I make a custom pie menu and interactions in the Sims 4?
I want to make my own pie menu but I can't find a any tutorials that make sense to me. I have made a few small XML mods and I've coded in python before but never anything sims related.
Advertisement
Lab Assistant
#2 Old 6th Aug 2020 at 12:31 AM
Pie menus are very simple, but no tutorials that cover it yet. It's on my to-do list but I haven't gotten to it yet. I did go over making one in this thread though: https://sims4studio.com/thread/2125...e-menu-category

Creator Musings is a Sims 4 modder and CC creator hangout server (though everyone is allowed) with a tutorial/resource directory, help channels, and mod/cc/sims 4 news channels!
Twitter | Tumblr | Patreon
Test Subject
Original Poster
#3 Old 6th Aug 2020 at 6:48 PM
Quote:
Originally Posted by MizoreYukii
Pie menus are very simple, but no tutorials that cover it yet. It's on my to-do list but I haven't gotten to it yet. I did go over making one in this thread though: https://sims4studio.com/thread/2125...e-menu-category

I did the XML part but it's not working and I'm assuming it's because it needs a script which I don't know how to make. Please tell me if you ever make that tutorial.
Lab Assistant
#4 Old 6th Aug 2020 at 7:55 PM
Quote:
Originally Posted by Meep62
I did the XML part but it's not working and I'm assuming it's because it needs a script which I don't know how to make. Please tell me if you ever make that tutorial.

Pie menus don't need a script, interactions do and there is XML Injector if you are adding it to sims or existing objects and don't want to script yourself. Pie menus only appear with their related interactions, so if you're interaction isn't added it of course won't work. Make an interaction, make your pie menu, add the pie menu reference to the interaction, inject your interaction with XML Injector.

These social interaction tutorials should help.
https://www.patreon.com/posts/tutorial-lets-31955640 - Making the interaction
https://www.patreon.com/posts/tutorial-lets-in-31990248 - Adding to the game with XML Injector
https://www.patreon.com/posts/tutorial-how-to-30507700 - Another tutorial on XML Inector

Creator Musings is a Sims 4 modder and CC creator hangout server (though everyone is allowed) with a tutorial/resource directory, help channels, and mod/cc/sims 4 news channels!
Twitter | Tumblr | Patreon
Test Subject
#5 Old 6th Aug 2020 at 10:33 PM
I recommend going through this tutorial: https://sims4studio.com/thread/1514...ython-scripting
The download I've attached to this post is a template for easily injecting interactions into the game. Just extract it into your PyCharm projects folder.
By default, the script will add interactions to sims.
It's very simple even if you don't know any scripting. There is only 1 section of the code you need to edit.
Code:
# put your interaction id's here, separated by a comma. 
        # If there is only one interaction, leave a comma at the end like this
        si_ids = (
            0,
        )

You will replace the 0 with your interaction's tuning id (visible in sims4studio). If adding multiple interactions, separate them with commas. Be sure to leave a comma at the end if only adding one interaction.
Be sure to rename the project folder and the interaction_injection_template script file to whatever you're going to call your mod, since the game won't load multiple script files with identical names and there's a chance someone out there will use this template without renaming their script.
Once done, run compile.py in pycharm and it will automatically place a .ts4script file in your mods folder for you. Then run the game to see if your interaction is there. If it works, you're done!
Download - please read all instructions before downloading any files!
File Type: zip Interaction Injection Project Template.zip (1.8 KB, 11 downloads)
Test Subject
Original Poster
#6 Old 10th Aug 2020 at 7:40 PM
Quote:
Originally Posted by MizoreYukii
Pie menus don't need a script, interactions do and there is XML Injector if you are adding it to sims or existing objects and don't want to script yourself. Pie menus only appear with their related interactions, so if you're interaction isn't added it of course won't work. Make an interaction, make your pie menu, add the pie menu reference to the interaction, inject your interaction with XML Injector.

These social interaction tutorials should help.
https://www.patreon.com/posts/tutorial-lets-31955640 - Making the interaction
https://www.patreon.com/posts/tutorial-lets-in-31990248 - Adding to the game with XML Injector
https://www.patreon.com/posts/tutorial-how-to-30507700 - Another tutorial on XML Inector


I made an interaction and a Xml Injector snippet to add it to my sim, but it still won't show up in game. I don't know if it's a problem with the pie menu, the snippet, or the code of the interaction itself. If you need more code than what's in this reply I can send it.
Code:
<?xml version="1.0" encoding="utf-8"?>
<I c="SuperInteraction" i="interaction" m="interactions.base.super_interactions" n="GetTopSurgery" s="11677378443903966645">
  <V n="_cancelable_by_user" t="prohibit_cancelation" />
  <L n="_constraints">
    <U>
      <L n="constraints">
        <U>
          <V n="value" t="spawn_points">
            <U n="spawn_points">
              <V n="tags" t="Spawn_Point_Tags">
                <L n="Spawn_Point_Tags">
                  <E>Spawn_Arrival</E>
                </L>
              </V>
            </U>
          </V>
        </U>
      </L>
    </U>
  </L>
  <V n="_icon" t="participant">
    <U n="participant">
      <L n="participant_type">
        <E>Actor</E>
      </L>
    </U>
  </V>
  <V n="_saveable" t="enabled" />
  <T n="attention_cost">0.5</T>
  <V n="basic_content" t="flexible_length">
    <U n="flexible_length">
      <L n="conditional_actions">
        <V t="literal">
          <U n="literal">
            <L n="conditions">
              <V t="time_based">
                <U n="time_based">
                  <T n="max_time">45</T>
                  <T n="min_time">45</T>
                </U>
              </V>
            </L>
            <E n="interaction_action">EXIT_NATURALLY</E>
          </U>
        </V>
      </L>
      <V n="content" t="looping_content" />
    </U>
  </V>
  <L n="basic_extras">
    <V t="buff">
      <U n="buff">
        <U n="buff_type">
          <T n="buff_type">27833<!--buff_Suppress_Visible_Motives--></T>
        </U>
      </U>
    </V>
    <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">1000</T>
              </U>
            </V>
          </U>
        </V>
        <V n="timing" t="at_beginning" />
      </U>
    </V>
  </L>
  <T n="category">12028072090192667826</T> <!--pieMenuCategory_Transition-->
  <V n="content_score" t="disabled" />
  <T n="counts_as_inside">True</T>
  <T n="disable_autonomous_multitasking_if_user_directed">True</T>
  <T n="display_name">0xED41920B<!--Get Top Surgery--></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>
    </L>
  </U>
  <T n="fade_sim_out">True</T>
  <L n="interaction_category_tags">
    <E>Interaction_Super</E>
    <E>Interaction_All</E>
  </L>
  <V n="outcome" t="test_based">
    <U n="test_based">
      <L n="fallback_outcomes"/>
      <L n="tested_outcomes">
       <U>
         <L n="potential_outcomes">
            <U>
              <U n="outcome">
                <L n="loot_list">
                   <T>
                     18107689395646678709<!--loot_Add_AchingWounds_TopFtM-->
                   </T>
                </L>
              </U>
              <U n="weight">
                 <T n="base_value">5</T>
              </U>
            </U>
         </L>
         <L n="tests">
            <L>
               <V t="trait">
                  <U n="trait">
                     <L n="whitelist_traits">
                        <T>
                           102448 <!--trait_GenderFemale-->
                        </T>
                     </L>
                  </U>
               </V>
            </L>
         </L>
       </U>
       <U>
         <L n="potential_outcomes">
            <U>
              <U n="outcome">
                <L n="loot_list">
                   <T>
                     18118106168810268189<!--loot_Add_AchingWounds_TopMtF-->
                   </T>
                </L>
              </U>
              <U n="weight">
                 <T n="base_value">5</T>
              </U>
            </U>
         </L>
         <L n="tests">
            <L>
               <V t="trait">
                  <U n="trait">
                     <L n="whitelist_traits">
                        <T>
                           102447 <!--trait_GenderMale-->
                        </T>
                     </L>
                  </U>
               </V>
            </L>
         </L>
       </U>
      </L>
    </U>
  </V>
  <E n="scoring_priority">NORMAL</E>
  <T n="subaction_selection_weight">1</T>
  <V n="super_affordance_compatibility" t="literal">
    <U n="literal">
      <V n="default_inclusion" t="exclude_all" />
    </U>
  </V>
  <E n="target_type">ACTOR</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>
           </L>
        </V>
        <V n="species" t="specified">
          <U n="specified">
            <L n="species">
              <E />
            </L>
          </U>
        </V>
        <E n="who">Actor</E>
      </U>
    </V>
  </L>
  <T n="time_overhead">30</T>
</I>


Code:
<?xml version="1.0" encoding="utf-8"?>
<I c="XmlInjector" i="snippet" m="xml_injector.snippet" n="Meep62_trans_XmlInjector_Snippet" s="10784512618392090619">
  <L n="add_interactions_to_sims">
    <T>11677378443903966645<!--GetTopSurgery--></T>
  </L>
</I>		
Lab Assistant
#7 Old 11th Aug 2020 at 4:42 AM
Hmmm, everything looks fine to me in your interaction and the snippet. You didn't post your pie menu, but does your pie menu have "_collapsible">False</T>" in it, and does the SimData match? I remember someone recently having trouble as well and it only appeared when this was added. We went over everything else repeatedly and it was that tiny detail that solved it. Oh and double check your tuning ID's and instances. S4S has a tendency to revert changes.

Creator Musings is a Sims 4 modder and CC creator hangout server (though everyone is allowed) with a tutorial/resource directory, help channels, and mod/cc/sims 4 news channels!
Twitter | Tumblr | Patreon
Test Subject
Original Poster
#8 Old 11th Aug 2020 at 6:24 PM
Quote:
Originally Posted by MizoreYukii
Hmmm, everything looks fine to me in your interaction and the snippet. You didn't post your pie menu, but does your pie menu have "_collapsible">False</T>" in it, and does the SimData match? I remember someone recently having trouble as well and it only appeared when this was added. We went over everything else repeatedly and it was that tiny detail that solved it. Oh and double check your tuning ID's and instances. S4S has a tendency to revert changes.


Ya I'm pretty sure that it's collapsible but I'll send the code anyway. I'm pretty sure all the tuning and instance IDs are correct but I kinda changed some of the groups but not others and I don't know if that does anything. Idk I'm just confused at this point.

Code:
<?xml version="1.0" encoding="utf-8"?>
<I c="PieMenuCategory" i="pie_menu_category" m="interactions.pie_menu_category" n="pieMenuCategory_Transition" s="12028072090192667826">
  <T n="_collapsible">False</T>
  <T n="_display_name">0x6F36B7F0<!--Transition--></T>
  <T n="_display_priority">5</T>
</I>


Code:
<?xml version="1.0" encoding="utf-8"?>
<SimData version="0x00000101" u="0x00000000">
  <Instances>
    <I name="pieMenuCategory_Transition" schema="PieMenuCategory" type="Object">
      <T name="_collapsible">0</T>
      <T name="_display_name">0x6F36B7F0</T>
      <T name="_display_priority">5</T>
      <T name="_icon">00000000-00000000-0000000000000000</T>
      <T name="_parent">0</T>
      <T name="_special_category">0</T>
      <L name="mood_overrides" />
    </I>
  </Instances>
  <Schemas>
    <Schema name="PieMenuCategory" schema_hash="0x022065C1">
      <Columns>
        <Column name="_collapsible" type="Boolean" flags="0x00000000" />
        <Column name="_display_name" type="LocalizationKey" flags="0x00000000" />
        <Column name="_display_priority" type="Int32" flags="0x00000000" />
        <Column name="_icon" type="ResourceKey" flags="0x00000000" />
        <Column name="_parent" type="TableSetReference" flags="0x00000000" />
        <Column name="_special_category" type="Int64" flags="0x00000000" />
        <Column name="mood_overrides" type="Vector" flags="0x00000000" />
      </Columns>
    </Schema>
  </Schemas>
</SimData> 
Screenshots
Test Subject
Original Poster
#9 Old 13th Aug 2020 at 6:24 PM
Also maybe it's a problem with the fact that I used the adoption.interaction and tried to change what type of interaction it is??
Lab Assistant
#10 Old 15th Aug 2020 at 2:27 AM
I'm not quite sure what the issue is, I wish I knew. Maybe try copying a regular super interaction then if you think it's the cause, like one of the volunteer ones (E882D22F!00000012!000000000002725D.SI_VolunteerEvents_BakeSale.InteractionTuning.xml is one). What I'm going to do (later, making a knittable CC tutorial ATM) if you can't get it working is try to make a mock mod using the info you posted, different loots, and see if I can get it working on my end. Everything looks fine to me so it should work, but maybe I'm just not seeing something.

Creator Musings is a Sims 4 modder and CC creator hangout server (though everyone is allowed) with a tutorial/resource directory, help channels, and mod/cc/sims 4 news channels!
Twitter | Tumblr | Patreon
Back to top