Forum Discussion

pearlbh's avatar
pearlbh
Seasoned Veteran
9 years ago

Is it possible to make social interactions with XML tuning?

I have heard that it is possible to make custom social interactions with XML tuning, but that it comes with the cost of incompatibility with other people's mods. Could someone explain exactly what kind of incompatibility that would be? And if it's really better to use Python, I'd like suggestions on simple absolute-beginner tutorials on how to use it to make a custom interaction.

Just to clarify, I am talking about social interactions for Sims. Specifically, I have a custom trait and I'd like to have Sims with my trait have special friendly interactions that only they can do, the way that some traits, say Music Lover, can "Discuss Favorite Band" or Geeks can "Enthuse about New Show." There are a few tutorials I've found that deal with adding interactions to objects, but I haven't found anything that's for social mixer interactions.

19 Replies

Replies have been turned off for this discussion
  • @Neia Oh, that's how you test them. Thanks! I tried that and my scripts work. Woot! Only thing I need to figure out now is what's wrong with my zip files and why the game is complaining when it tries to read the compiled scripts in them.
  • @RexZheng @Neia Hey guys, thanks both of you for your help. I just wanted to let you know, I figured out the final issue (this zip import thing) and my scripts are now fully functioning, compiled.

    Apparently I had both Python 2.7 and Python 3.3 installed on my computer. And when I used the run prompt python.exe -O to compile, it was bringing up Python 2.7, which I now realize is not the version of python to use for that lol. As soon as I used 3.3 to compile, no zip error. Lesson learned.

    One less obstacle out of the way. :smile:
  • konansock's avatar
    konansock
    Rising Veteran
    9 years ago
    @Neia Thanks for the link! I intended to post the link but I'm too new to forum so I cannot!
    @Triplis It's good that you've figured it out! Are you making it for your teen traits?
  • @RexZheng Thanks for asking. It's for a couple of interactions for Child sims, actually. :smile: I submitted the two of them to MTS today, so hopefully they'll be up within 24 hours or so.

    Of course, what I now know about making interactions can be applied to other stuff too. I want to make some interactions to do with the teen traits at some point. Just a matter of priorities.
  • konansock's avatar
    konansock
    Rising Veteran
    9 years ago
    @Triplis Fair enough! I thought you're going to make an interaction for teens to choose how they'll react in their adolescence. I personally feel bad to add a trait for teens which will go away when tey grow up, leaving them only two traits, LOL
    Good luck with your mod!
  • pearlbh's avatar
    pearlbh
    Seasoned Veteran
    9 years ago
    Before I even get to injecting with python though, could somebody tell me how to actually make an XML interaction? I really have no idea how to build anything like that from scratch, since I only have used Sims 4 Studio for editing XML files to make tuning mods.
  • @pearlbh It's kind of hard to explain, as there's a lot of detail that can go into it and different things that can be done for different interactions. Your best bet, I think, is to make sure you can get access to certain files, first of all. XML game files in a way that you can search through relatively easily, if you haven't already (see: http://modthesims.info/t/560317).

    DATA files, in my experience, are a bit more difficult to get straightforward access to. But if you use the method outlined here to get them into a folder: http://modthesims.info/t/540033 (see the section "Setting Up") You'll at least have them somewhere, albeit maybe not in the easiest format to search. If there's an easier way to access them, it's not something I'm personally familiar with.

    The point of this is so that you can use the game files as examples to learn from (and also to copy from). It really is the best teacher, imo, for showing you how an interaction is put together and it's easiest when you can just copy/paste an existing interaction's XML file and do tweaks to make it your own.

    For example, if you want an interaction like Discuss Favorite Band, you can use Discuss Favorite Band's XML file as a base and then make a few tweaks where necessary. The main tweaks that are essential are changing the "n" and "s" values at the top of the file. Example:

    n="Pearlbh_CustomInteractionName" s="13793">


    Except the "s" value will be a much longer series of numbers and more random-looking. This is to ensure there aren't conflicts.

    And then the other essential tweak is changing the STBL value under (example):

    0x8ACBEBD


    This is the interaction name that will appear in the pie-menu. The "Discuss Favorite Band" part.

    There are ways to manually create unique values/name IDs to use, so that you won't have conflicts. What I've been doing for efficiency since I'm usually not needing a huge number of values at once, is I'll create a trait in Zerbu's Mod Constructor, then delete the description and make the value what I want for an STBL value (so if I wanted my interaction to be called "Discuss Favorite Band Manager", I'd change my trait name to that in the interface and then export and save the package file. I can then open up that package file, extract the STBL files, and use them for my new interaction. I can also use the ID generated for the trait itself for the interaction's "s" value. And extract the main trait XML file and use the last part of its name as the unique ID for my interaction XML file.

    Note, however, that the first part of the XML file name is specific to traits if you generated it from Mod Constructor as a trait:

    S4_CB5FDDC7_00000000_
    in
    S4_CB5FDDC7_00000000_000000000000860C
    is for Traits.

    Then:

    S4_E882D22F_00000000_
    in
    S4_E882D22F_00000000_0000000000006557
    is for Interactions.

    etc.

    If that's at all confusing, it's because it is. Well, ok... not confusing exactly, but there's just a lot of things you can learn as you go and it's sort of impossible to sum it all up succinctly.

    If you have any questions, feel free to ask. I can honestly say though, for me, most of my questions were resolved through sheer testing and reading different files as examples. It slowly becomes more clear the more you see how the different pieces are put together. I actually find it's mostly intuitive how it all works; you just have to look at a lot of examples and fumble about in the dark a lot. Reading the TDESC's can help, too. There's a TDESC specific for interactions that has some insight in there about certain identifiers being used.

    Also, just a general note, some types of files just need a unique "n" and "s" value and they'll be recognized by the game fine, as long as they're referenced properly (traits and buffs are one of these). For Interactions, injections are needed for compatibility, while making sure your interaction shows up in the right spot. Apart from that, you really just need a unique "n" and "s" value. The reason you want injections is because there are master lists of interactions that keep them all together and make sure they show up properly (ex: Romance interactions under the Romance tab) so if your new interaction is not part of the list, it won't show up in-game. An injection allows you to add it to the list without overriding the base game XML file for that list (if you used the base game XML file as an override, you'd conflict with other people doing the same).

    Edit: Slight revision on something I said. I'm not sure the "n" value even needs to be unique. I think it may be an identifier for keeping your files named in an organized manner, more than anything (so name it in a way that will make the file easy to identify). The "s" value is the part that gets referenced when you're calling on one file from another file and it's vital that that part is unique and won't conflict with any other values.
  • @pearlbh
    For more details about the ID, you can take a look at Maxis' custom content guide here : http://forums.thesims.com/en_US/discussion/779844/maxis-documentation
    It also has some examples with interactions which you may find useful.

    I personally use S4PE to generate my hash code, there's also a program available here : http://modthesims.info/download.php?t=588578

    Some additional bit of info : the "s" value is the decimal conversion of the instance key (which is hexadecimal).

About The Sims 4 Mods & Custom Content

Find expert tips, troubleshooting help, tutorials for mods and custom content, and The Sims 4 patch files in our forum.15,599 PostsLatest Activity: 25 minutes ago