March 29th - It's time for our Friday Highlights! You can check them out here!
Forum Announcement, Click Here to Read More From EA_Cade.

Time to Run - Copying a Walkstyle (a tutorial)

TriplisTriplis Posts: 3,048 Member
edited March 5 in Nominated Threads
Disclaimer

To begin with, I want to make it clear that some of this is going to be based on stuff I worked out over six months ago, so I've had to go back some and refresh on the specifics. I have done my best to make sure the information is accurate nonetheless. More importantly, I want to make it clear that the knowledge may or may not be transferrable to other walkstyles. I have no reason to believe that it wouldn't be, but I make no claims that the knowledge here can extend beyond copying the style of the vampire superspeed walkstyle. That is an exercise for the reader and I'd be happy to know if it does extend beyond.

I would also like to note that this tutorial assumes a general level of familiarity with modding in the Sims 4. It is meant more for those who have some familiarity, but have no idea how a walkstyle, specifically, might be done.

And if you are really experienced and just want to get to the details, you can skip down to the TL;DR section at the end.

That said, if I happen to read responses and see questions, I'll try to answer.


In the beginning, there was, like, hashes and such

Yeah, I don't remember all of the terminology for it, but inside of the typical Sims 4 xml file, there's the value under "s=", there's the name under "n=", and then there's the external file name that needs to be unique and is related to the "s=" value, especially, but also usually the "n=" value.

For example, n="Triplis_Sorcerer_StagingContent_VoodooDollCuddleSucceed_Animation_TargetType_Actor", s="1068730199132742851", and external file name is: S4_E882D22F_00000000_0ED4E474280A24C3

If you plug the name (Triplis_Sorcerer_StagingContent_VoodooDollCuddleSucceed_Animation_TargetType_Actor) into the FNV Calculator tool by ArtUrlWWW, you can see that the "s=" value is the FNV64 Decimal value. And the unique part of the external file name (0ED4E474280A24C3) is the FNV64 Hex value (without the 0x part at the beginning).

This is more or less how the naming for most mod files is supposed to work, as outlined in the official modding content guide (last time I looked at it).

Walkstyles break the norm in a few important ways and that's what the bulk of this tutorial is about sharing the working knowledge on.


The exception to the rule

Working out the right naming conventions for walkstyle files turned out to be pretty much the whole problem.

But before we look at the specifics, let's set up some context. There are 3 components to a walkstyle. There's the walkstyle file itself, which might look something like this:
<!-- #?!@ Sage.Asset key=65066ad2-7c92-42fa-ad35-a4e297dd091b@RWS1-ASWINDLEHU -->
<?xml version="1.0" encoding="utf-8"?>
<Walkstyle name="RunVampire" name_key="65066ad2-7c92-42fa-ad35-a4e297dd091b@RWS1-ASWINDLEHU" default_parent="Run" default_parent_key="7fde72af-78b3-4adf-bd69-596f76ec414d@RWS1-BBELL7600" default_cycle_syncpoint="" default_cycle_syncpoint_key="">
  <ToolData posture="Stand_Posture" posture_key="Stand_Posture.statemachine@InGame" />
  <Variant age="Adult" gender="Male" species="Human" parent="" parent_key="" cycle_syncpoint="" cycle_syncpoint_key="" logic_type="Walk" steering_speed="500" time_scale="0.3" default_blend_time="0.13" disable_focus="True" disable_mirroring="False" overlay_blend_in="0.1" overlay_blend_out="0.2" sound_event_repeat_modifier="0" sound_event_cool_down="3">
    <Builder name="stairs_down_cycle" asset_name="stairs_vampire_adult_male_cycle_down" asset_name_key="2da66678-8444-48ff-b9d8-4749ef021ac2@RWS1-ASWINDLEHU" />
    <Builder name="stairs_up_cycle" asset_name="stairs_vampire_adult_male_cycle_up" asset_name_key="fe50e514-3c38-4fcf-80bf-e8e9c1d00364@RWS1-ASWINDLEHU" />
    <Builder name="stairs_up_start" asset_name="stairs_vampire_adult_male_start_up" asset_name_key="8457f92b-6b7e-4552-ba2e-c8685596dd61@RWS1-ASWINDLEHU" />
    <Builder name="stairs_up_stop" asset_name="stairs_vampire_adult_male_stop_up" asset_name_key="2fdebfad-ed40-4323-85be-956b543e4278@RWS1-ASWINDLEHU" />
    <Builder name="stairs_down_stop" asset_name="stairs_vampire_adult_male_stop_down" asset_name_key="aa62cc3c-c4ac-4826-b7f5-d80163c81919@RWS1-ASWINDLEHU" />
    <Builder name="stairs_down_start" asset_name="stairs_vampire_adult_male_start_down" asset_name_key="4d33b429-f9d3-46b3-97d6-ef97ef8690ce@RWS1-ASWINDLEHU" />
    <Effect effect_key="gp04_vampire_celerity@Swarm" effect="gp04_vampire_celerity" bone="b__Spine2__" mirror="False" offset_x="0" offset_y="0" offset_z="0" />
  </Variant>
</Walkstyle>

There's the locomotion files, which are referenced inside of the walkstyle file (and the walkstyle won't work if the locomotion files aren't referenced properly).

Here's an example:
<?xml version="1.0" encoding="utf-8"?>
<LocomotionBuilder name="stairs_vampire_adult_male_cycle_down" name_key="2da66678-8444-48ff-b9d8-4749ef021ac2@RWS1-ASWINDLEHU" blend_duration_in="0.26" blend_duration_out="0.26" mask="" mask_key="" timescale="0.3999999" disable_tail_overlay="False">
  <Clip focus_compatibility="Full" name="a_loco_stairs_stepDown_x" start_offset="0" end_offset="0" timescale="1" />
</LocomotionBuilder>

And then there's the animation clips themselves. For the sake of the vampire superspeed, the animation clips aren't important, other than being referenced properly by name, as they're base game stair-walking files that are being tweaked in things like execution speed, so there's no need or reason to change them.


The walkstyle file

Unlike most xml files for the game, there's no "s=" value inside. There is, however, a "name=", which is the equivalent of the "n=" in most other files.

If we follow the norm, we would plug in the name (ex: Triplis_CustomWalkstyle_VampireRun_LightEffect) into the FNV Calculator and then we'd use the FNV64 Decimal value as the unique part of the external file name and we're good to go, right!

Well, apparently not. Last I checked (it could have changed since then) this is not supported for the main walkstyle file itself. Instead, you have to use the FNV32 Decimal value. And a few zeroes, apparently (I just copied the convention from maxis files on that one). Something like: 0000000058EB2CC4 for the unique part of the name.

This may be a bad thing. I'm not 100% sure. The content guide (last I checked it) talks about using 64, rather than 32, to avoid naming collisions. So there may be some risk of naming collisions, where there isn't for using 64. I mention this only because "fair warning" and all, if using a 32 a lot results in a collision at some point.

That's the walkstyle file functioning as a unique one. Now let's get into the locomotion files and how to connect them to the walkstyle file.


The locomotion files, choo choo

To start with, let's look at the core internal and external name for locomotion files. With many Sims 4 xml files, you could do a thing like name it "Triplis_Sorcerer_MyFaceHurts" in the "n=" value and then plug something like "Triplis_Sorcerer_MyFaceHurtsReallyReallyBad" into the FNV Calculator and use the Decimal and Hex value from THAT name for the "s=" and external unique id for the file, and it would still work!

Here's where things get a bit weird and not because they were weird fundamentally, but because I was doing some weird stuff. Due to something I had read in the official content guide, I had adopted the practice of only using a paired Decimal/Hex if the Decimal started with a 1. This was a habit I had taken very seriously after reading something in the content guide about starting the value with a 1, so that it would be recognized as a mod or something.

I'm pretty sure that tools like Zerbu's don't follow this convention and it's something that was probably only relevant when the content guide was first written back near the beginning of the game's release, but gosh darn it, it was a habit and it wasn't broke, so I was afraid to fix it.

But ultimately, this meant that I'd do stuff like copy/pasting a name I'd made up into the Calculator more than once until it gave me a value with a 1 at the beginning. Then I'd use that pair and use my not-copied-multiple-times name inside of the file itself, since it didn't have to be same.

If that was confusing, don't worry, it's because it is.

All you need to know is that this threw me off initially with the locomotion files, since they didn't follow the same rules. With the locomotion files, there is no "s=" entry. There's "name=" (same as the walkstyle file) and then there's the unique external id.

To make it work, you just have to plug the name into the calculator and use the FNV64 Hex in the external name for its unique part. Then the internal name needs to match what you used to get the calculator value. Pretty normal stuff for making Sims 4 mod files work.


Full speed ahead

Alright, so we've got the walkstyle file uniquely named and working. We've got the locomotion files uniquely named and working. Now we just need to handle some stuff inside.

For the superspeed example, the locomotion files just needed to be an exact copy, apart from the unique name. I didn't want the animation clips to be any different, or any operations of how the walkstyle works.

The walkstyle file was mostly the same deal, with a couple of exceptions. For one thing, we gotta hook in the new locomotion files. There is nothing particularly obvious in how that works, that I was able to glean. I just did trial and error, and eventually found the right way to do it.

In sections like:
<Builder name="stairs_down_cycle" asset_name="Triplis_CustomWalkstyle_VampireRun_Loco_stairs_vampire_adult_male_cycle_down" asset_name_key="2da66678-8444-48ff-b9d8-4749ef021ac2@RWS1-ASWINDLEHU" />

The asset_name should be the "name=" part from a locomotion file and match its purpose. As far as I can tell, the "name=" part in Builder and the asset_name_key are essentially a form of "comments." They are there so that the person reading understands what the heck the assets are for and who put them together. I left the asset_name_key unchanged, same with the name, and there weren't any problems.

Then there's the effect, which is optional and doesn't affect the walkstyle itself, but I wanted to do something other than the default vampire wispy smoke trailing effect.

I searched far and wide to find existing effects that would look ok at that speed, but that's not important. What's important is the code, which might look something like this and is placed after all of the Builder code:
<Effect effect="ep1_Obj_Shower_spray_science_child" bone="b__ROOT__" mirror="False" offset_x="0" offset_y="0" offset_z="0" />

The bone is where on the sim the effect appears from and the effect is the name that'll link it properly.

So at the end, the walkstyle file might look something like this:
<!-- #?!@ Sage.Asset key=65066ad2-7c92-42fa-ad35-a4e297dd091b@RWS1-ASWINDLEHU -->
<?xml version="1.0" encoding="utf-8"?>
<Walkstyle name="Triplis_CustomWalkstyle_VampireRun_LightEffect" name_key="65066ad2-7c92-42fa-ad35-a4e297dd091b@RWS1-ASWINDLEHU" default_parent="Run" default_parent_key="7fde72af-78b3-4adf-bd69-596f76ec414d@RWS1-BBELL7600" default_cycle_syncpoint="" default_cycle_syncpoint_key="">
  <ToolData posture="Stand_Posture" posture_key="Stand_Posture.statemachine@InGame" />
  <Variant age="Adult" gender="Male" species="Human" parent="" parent_key="" cycle_syncpoint="" cycle_syncpoint_key="" logic_type="Walk" steering_speed="500" time_scale="0.3" default_blend_time="0.13" disable_focus="True" disable_mirroring="False" overlay_blend_in="0.1" overlay_blend_out="0.2" sound_event_repeat_modifier="0" sound_event_cool_down="3">
    <Builder name="stairs_down_cycle" asset_name="Triplis_CustomWalkstyle_VampireRun_Loco_stairs_vampire_adult_male_cycle_down" asset_name_key="2da66678-8444-48ff-b9d8-4749ef021ac2@RWS1-ASWINDLEHU" />
    <Builder name="stairs_up_cycle" asset_name="Triplis_CustomWalkstyle_VampireRun_Locoooo_stairs_vampire_adult_male_cycle_up" asset_name_key="fe50e514-3c38-4fcf-80bf-e8e9c1d00364@RWS1-ASWINDLEHU" />
    <Builder name="stairs_up_start" asset_name="Triplis_CustomWalkstyle_VampireRun_Locoo_stairs_vampire_adult_male_start_up" asset_name_key="8457f92b-6b7e-4552-ba2e-c8685596dd61@RWS1-ASWINDLEHU" />
    <Builder name="stairs_up_stop" asset_name="Triplis_CustomWalkstyle_VampireRun_Locoo_stairs_vampire_adult_male_stop_up" asset_name_key="2fdebfad-ed40-4323-85be-956b543e4278@RWS1-ASWINDLEHU" />
    <Builder name="stairs_down_stop" asset_name="Triplis_CustomWalkstyle_VampireRun_Loco_stairs_vampire_adult_male_stop_down" asset_name_key="aa62cc3c-c4ac-4826-b7f5-d80163c81919@RWS1-ASWINDLEHU" />
    <Builder name="stairs_down_start" asset_name="Triplis_CustomWalkstyle_VampireRun_Loco_stairs_vampire_adult_male_start_down" asset_name_key="4d33b429-f9d3-46b3-97d6-ef97ef8690ce@RWS1-ASWINDLEHU" />
    <Effect effect="ep1_Obj_Shower_spray_science_child" bone="b__ROOT__" mirror="False" offset_x="0" offset_y="0" offset_z="0" />
  </Variant>
</Walkstyle>


Arriving at Station Three

And that's it. With the files all properly put together, all that's left is adding the walkstyle to an interaction.

In my case, I wanted it to be active based on whether you had a particular trait/buff combo on, so that it would function like a toggle. So I had this in the buff:
<?xml version="1.0" encoding="utf-8"?>
<I c="Buff" i="buff" m="buffs.buff" n="Triplis_Sorcerer_HiddenTraitBuffEnable_SuperRun_LightEffect" s="14166503004352760727">
  <V n="_add_test_set" t="tests_set">
    <L n="tests_set">
      <L>
        <V t="statistic">
          <U n="statistic">
            <T n="must_have_stat">True</T>
            <T n="stat">16315149634101581229<!--Commodity: Triplis_SorcererTraitMotive_Alignment--></T>
            <V n="threshold" t="value_threshold">
              <U n="value_threshold">
                <E n="comparison">GREATER_OR_EQUAL</E>
                <T n="value">-29</T>
              </U>
            </V>
          </U>
        </V>
      </L>
    </L>
  </V>
  <T p="InGame\Audio\Stings\sting_buff_gain.propx" n="audio_sting_on_add">39b2aa4a:00000000:8af8b916cf64c646</T>
  <T p="InGame\Audio\Stings\sting_buff_loss.propx" n="audio_sting_on_remove">39b2aa4a:00000000:3bf33216a25546ea</T>
  <T p="InGame\UI\Icons\Debug\missing_image.png" n="icon">2f7d0004:00000000:30f0846c783606f9</T>
  <T n="visible">False</T>
  <V n="walkstyle" t="enabled">
    <U n="enabled">
      <E n="priority">VAMPIRE_RUN</E>
      <T n="walkstyle">27c01d95:00000000:0000000058EB2CC4</T>
    </U>
  </V>
  <V t="enabled" n="walkstyle_behavior_override">
    <U n="enabled">
      <L n="removed_run_flags">
        <E />
        <E>RUN_ALLOWED_OUTDOORS</E>
      </L>
    </U>
  </V>
</I>

And a trait that added that buff. The most important part to note being how the walkstyle gets referenced. It starts with a standard 27c01d95:00000000: and then the unique external name id is appended at the end, making it 27c01d95:00000000:0000000058EB2CC4


TL;DR

If you're experienced at modding the Sims 4 and you want an annotated version of this with the most important parts pulled out, here's a summary:

Walkstyle file needs to use FNV32 instead of 64.
Walkstyle file references to locomotion should be the internal name of the locomotion file, referenced in a builder call under asset_name. The rest of the builder section can be left unchanged.
Locomotion files follow normal naming, with "name=" replacing the common "n=". Animation clips are referenced inside of them.
When referencing the walkstyle file in a buff or interaction, you'd do it like: 27c01d95:00000000:externalUniqueIdPart (ex: 27c01d95:00000000:0000000058EB2CC4)
Mods moved from MTS, now hosted at: https://triplis.github.io
Post edited by EA_Cade on

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file
Return to top