-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REQUEST] Pregnancy test time display changes #148
Comments
I can look into thing in more detail later, but for now you're pointing out two different systems. It is correct that the player uses script delta instead of world time in SBR to fix the time travel pregnancy issues - as the world time differs per planet, and the shipworld hijacks the time of the world it orbits around I think. Player pregnancies also support an initial delay. That's the side of the pregnancy logic that uses script delta and applies only to players. NPCs still use the old system, as NPCs are intended to only ever stay on a single world regardless, allowing time to tick based on universe time even if the player isn't present to load the chunks in. That's why the pregnancy test handles both systems. In |
I did notice NPCs utilized the world time, which makes sense as you can't update them all the time. However I missed the function name being slightly different for players abs chucked the wrong one. I'll look again and let you know if I find anything, save you some effort hopefully. |
I think I've maybe found it. I do have a mod called Frackin Universe installed at the same time, which may cause the day length to vary by planet (assuming that's not already a base game feature). This would explain why it's inconsistent in a consistent way, specific planets always putting out the same value. While it's inconsistent across different planets. The test calculates based on the length of the day of the world you're currently on here. Now as a role-player I love that it does that, however until I discovered this it was definitely very confusing. With that in mind, I understand this will turn into more of a request than a bug, however I thought of a few ways to account for it. In order of preference (even better if you can choose in the config file):
Let me know what you think, and if you want me to open a new request for this. |
Frackin' Universe has (for once) actually nothing to do with it. Variable day length per planet size is a vanilla feature. That's why I went and accounted for that in the text output for players - while the actual time of the pregnancy is calculated based on a fixed, averaged day length of 840 seconds, the time it tells you is translated into the current time of your planet/orbit. I'll think about the option to rephrase it to "planet days", the only problem I can think about is the limited amount options in determining what kinda world you're in. The player shipworld can be checked - space stations and other, temporary-ish space encounters however not to my knowledge. |
Describe the bug
The pregnancy test displays the incorrect due date. I began on my starting world to run some tests, and invited a friend to help get my character pregnant. Immediately after receiving the book, we used a test and it displayed 309 days until it was due. Now either the config file wasn't being read, which is highly unlikely, or the pregnancy test was incorrect. We traveled around a bit and discovered the due date varied by planet, going up or down based on where we went.
Being a programmer, I wanted to set the config values correctly, so I dived into the code myself, and discovered the pregnancy code was calculated based on script delta times. This means that travel shouldn't affect it unlike the old code which ran on world time. Suspecting the issue wasn't the pregnancy itself, but the pregnancy test item itself, I dug into the code for pregnancy and the pregnancy test again.
I quickly re-confirmed that the pregnancy code works off script delta time, and the pregnancy test utilizes world time, causing the results to not match. Checking the rest of the code, I found that the code can likely be fixed by removing line 90 from the pregnancy test code.
Log File
Since you asked: starbound.log
I didn't have debug level logging enabled, sorry.
Additional context
/scripts/plugins/pregnant/pregnant.lua line 102 decreases the birthWorldTime by the delta time each time its run, however /items/active/lox_pregnancytest/pregnancytest.lua line 90 adjusts the birthWorldTime by the current date on the world you're currently in, making the test results very misleading.
The text was updated successfully, but these errors were encountered: