Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Test Subject
Original Poster
#1 Old 17th Sep 2014 at 4:15 AM
Default Using PickedSim and TargetSim in Tuning
I am working on a tuning mod that requires a check on the passive sim in an interaction. However, the test that I am using involves checking PickedSim (for actions that bring up a list of sims) and if the action uses TargetSim (for actions that are selected from the wheel) it breaks the whole test. I assume that if I add another test to the list that checks TargetSim, then the test would be entirely broken, as there would always be a null in one of the tests. I am trying to avoid making a whole new content type to deal with both methods of sim selection.
My question is this:
Does anyone know of a way to combine the selection types in a test (specifically, for a "who" element inside of a sim_info check) or a way to check for null in tuning as to not test a null pointer?
Advertisement
Test Subject
#2 Old 17th Sep 2014 at 10:47 PM
I'm facing the same problem with you. I made a mpreg mod, it enables the gay couples to the try for baby interaction. But after woohooing, both of them got pregnant...I realy need a way to seperate the initiator and the target.
Test Subject
Original Poster
#3 Old 18th Sep 2014 at 2:35 AM
To make sure only one gets pregnant, I added a multiplier to the the pregnancy chance and modifiers entry that looks like this:

To make it so that only the TARGET MALE gets impregnated, you will need to change the gender reference to "37512" instead of "24018". Additionally, you should probably add a gender check to the enabled sim check so that female active sims can still become impregnated by males. Note, that this will only work for TARGETSIM interactions (those that were initiated by clicking on the sim in the world) and anything that uses PICKEDSIM (initiated by clicking on an object, then selecting the sim) will break the test, and cause the 0.0 multiplier to be applied no matter what. If you prefer using PICKEDSIM interactions, you can change the who target from "618" to "2997", but that in turn will break the TARGETSIM checks.
To make it so only the initiator gets pregnant, change the True to a False, add a gender check to allow females to still become pregnant if desired, then eliminate the secondary check.
Test Subject
#4 Old 18th Sep 2014 at 5:16 AM
Neat! Didn't think of doing it like that, do you mind if I use that in my mod?

Kind of awkward though, I already released an mpreg mod, didn't think anybody else would be making one too, heh.

Maybe I'll just split the interaction into two so that you can get your own Sim pregnant.
Test Subject
Original Poster
#5 Old 18th Sep 2014 at 8:58 AM
Go ahead and use it. I wouldn't have posted it if I wanted it to myself But I would like to know if anyone has found a way around the whole Picked vs Target thing.

Edit: corrected grammar
Lab Assistant
#6 Old 21st Sep 2014 at 2:12 PM Last edited by jtravers88 : 21st Sep 2014 at 4:56 PM.
I'm so confused. Let me ask, is your test basically saying, if the sim being evaluated is the active_sim, AND the sim is the TargetSim and a Female, apply the 0 multiplier? I must be looking at the way the tests work all wrong... I thought the active_sim is always the played sim (Actor) at the time the interaction is initiated.

I tried your code and it works. But it works in a way I don't understand and I need to know how it works or I'll go crazy.

Can you explain it in pseudocode? And if a completely separate test is done with it's own multiplier, for the PickedSim, are you saying that the code for the TargetSim will always apply the 0 multiplier? Doesn't make sense.

I also would like to know why you use decimal references for targetsim/pickedsim and male/female instead of the way it is used in most of the base xml. Why do you use:

<r n="who" x="618" />
<r n="gender" x="24018" />

instead of:

<V n="gender" t="specified">
<E n="specified">FEMALE</E>
</V>
<E n="who">TargetSim</E>
Lab Assistant
#7 Old 21st Sep 2014 at 6:22 PM
<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." />

According to the tdesc for pregnancy, the TargetSim is considered to be the initiator of the interaction. That may be why your code works. Although it appears in your code as if the recipient should get the 0 modifier, just considering what I would interpret the TargetSim to be, it is actually reversed.

However, if I add this code, similar to the debug_MakePregnant base code...

<E n="pregnancy_parent_subject">Actor</E>
<E n="pregnancy_subject">TargetSim</E>

then run your code, the played sim always gets pregnant, and the recipient of the interaction never does.

BUT, if I then change the 'who' to Actor
<E n="who">Actor</E>
instead of <E n="who">TargetSim</E>
nobody gets pregnant. You would think that would make the code look right, and it should work. I don't get it.

If we could get it to work with Actor, then TargetSim or PickedSim wouldn't matter.
Test Subject
Original Poster
#8 Old 21st Sep 2014 at 10:49 PM
In response to your first post, those multipliers are used for every pregnancy interaction, and if one of the sims being referenced is null, then it seems to throw off the test and force the multiplier to be applied. For instance, if I use a pickedsim interaction with the targetsim test, that multiplier applies itself no matter what. Also, I used the decimal references because I edited the bnry file instead of the individual tunings, and that's how they most often do it in the bnry.

As for your 2nd/4th post, the base chance and multipliers are applied to both sims taking part in the interaction, and whoever is being checked at the time is considered the "Actor", whereas the original target of the interaction is always TargetSim/PickedSim. So lets say on the first run through, it checks my sim. While it is checking my sim, it sets my sim equal to "Actor", and the default target of the checks is "Actor", therefore if I don't specify "who" in a test it defaults to "Actor". Thus the first part of my check ("is_active_sim") returns true the first time around. The second part of the check specifies "who", which is TargetSim. TargetSim will reference the target of the action. It then checks gender. I put that part in to make sure my female sim doesn't fail to become pregnant should I try for baby with a male target. So I will only apply the 0 modifier when the target is female, and only to the active sim.

The second time around, it checks the other participant, in this case it happens to also be TargetSim. So the TargetSim gets set to actor, but it is still TargetSim as well. So when it goes to check "is_active_sim", it fails the test because it is checking the target of the interaction, instead of the sim I am playing. Therefore it does not get the 0 multiplier applied.

As to the last part of your post, I am still totally lost on which targets and elements can be applied to a pregnancy test, and this was the first set of elements that worked as intended. I've already tried initiating_sim instead of is_active_sim and I got nowhere. Maybe you can find a better set of tests.
Lab Assistant
#9 Old 22nd Sep 2014 at 1:05 AM Last edited by jtravers88 : 22nd Sep 2014 at 1:45 PM.
This works for me. Along with a boatload of other tweaks to other files.

<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">1</T>
<L n="tests">
<L>
<V t="sim_info">
<U n="sim_info">
<V n="is_active_sim" t="enabled">
<T n="enabled">True</T>
</V>
</U>
</V>
</L>
</L>
</U>
<U>
<T n="multiplier">0</T>
<L n="tests">
<L>
<V t="sim_info">
<U n="sim_info">
<V n="is_active_sim" t="enabled">
<T n="enabled">False</T>
</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>

Thanks for your insight.
Test Subject
Original Poster
#10 Old 24th Sep 2014 at 5:02 PM
I have discovered a fix for TargetSim vs PickedSim. Apparently, if one is null it will return true, which means they work together if you put both in the same condition set.
Back to top