Forum Discussion
12 years ago
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.
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.