ErinaSugino/Starbound-SBR-Mod

[BUG] Player Pregnancy Issues

Mixarar opened this issue · 25 comments

Describe the bug
Pregnancy only happens with NPCxNPC not PlayerxNPC.

Log File
starbound (3).log

Additional context
The thing seems to be working with NPCxNPC and creates the baby sucsefully, not NPCxPlayer however, doesn't matter if the player is imprеgnating or getting imprеgnаted.

I seem to run into a same sorta problem Mikorsa is having, and would like to help out narrowing down the error if it hasn't been identified.

From what i've changed from the sexbound.config file to enable more log options and on a fresh install, This seem to caught my eyes whenever a "Successful" impregnation is occurred, even if it being a NPCxNPC or NPCxPlayer for my experience.
notepad++_yz63hZSbws

Oh boi, that screams like trouble

It's definitely is screaming out trouble from the look of it, and i would be glad to helped out with the source of the pregnancy issue.

The current issue has already been fully identified - Starbound does not give us access to the Global Context Variable.
Best case scenario: I just have to read deeper into the topic of environment variables to find the right (and accessible) one.
Worst case scenario: I have to rework or even scrap the entire modularization of pregnancy types.

Ahh, then I will like to wish you and other contributors well, hoping of the best case scenario result, the idea of it alongside the reworked pregnancy system sparked my interest with the SBR mod overall. ^^

Uploaded new zip for Build 1 including the aforementioned changes. The mechanic can now be properly tested. If no other issues arise the issue is solved.

Hey, back again to test it out after a fresh install of the changed build in hope of it having no issue. However, it's seem to went in a same sorta dead end with the nil value being different than the previous.
notepad++_dgHJi9sqky

Not really sure on what Field it seem to finding nil when I was looking into my logs, but maybe one of the field might be incorrect?

*sigh*
Ok, here is another try. Tested it myself until I got a successful pregnancy.

Getting pregnant is working for me on another install of the fresh build, which worked well enough. Though another issue and two error logs seem to occur now during the pregnancy and finally the birthing part. Not really sure if there any work in progress stuff is needed for it, but seems important enough for me to point it out.

image_2023-09-25_204005838

The errors of these two specific lines have been fixed.

Hell, fixes after fixes it seem to get quite worse with a few outdated coding i assume? With that latest one seem to start causing NPCS to despawn and drop their loots, even when freshly spawned ones.
Plus, the error line seem to be too long for me to post a screenshot, and the most recent spawn i had done is the latest.

starbound.log

And with these constant errors after fixes, i don't know how much more error after this one get fixed .3.
Edit: The latest spawn i had mention has [00:53:19.635] and in line 756 in the logs.

That one has actually nothing to do with pregnancies and is from the new features of Build 2.
Fixed the syntax error.

I can also exactly explain to you what's going on: At some point I moved code from one place to another. Which means variable references change. But since Lua is crap and I only work with Notepad++, I don't have refactoring mechanism available, and so it's quiet easy to miss a single reference somewhere that still points to the old structure. I also usually do only theory-coding - write the code as it should "theoretically work", then upload it for other's to find out if it actually does. That's why there may be a million lines that need fixing, and you can only find them one by one.

If theres more clean syntax errors in Build 2 though, I'll take a look over it myself until the game at least boots stably again.

Gotcha, so would i start up a new issue of the later errors and bugs regarding of the NPC and new features?

You can slap all the generic Syntax errors and stuff that obviously only broke now into the Discussions Thread

[23:16:32.870] [Error] SxB: Baby generation errored! Aborting further generation.
[23:16:32.870] [Error] Error: [string "/scripts/sexbound/plugins/pregnant/baby.lua"]:38: attempt to index a nil value (global 'actor')
[23:16:32.870] [Warn] [SxB | PREG] : Actor has not become pregnant due to no successful pregnancy generation

Hmmmmm, after restarting the game it fixed itself? huh thats weird.

Haven't looked into the source of NPC colors yet, but fixed the above in the new upload of Build 2.

Edit, colors might be fixed.

[21:58:58.672] [Info] [SxB | PREG] : Pregnancy roll : 0.09 <= 0.2664
[21:58:58.672] [Info] [SxB | PREG] : Pregnancy check for actor 2: Allow species true - Can Impregnate true - Can be impregnated true - Insertion true
[21:58:58.672] [Info] [SxB | PREG] : Actor will become pregnant: Yuly
[21:58:58.672] [Error] SxB: Baby generation errored! Aborting further generation.
[21:58:58.672] [Error] Error: [string "/scripts/sexbound/plugins/pregnant/baby.lua"]:38: attempt to index a nil value (global 'daddy')
[21:58:58.672] [Warn] [SxB | PREG] : Actor has not become pregnant due to no successful pregnancy generation

This happened on the outpost, NPCxNPC no player participating.

https://pastebin.com/0nKnKd63
Birthing pill doesn't work

New Upload

Birthing pill now for some reason doesn't stop prеgnаncy, it gives birth to the child but then prеgnаncу continues?
Also for some the prеgnаncy test gives out over 7000 days most of the time, even though in the config it is set to be around 12 days.
[22:48:38.562] [Info] [SxB | PREG] : {"birthWorldTime":7837.45,"birthTime":0.330292,"babies":[{"motherId":-65536,"motherType":"player","fatherSpecies":"glitch","generationFertility":1,"fatherUuid":"e4cb7513bcfac4cac9b107cfd3334fa5","birthSpecies":"protogen","fatherId":573,"birthGender":"female","npcType":"crewmembersexbound","motherName":"Valencia","motherSpecies":"dragon","fatherType":"npc","motherUuid":"d3a0b2d024ca16f0d7f2f12cdbb87499","fatherName":"Ironbolt","birthEntityGroup":"humanoid"}],"pregnancyType":"baby","birthOSTime":1.69795e+09,"dayCount":9,"fullBirthWorldTime":7837.45,"babyCount":1,"fullBirthOSTime":1697143718,"delay":99.2139}
and
Entity pregnancy data for #-65536: { [1] = { ["birthOSTime"] = 1697949855.207,["dayCount"] = 9,["pregnancyType"] = baby,["birthWorldTime"] = 7564.7783935666,["babies"] = { [1] = { ["birthEntityGroup"] = humanoid,["motherUuid"] = d3a0b2d024ca16f0d7f2f12cdbb87499,["generationFertility"] = 1.0,["fatherName"] = Ironbolt,["fatherType"] = npc,["fatherUuid"] = e4cb7513bcfac4cac9b107cfd3334fa5,["birthSpecies"] = protogen,["fatherId"] = 573,["motherName"] = Valencia,["fatherSpecies"] = glitch,["birthGender"] = female,["motherId"] = -65536,["npcType"] = crewmembersexbound,["motherSpecies"] = dragon,["motherType"] = player,} ,} ,["delay"] = -0.11946910619736,["babyCount"] = 1,["fullBirthOSTime"] = 1697143718,["fullBirthWorldTime"] = 7837.4450683594,["birthTime"] = 0.33029174804688,} ,}

Although this might be due to some other things, as I played around with configs, and some scripts so yeah. I'll test it on a clean starbound.

Did using the birthing pill in this instance actually spawn the NPC? Full log?

Also, do you mean the pregnancy test itself outputs 7000 days as radio message, or that the log says "birthWorldTime" = 7000+? The latter would be normal for player pregnancies, as that's seconds.

The radio message, also the prеgnancy doesn’t end for some reason, it’s not only the birth pill.
The NPC was spawned, everything goes as it should except the fact that it doesn’t end, and will loop indefinitely until you use abоrtion.

Again, I need the log.