Jump to content

AAF Family Planning Enhanced for CBBE, Fusion Girl, and Jane Bod


Recommended Posts

3 hours ago, EgoBallistic said:

 

The FPFP_GiveBirth event tells you if the birth was live: (akArgs[1] as Bool) is true if a baby was born, false otherwise.  However, the MorningAfterPill property in the player preg data is reset before the FPFP_GiveBirth event is sent out, so you can't rely on it.

 

However, you can track whether the player took a morning after pill yourself, using an OnItemEquipped event like FPE does.  So you can get all the information you need:


Function Initialize()
    If LoadFPE() && LoadAN2()
        RegisterForFPEEvents()
        RegisterForRemoteEvent(PlayerRef, "OnItemEquipped") ; so we can tell when player takes pill
    EndIf
EndFunction

Event Actor.OnItemEquipped(Actor akSender, Form akBaseObject, ObjectReference akReference)
    If akBaseObject == FPFP_Pill

        PlayerPregData PlayerPreg = FPE.GetPlayerPregData()

        If PlayerPreg.IsPregnant && PlayerPreg.GetCurrentMonth() < 1.0
            MorningAfterPill = True
        EndIf
    EndIf
EndEvent

Event FPFP_Player_Script.FPFP_GiveBirth(FPFP_Player_Script akSender, Var[] akArgs)
    If (akArgs[0] as Actor) == PlayerREF                                                                   
        AmIPregnant = False
        Bool WasLiveBirth = akArgs[1] as Bool 
                                  
        If WasLiveBirth == False && MorningAfterPill == True
            MensesScript.EnableCycle()
            MensesScript.GivePeriod()
            MorningAfterPill = False  
        Else
            WaitToReEnablePeriod()
        EndIf
    EndIf
EndEvent

 

Perfect, OK thanks again. Edit: Sorry wait, are these commands part of the API? Can I include them in my script or do I need my own version? Further edit, I'm guessing they are as you used some of my code.

Link to comment
16 hours ago, RealBarenziah said:

are these commands part of the API? Can I include them in my script or do I need my own version? Further edit, I'm guessing they are as you used some of my code.

Yes, everything I added there is part of the FPE API. FPE.GetPlayerPregData() is the critical one there, which returns the PlayerPregData object and thereby allowing you to access the IsPregnant property and the GetCurrentMonth() function on the player preg data object.  The MorningAfterPill variable would be local to your script, it can't be the one from the player data object for the reasons I explained in that post.

Link to comment
15 minutes ago, EgoBallistic said:

Yes, everything I added there is part of the FPE API. FPE.GetPlayerPregData() is the critical one there, which returns the PlayerPregData object and thereby allowing you to access the IsPregnant property and the GetCurrentMonth() function on the player preg data object.  The MorningAfterPill variable would be local to your script, it can't be the one from the player data object for the reasons I explained in that post.

Fantastic, thanks. Sorry, I know you're probably sick of me by now (but my interest in my project is a compliment to how great your mod is) but can I ask how FPE handles calculating fertility? Can I change the values without your mod just overriding them? Ie would this FertilityWindow function that's supposed to represent the 6-7 day window when a woman is fertile work (I've changed how I'm thinking of syncing the cycles, hence the different variable, and the separate variables for normal and post pregnancy cycles are because I aim to add variability to the length of a semi-randomised number of post-pregnancy cycles to simulate what happens in real life).

 

Spoiler

Function FertilityWindow()
	If  (DayOfCycle > 0)
		If (PostPregnancyPeriod > 0)
			FertilityWindowCycle = NextCycleWillBe
		Else
			FertilityWindowCycle = NormalCycle
		If (DayOfCycle > 27)
			DayOfCycle = 1
			Self.StartTimerGameTime(FertilityWindowCycle / 28 as float, 1100)
		If (DayOfCycle == 1)
			FPFP_Global_Chance = (Utility.RandomFloat 0.4, 7)
			DayOfCycle = (DayOfCycle + 1)
			Self.StartTimerGameTime(FertilityWindowCycle / 28 as float, 1100)
		ElseIf (DayOfCycle == 2)
			FPFP_Global_Chance = (Utility.RandomFloat 8, 17)
			DayOfCycle = (DayOfCycle + 1)
			Self.StartTimerGameTime(FertilityWindowCycle / 28 as float, 1100)
		ElseIf (DayOfCycle == 3)
			FPFP_Global_Chance = (Utility.RandomFloat 13, 29)
			DayOfCycle = (DayOfCycle + 1)
			Self.StartTimerGameTime(FertilityWindowCycle / 28 as float, 1100)
		ElseIf (DayOfCycle == 4)
			FPFP_Global_Chance = (Utility.RandomFloat 8, 33)
			DayOfCycle = (DayOfCycle + 1)
			Self.StartTimerGameTime(FertilityWindowCycle / 28 as float, 1100)
		ElseIf (DayOfCycle == 5)
			FPFP_Global_Chance = (Utility.RandomFloat 0.8, 11)
			DayOfCycle = (DayOfCycle + 1)
			Self.StartTimerGameTime(FertilityWindowCycle / 28 as float, 1100)
		ElseIf (DayOfCycle == 6)
			FPFP_Global_Chance = (Utility.RandomFloat 3, 9)
			DayOfCycle = (DayOfCycle + 1)
			Self.StartTimerGameTime(FertilityWindowCycle / 28 as float, 1100)
		ElseIf (DayOfCycle == 7)
			FPFP_Global_Chance = (Utility.RandomFloat 0.4, 7)
			DayOfCycle = (DayOfCycle + 1)
			Self.StartTimerGameTime(FertilityWindowCycle / 28 as float, 1100)
		Else
			FPFP_Global_Chance = 0.1
			DayOfCycle = (DayOfCycle + 1)
			Self.StartTimerGameTime(FertilityWindowCycle / 28 as float, 1100)
		EndElse
		EndIf
	EndIf
EndFunction

 

 

Link to comment
14 minutes ago, EgoBallistic said:

It's just a random chance each day, there's nothing to it really.

OK, but is there any way for me to maybe detect when that happens and override it or something? And by day I assume you mean game day? My system above would by default change the rate more frequently than that so maybe that would be OK.

Link to comment
5 minutes ago, Merlin Wizzard said:

Great mod. But where's the baby? After going a full nine months and getting to the doctor  for delivery. I hear the baby cry, get the message that the quest has succeeded, but no baby anywhere. No longer pregnant and I search through the inventory, but nothing. Am I missing something?

 

It will be in your inventory under Misc.

 

image.png

Link to comment
3 minutes ago, Merlin Wizzard said:

Great mod. But where's the baby? After going a full nine months and getting to the doctor  for delivery. I hear the baby cry, get the message that the quest has succeeded, but no baby anywhere. No longer pregnant and I search through the inventory, but nothing. Am I missing something?

I think I know what your problem is, but I going to need a bit more info

 

Are you using the latest version of Family Planning Enhanced?

are you using Baby Addon in the Wasteland Dairy Framework Pack?

are you using Standalone Baby Addon?

 

also please post your load order

Link to comment

Hi, so I think I have the concept at least of a script down in theory though judging by the number of compiling errors I'm getting not in practice. But one of those many errors is "FPFP_GetPregnant is not a custom event on fpfp_player_script or one if its parents", I thought that's where it was?

 

Actually I'm gtting a few errors related to stuff in your mod:

 

(213,20): variable FPFP_Pill is undefined
(214,8): variable PlayerPreg is undefined
(214,25): GetPlayerPregData is not a function or does not exist
(215,11): variable PlayerPreg is undefined
(485,0)fpfp_player_script.fpfp_getpregnant does not exist because fpfp_player_script cannot generate fpfp_getpregnant events
(501,14)Ourself is not a property on script fpfp_player_script or one of its parents
(500,0)fpfp_player_script.fpfp_givebirth does not exist because fpfp_player_script cannot generate fpfp_givebirth events

 

The relevant lines:

 

If akBaseObject == FPFP_Pill

PlayerPreg = FPE.GetPlayerPregData()

If PlayerPreg.IsPregnant && PlayerPreg.GetCurrentMonth() < 1.0

Event FPFP_Player_Script.FPFP_GetPregnant(FPFP_Player_Script akSender, Var[] akArgs)

If (akSender.Ourself == PlayerREF)

Event FPFP_Player_Script.FPFP_GiveBirth(FPFP_Player_Script akSender, Var[] akArgs)

 

Also, I'm confused, I'm going through some tutorials now to try to figure out what the heck I'm doing wrong, and they're saying const globals can't be changed mid-game. How then are you using const globals for  FPFP_Global_Day and  FPFP_Global_Chance?

 

Link to comment
3 hours ago, RealBarenziah said:

Actually I'm gtting a few errors related to stuff in your mod:

(213,20): variable FPFP_Pill is undefined

  • You have to declare FFPP_Pill as a Property of your script, e.g. Potion property FPFP_Pill Auto Const

(214,8): variable PlayerPreg is undefined

  • You have to declare PlayerPreg, e.g. FPFP_PlayerPregData PlayerPreg

(214,25): GetPlayerPregData is not a function or does not exist

  • GetPlayerPregData is a function on FPFP_Player_Script.  You have to declare an instance of that script as a Property of your script, e.g. FPFP_Player_Script property FPE Auto Const, and then call the function on that instance, e.g. PlayerPreg = FPE.GetPlayerPregData()

(485,0)fpfp_player_script.fpfp_getpregnant does not exist because fpfp_player_script cannot generate fpfp_getpregnant events

  • Make sure you have the latest version of FPE installed, I only added that event to the latest version (2.611)

(501,14)Ourself is not a property on script fpfp_player_script or one of its parents

  • As I mentioned in an earlier post: the event is not sent by FPFP_BasePregData, so you have to use akArgs[0] as Actor, not Ourself.

(500,0)fpfp_player_script.fpfp_givebirth does not exist because fpfp_player_script cannot generate fpfp_givebirth events

  • as above, make sure latest FPE source
3 hours ago, RealBarenziah said:

Also, I'm confused, I'm going through some tutorials now to try to figure out what the heck I'm doing wrong, and they're saying const globals can't be changed mid-game. How then are you using const globals for  FPFP_Global_Day and  FPFP_Global_Chance?

When you declare a property as Const, the value of that property cannot be changed by the script.  But when you declare a game object as a property, the value of the property is a pointer to that object, not the value the object contains.  So the script can't change which object FPFP_Global_Day points to, but it can call functions on the globalvariable to change its value, e.g. FPFP_Global_Day.SetValue(1.0).

Link to comment
3 hours ago, EgoBallistic said:

(213,20): variable FPFP_Pill is undefined

  • You have to declare FFPP_Pill as a Property of your script, e.g. Potion property FPFP_Pill Auto Const

(214,8): variable PlayerPreg is undefined

  • You have to declare PlayerPreg, e.g. FPFP_PlayerPregData PlayerPreg

(214,25): GetPlayerPregData is not a function or does not exist

  • GetPlayerPregData is a function on FPFP_Player_Script.  You have to declare an instance of that script as a Property of your script, e.g. FPFP_Player_Script property FPE Auto Const, and then call the function on that instance, e.g. PlayerPreg = FPE.GetPlayerPregData()

(485,0)fpfp_player_script.fpfp_getpregnant does not exist because fpfp_player_script cannot generate fpfp_getpregnant events

  • Make sure you have the latest version of FPE installed, I only added that event to the latest version (2.611)

(501,14)Ourself is not a property on script fpfp_player_script or one of its parents

  • As I mentioned in an earlier post: the event is not sent by FPFP_BasePregData, so you have to use akArgs[0] as Actor, not Ourself.

(500,0)fpfp_player_script.fpfp_givebirth does not exist because fpfp_player_script cannot generate fpfp_givebirth events

  • as above, make sure latest FPE source

When you declare a property as Const, the value of that property cannot be changed by the script.  But when you declare a game object as a property, the value of the property is a pointer to that object, not the value the object contains.  So the script can't change which object FPFP_Global_Day points to, but it can call functions on the globalvariable to change its value, e.g. FPFP_Global_Day.SetValue(1.0).

Thanks so much, but I still can't get it. I've put in exactly the text you told me to and the compiler is still shitting itself. And that's not the only problem, text that was in the original script that presumably compiled fine is also throwing up errors in mine and I just don't understand why. And I'm still getting the problem with not being able to register for remote events, is that something I need to set up in the CK or something? And BTW registering with playerREF as scriptobject was also in the original script. I tried changing it to as Actor but it didn't help. God, this is so frustrating, I'm about ready to tear my hair out and quit. The only reason I haven't is the remaining errors are related to your code and the AN2 code. I know I'm asking a lot, but is there any chance you can take a look at my script and see why I'm getting these errors? Here are the errors I'm getting: 

 

Spoiler

(109,39): unknown type advancedneeds:an_mensesscript
(110,98): unknown type advancedneeds:an_mensesscript
(110,95): cannot convert to unknown type advancedneeds:an_mensesscript
(110,95): cannot cast a quest to a advancedneeds:an_mensesscript, types are incompatible
(153,29): FPFP_GetPregnant is not a custom event on fpfp_player_script or one if its parents
(154,29): FPFP_GiveBirth is not a custom event on fpfp_player_script or one if its parents
(212,8): variable PlayerPreg is undefined
(212,25): GetPlayerPregData is not a function or does not exist
(212,8): type mismatch while assigning to a none (cast missing or types unrelated)
(213,12): variable PlayerPreg is undefined
(213,23): none is not a known user-defined script type
(213,39): variable PlayerPreg is undefined
(213,50): none is not a known user-defined script type
(213,68): cannot compare a void to a float (cast missing or types unrelated)
(263,56): OnPlayerLoadGame is not an event on scriptobject or one if its parents
(291,0): new event onmcmsettingchange cannot be defined because the script is not flagged as native
(478,59): OnDeath is not an event on scriptobject or one if its parents
(489,0): fpfp_player_script.fpfp_getpregnant does not exist because fpfp_player_script cannot generate fpfp_getpregnant events
(504,0): fpfp_player_script.fpfp_givebirth does not exist because fpfp_player_script cannot generate fpfp_givebirth events
(538,2): variable advancedneeds:an_needsmainscript is undefined
(538,35): none is not a known user-defined script type
(538,47): void is not a known user-defined script type
(636,58): OnItemEquipped is not an event on scriptobject or one if its parents
(637,58): OnItemUnequipped is not an event on scriptobject or one if its parents
(638,58): OnLocationChange is not an event on scriptobject or one if its parents

And my script is attached in case you use Notepad++ or something that gives  a line count.

FertilityPlusScriptv3.psc

Link to comment
4 hours ago, RealBarenziah said:

I know I'm asking a lot, but is there any chance you can take a look at my script and see why I'm getting these errors?

See attached.  I fixed all the errors except the ones on line 538 which occur because advancedneeds:an_needsmainscript is missing (you need to extract and decompile it and put the psc in Data\Scripts\Source\User\AdvancedNeeds)

 

4 hours ago, RealBarenziah said:

And I'm still getting the problem with not being able to register for remote events, is that something I need to set up in the CK or something? And BTW registering with playerREF as scriptobject was also in the original script.

As I have explained, you can not register for those events on a ScriptObject.  That is not what was in the original code.  It was in the code generated by Champollion, which is wrong.  Champollion frequently casts things (X as Y) incorrectly.  You don't need to cast PlayerREF as anything since it is already an Actor, so I just removed those casts and those lines now compile fine.

 

Note that these errors:

(153,29): FPFP_GetPregnant is not a custom event on fpfp_player_script or one if its parents
(154,29): FPFP_GiveBirth is not a custom event on fpfp_player_script or one if its parents

 

did not happen for me.  I think you still have the wrong version of fpfp_player_script in your sources.

FertilityPlusANScriptReplacer.psc

Link to comment
7 minutes ago, EgoBallistic said:

See attached.  I fixed all the errors except the ones on line 538 which occur because advancedneeds:an_needsmainscript is missing (you need to extract and decompile it and put the psc in Data\Scripts\Source\User\AdvancedNeeds)

 

As I have explained, you can not register for those events on a ScriptObject.  That is not what was in the original code.  It was in the code generated by Champollion, which is wrong.  Champollion frequently casts things (X as Y) incorrectly.  You don't need to cast PlayerREF as anything since it is already an Actor, so I just removed those casts and those lines now compile fine.

 

Note that these errors:

(153,29): FPFP_GetPregnant is not a custom event on fpfp_player_script or one if its parents
(154,29): FPFP_GiveBirth is not a custom event on fpfp_player_script or one if its parents

 

did not happen for me.  I think you still have the wrong version of fpfp_player_script in your sources.

FertilityPlusANScriptReplacer.psc 23.59 kB · 0 downloads

Thank you so much, you are a legend! I hopefully will be able to fix the remaining issues myself.

 

By the way, one of my pie in the sky ideas for my or your mod was a birthing scene, that I was envisioning in a custom interior worldspace using one of the game's medical bed type items as furniture. But with no way to make new anims even if I had the talent to do so, I thought it would have to remain a pie in the sky idea. But with the trove of new anims I just found as mentioned here, which has such idles as "Laying_Down_On_An_Exam_Table_Bed_As_In_A_Doctors_Office", "Laying_On_Back_Writhing_In_Pain", "Laying_While_Breathless_Idle", "Laying_Squirming_And_Moaning", etc..., I'm suddenly  thinking it's not so pie in the sky. How exciting.

Link to comment
49 minutes ago, RealBarenziah said:

By the way, one of my pie in the sky ideas for my or your mod was a birthing scene, that I was envisioning in a custom interior worldspace using one of the game's medical bed type items as furniture. But with no way to make new anims even if I had the talent to do so, I thought it would have to remain a pie in the sky idea. But with the trove of new anims I just found as mentioned here, which has such idles as "Laying_Down_On_An_Exam_Table_Bed_As_In_A_Doctors_Office", "Laying_On_Back_Writhing_In_Pain", "Laying_While_Breathless_Idle", "Laying_Squirming_And_Moaning", etc..., I'm suddenly  thinking it's not so pie in the sky. How exciting.

Yeah I have been looking at that pack myself.  I hadn't looked specifically at those, but I will play around with them and see about adding them as birth animations,  Thanks for pointing them out.

Link to comment
On 9/12/2020 at 2:28 AM, Invictusblade said:

I think I know what your problem is, but I going to need a bit more info

 

Are you using the latest version of Family Planning Enhanced?

are you using Baby Addon in the Wasteland Dairy Framework Pack?

are you using Standalone Baby Addon?

 

also please post your load order

Thank you, but I finally found it somewhere in my inventory. I thought I would have been able to place it in a crib, but no such choice. Dropping it on the ground doesn't seem to be the best idea, but that's what I'm supposed to do, I guess. The baby add on does not appeal to me. Have no idea what sort of unimmersive twisted mind came up with addictive cum and whatever other nonsense is included with that add-on, but it's not my cup of tea.

 

Make an add-on with cribs and baby bottles filled with milk or lactating boobs for breastfeeding and maybe you have something.

Link to comment
1 minute ago, Merlin Wizzard said:

I thought I would have been able to place it in a crib, but no such choice.

You literally drop the baby into a crib - you stand in front of it, open your inventory, and drop the baby.  FPE will detect what you are doing and place the baby in the correct position.

 

It can be an existing crib somewhere, or one you crafted in a settlement.

Link to comment
4 minutes ago, EgoBallistic said:

You literally drop the baby into a crib - you stand in front of it, open your inventory, and drop the baby.  FPE will detect what you are doing and place the baby in the correct position.

 

It can be an existing crib somewhere, or one you crafted in a settlement.

I tried to approach the crib as a container looking to transfer the baby, but I'll give that a try. Thanks

Link to comment

I have Autonomy installed, so NPC's are having sex. Supposedly even when I'm not around. But as I walk the Commonwealth, I don't see any women pregnant, even though there were plenty of messages saying so. Now I know there's a mod out there that adds pregnant women to settlements & even Raiders, but that's not the same thing. I'd like to see organic pregnant women showing up when I get the message, or run into a pregnant Raider every now & then? It would help with immersion.

 

:thumbsup:

Link to comment
40 minutes ago, VonHelton said:

I have Autonomy installed, so NPC's are having sex. Supposedly even when I'm not around. But as I walk the Commonwealth, I don't see any women pregnant, even though there were plenty of messages saying so. Now I know there's a mod out there that adds pregnant women to settlements & even Raiders, but that's not the same thing. I'd like to see organic pregnant women showing up when I get the message, or run into a pregnant Raider every now & then? It would help with immersion.

 

:thumbsup:

about the fake pregnancies, originally I was trying to make a script's that rewinds, pauses and fast forwards a FPE Pregnancy. but I couldn't so I decided to go with a Boston breeders style of pregnancy. Fake armor based and then I added features and options to get the current mod.

 

I designed them to be part of a lived in world so instead of everything starting at the time of you getting out of the vault.

 

I have been thinking of adding an impregnation injector(for FPE pregnancies) to Arriving Settlers so their backstory is that they were just raped by someone (or something) shortly before arriving at your settlement.

Let me know if anyone wants this?

Link to comment
4 hours ago, VonHelton said:

I have Autonomy installed, so NPC's are having sex. Supposedly even when I'm not around. But as I walk the Commonwealth, I don't see any women pregnant, even though there were plenty of messages saying so. Now I know there's a mod out there that adds pregnant women to settlements & even Raiders, but that's not the same thing. I'd like to see organic pregnant women showing up when I get the message, or run into a pregnant Raider every now & then? It would help with immersion.

 

:thumbsup:

Idk why you havent run into them but i have atleast one pregnant raider/gunner per 4 or 5 encountered. They have the big bellies plus a baby in their inventory. You can see it without killing them if you have something like AAF violate and you rob them. I think it's an option in the mcm for wasteland dairy. Only sucks coz i shoot first ask questions later then i end up with like 5 bloody babies in my inventory (that i adopt) when i loot their bodies. Just wish you can pick up normal babies from them but then again getting shot with explosive minigun to the stomach will make that very unlikely lol i do have random shenanigans however instead of autonomy. And when the animation it triggers ends FPE lets me know whether or not someone got pregnant from it or just the chance or pregnancy.

Link to comment
2 hours ago, Merlin Wizzard said:

I gave that a try and the baby just falls to the floor. Tried to place another crib and tried to approach it from the foot length wise, and same thing. Using the cribs from the vanilla menus.

Sorry - this works for cribs that are in settlements, and player homes that are set up to act like settlements.  It won't work at Home Plate or similar player homes unless you are using a mod that makes it a settlement.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use