A downloadable mod

A set of tools to inject into different tuning resources. Right now, Injection Tools allows you to inject:

  • Shifts of situations into a SchedulingZoneDirector or SchedulingWalkbyDirector
  • Situations into a WalkbyTuning
  • Filter terms into a SimFilter

These together allow you to add new situations to the world, or add additional constraints to who can be chosen for existing situations, without causing compatibility issues.

Adding Situations To Worlds

To add a situation to most worlds, you'll need to create a snippet tuning of class "SituationShiftInjector".  An example tuning is below:

<?xml version="1.0" encoding="utf-8"?>
<I c="SituationShiftInjector" i="snippet" m="injection_tools.situation_shift_injector" n="BrainBlasted:DogWalkerWalkbyInjector" s="10017731830411536442">
  <V n="references" t="walkby_directors">
    <L n="walkby_directors">
      <T>232250<!--walkbyDirector_Residential_EcoWorld_Industrial--></T>
    </L>
  </V>
  <L n="situation_shifts">
    <U>
      <T n="count_based_on_expected_sims">True</T>
      <V n="shift_curve" t="curve_based">
        <U n="curve_based">
          <L n="entries">
            <U>
              <U n="days_of_the_week">
                <T n="0 SUNDAY">True</T>
              </U>
              <L n="walkby_desire_by_time_of_day">
                <U>
                  <T n="hour_of_day">7</T>
                  <U n="desired_walkby_situations">
                    <V t="literal" n="desired_sim_count">
                      <U n="literal">
                        <T n="value">2</T>
                      </U>
                    </V>
                    <L n="weighted_situations">
                      <U>
                        <T n="situation">168135<!--WalkbyDogWalker: walkbyDogWalker_walk_TYAE--></T>
                      </U>
                    </L>
                  </U>
                </U>
              </L>
            </U>
          </L>
        </U>
      </V>
      <E n="shift_strictness">OVERLAP</E>
    </U>
  </L>
</I>

This tuning injects into the industrial neighborhood from Eco Lifestyle, adding a dog walker situation with 2 sims, starting at hour 7.  For City Living neighborhoods, we need to use a snippet of type "WalkbyTuningInjector":

<?xml version="1.0" encoding="utf-8"?>
<I c="WalkbyTuningInjector" i="snippet" m="injection_tools.situation_shift_injector" n="BrainBlasted:CityLifeDogWalkerWalkbyInjector" s="10594960976327620679">
  <L n="walkby_tunings">
    <!-- These are all the city living neighborhood walkby tunings -->
    <T>134174<!--walkbyTuning_CityLife_OpenStreet_artsQuarter--></T>
    <T>134172<!--walkbyTuning_CityLife_OpenStreet_FashionDistrict--></T>
    <T>134171<!--walkbyTuning_CityLife_OpenStreet_SpiceMarket--></T>
    <T>134173<!--walkbyTuning_CityLife_OpenStreet_Uptown--></T>
  </L>
  <U n="walkby_desire_by_day_of_week">
    <L n="entries">
      <U>
        <U n="days_of_the_week">
          <T n="0 SUNDAY">True</T>
        </U>
        <L n="walkby_desire_by_time_of_day">
          <U>
            <T n="hour_of_day">7</T>
            <U n="desired_walkby_situations">
              <V t="literal" n="desired_sim_count">
                <U n="literal">
                  <T n="value">2</T>
                </U>
              </V>
              <L n="weighted_situations">
                <U>
                  <T n="situation">168135<!--WalkbyDogWalker: walkbyDogWalker_walk_TYAE--></T>
                </U>
              </L>
            </U>
          </U>
        </L>
      </U>
    </L>
  </U>
</I>


Injecting Filter Terms To A TunableSimFilter

To add filter terms, use a snippet of class "SimFilterInjector":

<?xml version="1.0" encoding="utf-8"?>
<I c="SimFilterInjector" i="snippet" m="injection_tools.sim_filter_injector" n="BrainBlasted:DogWalkerFilterInjection" s="14163905142204243963">
  <L n="filters">
    <T>133610<!-- filter_PetOwner_Dog_TYAE --></T>
  </L>
  <L n="filter_terms_to_add">
    <V t="lives_in_region">
      <U n="lives_in_region">
        <V n="region" t="current_region"/>
      </U>
    </V>
  </L>
</I>

This adds a check to the dog walker filter to make sure dog walkers live in the current world.

Note To Mod Authors

If you decide to use the source code to integrate these injectors to your own scripts, please rename the classes. This way they don't conflict with mods using the ts4script on this page.

StatusReleased
CategoryGame mod
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorBrainBlasted
Tagsinjection, modding, mods, Sims 4, the-sims

Download

Download
brainblasted_InjectionTools.ts4script 7 kB
Download
Injection Tools Sources.zip 12 kB
Download
Injection Tools Tdesc.zip 23 kB

Install instructions

Place brainblasted_InjectionTools.ts4script directly in your mods folder. In your Sims 4 settings, check that you have script mods enabled.

Comments

Log in with itch.io to leave a comment.

(-1)

Hey, I used your source code to make an injector for adding `object_based_situations_schedule` to the SchedulingZoneDirector. It's literally almost exactly the same as the SituationShiftInjector, just with a few variable name changes and adjustments to INSTANCE_TUNABLES. Are you OK with me distributing that edited file with mods that use it on my tumblr? I did re-name the classes and files and everything. And I'll link back to this post/give you credit, of course. Let me know, thanks!

(1 edit) (+1)

Hey man, has this been updated because the "SituationShiftInjector" isn't working for me :-(.

Can I email you? Are you on skype?

(+1)

Hey there! Can you give me some details? I haven’t been around for a bit to update mods.

(+1)

Well i made this situation snippet like the instructions said...

I renamed the class so that it wouldn't cause conflict.  

I wanted to add to the situation shifts in the zone directors listed so that it would spawn several "situationSimple_TempleSkeleton".

I've attached the script and package as I've added it to my mods folder, but I see no Temple skeletons :-( when i play.   Could you let me know where I'm going wrong, or if the script is out of date.

https://filebin.net/rgpx1tpu9f92dmmm

(+1)(-1)

Hey Dude , what happened??

(+1)

Life - folks do get busy, after all

(+1)(-1)

Hey man, do you do work on commission?

(-7)

Yeah, people get busy... but uhh, usually rather than a snarky response when asked what happened, they actually respond politely with a real response, and then they move on to actually helping like they said they would. But no big man, you don't need to be a decent human being, you can just be you, a non respectable person-thing.

(+3)

Being busy can mean that I don’t have the time to type a detailed response or investigate an issue. I have a lot of other things to take care of, with TS4 mods being a very minor priority.