Forum Announcement, Click Here to Read More From EA_Cade.

@SimGuruModSquad: I need help with this please

jtravers88jtravers88 Posts: 591 Member
edited March 5 in Nominated Threads
--Edit: Before reading thru my long explanation, the short of it is that a TunableEnum specifying Actor or TargetSim within a sim_info test case doesn't work inside of a tuple for pregnancy. So as mods come out for same sex pregnancy, both the Actor and Target have the 80% chance to get pregnant and you end up in most cases with two pregnant Sims. --


I'm looking at the SocialSuperInteraction.tdesc. And under the tuple 'pregnancy' it states as an enum:

<TunableEnum name="pregnancy_parent_subject" class="TunableEnumEntry" type="ParticipantType" default="TargetSim" display="Pregnancy Parent Subject" filter="0" group="General" static_entries="interactions.ParticipantType" description="The participant of this interaction that is to be the impregnator." />

Now as I understand it, the targetsim is impregnated, not the impregnator.

Then...

<TunableEnum name="pregnancy_subject" class="TunableEnumEntry" type="ParticipantType" default="Actor" display="Pregnancy Subject" filter="0" group="General" static_entries="interactions.ParticipantType" description="The participant of this interaction that is to be impregnated." />

which seems also reversed. The Actor is the instigator and should be the impregnator, not the impregnated.

So in the interaction bed_TryforBaby, under the tuple pregnancy, I specify the reverse. Then I put in a test so that if a female is the Actor, the multiplier is 0.

Doesn't work. Doesn't matter if the female is the played sim or the clicked sim, she won't get pregnant, even if she is the TargetSim. Here is my code:

<V t="pregnancy">
<U n="pregnancy">
<E n="pregnancy_parent_subject">Actor</E>
<E n="pregnancy_subject">TargetSim</E>
<U n="pregnancy_chance_and_modifiers">
<T n="base_value">0.8</T>
<L n="multipliers">
<U>
<T n="multiplier">0</T>
<L n="tests">
<L>
<V t="sim_info">
<U n="sim_info">
<E n="who">Actor</E>
<V t="specified" n="gender">
<E n="specified">FEMALE</E>
</V>
</U>
</V>
</L>
</L>
</U>
<U>
<T n="multiplier">1.5</T>
<L n="tests">
<L>
<V t="trait">
<U n="trait">
<L n="whitelist_traits">
<T>26498</T>
</L>
</U>
</V>
</L>
</L>
</U>
</L>
</U>
</U>
</V>

I replaced the base code where the check is for a male gender with no Actor/TargetSim specified.

It appears that the Enums are ignored in the pregnancy tuple. Something similar happens when making the multiplier a 1. She will get pregnant regardless if she is the Actor or TargetSim.

Any help?
Post edited by EA_Cade on

Comments

  • Options
    jtravers88jtravers88 Posts: 591 Member
    edited September 2014
    This is what the TunableTestSet.tdescfrag states within a sim_info test:

    <TunableEnum name="who" class="TunableEnumEntry" type="ParticipantType" default="Actor" display="Who" filter="0" group="General" static_entries="interactions.ParticipantType" description="Who or what to apply this test to" />

    So why doesn't this work in a test?
    Post edited by jtravers88 on
  • Options
    IngeJonesIngeJones Posts: 3,247 Member
    Did the poor guy get laid off?
  • Options
    HodysinHodysin Posts: 9 New Member
    They're dead.
  • Options
    SimGuruModSquadSimGuruModSquad Posts: 597 Member
    Hey!

    The tuning for this is fairly complex, but you should be able to set it up to get what you want.

    Here is how the pregnancy element is implemented:

    ....def _do_behavior(self, *args, **kwargs):
    ........subject = self.interaction.get_participant(self.pregnancy_subject)
    ........if subject is not None and subject.household.free_slot_count:
    ............if random.random() < self.pregnancy_chance_and_modifiers.get_multiplier(self.interaction.get_resolver()):
    ................parent_subject = self.interaction.get_participant(self.pregnancy_parent_subject) or subject
    ................subject.sim_info.pregnancy_tracker.start_pregnancy(subject, parent_subject)

    The pregnancy_subject is the Sim who will become pregnant, and the pregnancy_parent_subject is the Sim who will be the parent. For bed_TryForBaby (and the other "Try for Baby" interactions), a test multiplies the pregnancy chance by 0 if the "Actor" Sim Info is Male (there also is a multiplier of 1.5 if the Actor is fertile). In bed_TryForBaby, the pregnancy_subject is Actor and the pregnancy_parent_subject is TargetSim.

    Suppose that there are two Sims, Alice and Bob, who Try for Baby. The way the interaction is set up now, regardless of which Sim initiates the interaction, both Sims run bed_TryForBaby. This is because the affordance_to_push_on_target tunable is set to "Push Self or None". So these are the interactions that will be run:

    Alice -> Bob
    Actor: Alice
    TargetSim: Bob
    Actor is Male: False
    Pregnancy chance: 80%

    Bob -> Alice:
    Actor: Bob
    TargetSim: Alice
    Actor is Male: True
    Pregnancy chance: 80% * 0% = 0%

    To support male pregnancy without the chance of both Sims becoming pregnant, the affordance_to_push_on_target could be changed to point to a new interaction that doesn't have a pregnancy basic extra. It is possible that the existing bed_WooHoo interaction would work, or you may need to copy bed_TryForBaby and remove the pregnancy aspect (some testing is required). Alternatively, the pushed interaction could be the one that causes pregnancy, instead of bed_TryForBaby. This approach has the downside that only one of the Sims (either the initiator or the target) would have the chance of becoming pregnant, but the implementation would be fairly simple.

    Side note: PickedSim is only relevant when a UI picker shows up, so you don’t have to worry about that when dealing with WooHoo/Try for Baby.
  • Options
    jtravers88jtravers88 Posts: 591 Member
    edited September 2014
    Checking active_sim works, removing the male check, and only the played sim's target gets pregnant if the pregnancy_parent_subject and pregnancy_subject enums are reversed. It leaves the issue that a female can't initiate TryforBaby with a male and get pregnant, but that can be worked around in game play by just reversing their roles in the interaction.

    the affordance_to_push_on_target makes no sense to me.
    "push_self_or_none=sims4.tuning.tunable.Tunable(description='If true will push this affordance on the target sim, else push None'"

    That doesn't appear to indicate that both sims will be run thru the code.

    And Picker vs TargetSim IS an issue. According to an mts thread, a picked sim causes the TargetSim check to be null, and somehow forces the 0 multiplier as a result.

    I'm not gonna worry about that right now, since I've removed any check on the TargetSim.
  • Options
    jtravers88jtravers88 Posts: 591 Member
    edited September 2014
    'To support male pregnancy without the chance of both Sims becoming pregnant, the affordance_to_push_on_target could be changed to point to a new interaction that doesn't have a pregnancy basic extra.'

    Do you have any idea how hard it is to understand this statement with the little knowledge I have of all this brand new code?

    I appreciate your response however.
  • Options
    jtravers88jtravers88 Posts: 591 Member
    If this code was placed in bed_TryforBaby, would it cause only the pregnancy_subject to pass thru the pregnancy code in question?

    <V n="affordance_to_push_on_target" t="push_self_or_none">
    <T n="push_self_or_none">False</T>
    </V>
  • Options
    SimGuruModSquadSimGuruModSquad Posts: 597 Member
    jtravers88 wrote: »
    If this code was placed in bed_TryforBaby, would it cause only the pregnancy_subject to pass thru the pregnancy code in question?

    <V n="affordance_to_push_on_target" t="push_self_or_none">
    <T n="push_self_or_none">False</T>
    </V>

    Your change would probably would break this interaction, since it's important that both Sims run a variant of the WooHoo/TryForBaby interaction.
    This field is a variant: False for "push_self_or_none" means that no interaction will be pushed. Instead, you will should refer to a specific interaction to push. Here's how you would change the tuning to push the bed_WooHoo interaction:

    <V t="push_affordance" n="affordance_to_push_on_target">
    <T n="push_affordance">13099</T>
    </V>

    This may or may not work ( I haven't tried it yet). If it doesn't you can make a copy of bed_TryForBaby (giving it a different ID) and remove everything inside the <V t="pregnancy"></V> elements from that interaction. The reason I called this a "basic extra" is because it is inside the <L n="basic_extras"> section of tuning, which is a list of actions to execute when a Sim runs the interaction. So a clone of bed_TryForBaby interaction without the pregnancy element should keep Try For Baby working just as it does now except that only the initiator would have a chance of getting pregnant.
  • Options
    jtravers88jtravers88 Posts: 591 Member
    edited September 2014
    <V t="participant" n="_icon">
    <U n="participant">
    <L n="participant_type">
    <E>TargetSim</E>
    </L>
    </U>
    </V>

    Would I need to change the participant type in my copy of bed_TryForBaby to Actor? If not, what guides the app to use one for the initiator and one for the recipient of the interaction?

    It might be mute since a check for active_sim = true with a 0 multiplier and active_sim = false with a 1 multiplier, after reversing the roles for subject and parent_subject seems to work fine. Target always gets pregnant, Actor never does, however both still get the pregnancy test on the toilet.
  • Options
    SimGuruModSquadSimGuruModSquad Posts: 597 Member
    jtravers88 wrote: »
    <V t="participant" n="_icon">
    <U n="participant">
    <L n="participant_type">
    <E>TargetSim</E>
    </L>
    </U>
    </V>

    Would I need to change the participant type in my copy of bed_TryForBaby to Actor? If not, what guides the app to use one for the initiator and one for the recipient of the interaction?

    When the other interaction is pushed on to the target, the actor and target are swapped for that Sim. So there should be no need to change the participant icon.
    jtravers88 wrote: »
    It might be mute since a check for active_sim = true with a 0 multiplier and active_sim = false with a 1 multiplier, after reversing the roles for subject and parent_subject seems to work fine. Target always gets pregnant, Actor never does, however both still get the pregnancy test on the toilet.

    I like this solution!
  • Options
    jtravers88jtravers88 Posts: 591 Member
    ' So a clone of bed_TryForBaby interaction without the pregnancy element should keep Try For Baby working just as it does now except that only the initiator would have a chance of getting pregnant. '

    So I would have 2 bed_TryForBaby interactions (different ids), one with the pregnancy code, one without. How is it that one sim will pass thru one of them, and the other sim will pass thru the other one. How would I know that is going to happen?

    This is just informational as I have no plan to try this but it is probably important to understand how I should know that cloning an interaction would cause one sim to perform one, and the other to perform the other... yea.
  • Options
    SimGuruModSquadSimGuruModSquad Posts: 597 Member
    bed_TryForBaby is a special case -- most social interactions only have one instance that runs. In bed_TryForBaby, the other Sim will run an interaction because "affordance_to_push_on_target" is set. That is what this tuning does:

    <V t="push_affordance" n="affordance_to_push_on_target">
    <T n="push_affordance">[id of the interaction you want the target Sim to perform]</T>
    </V>
  • Options
    velocitygrassvelocitygrass Posts: 103 Member
    Has anyone managed to get this to work? I've added a second interaction, cloned from the original bed_TryForBaby but the target just stands still after accepting the social even though the try for baby is in the queue while the actor goes to the bed and waits there.

Leave a Comment

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