- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Menstrual Cycle Initialization
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Menstrual Cycle Initialization
Replies: 4 (Who?), Viewed: 999 times.
#1
5th Dec 2021 at 1:48 PM
Last edited by mingos : 5th Dec 2021 at 9:07 PM.
Posts: 32
Thanks: 130 in 1 Posts
Menstrual Cycle Initialization
I'm currently writing a mod based off of KW's reproductive cycle system. I started first with menstrual cycle but I have been having trouble initializing the mod within the game. In fact, the loading screen hangs when I uncomment out the new class initialization. I've tried writing it with alarms, and now went back to way KW does with set hourlys for each phase. At this point, I'm not sure what else to do.
My Questions:
What else could I be doing to make the mod work?
Is there something that I'm missing about class initialization in C# and in mods?
Also, it's currently being written as a script mod.
Advertisement
#2
5th Dec 2021 at 4:15 PM
Posts: 3,860
Thanks: 8567 in 67 Posts
Heya Mingos!
For all questions it would be nice to have the source code in some way (a package file or a dll file would be enough ) as i'm not too sure how much you've changed from when we discussed the mod on discord
For all questions it would be nice to have the source code in some way (a package file or a dll file would be enough ) as i'm not too sure how much you've changed from when we discussed the mod on discord
#3
5th Dec 2021 at 9:09 PM
Posts: 32
Thanks: 130 in 1 Posts
Package in question.
Attached files:
mod_men.zip (6.3 KB, 31 downloads) |
#4
10th Dec 2021 at 10:14 AM
Posts: 1,500
Thanks: 4287 in 41 Posts
@mingos Hmm what happens if instead of On World Load you placed this code in an interaction?
I am wondering if maybe too much is going on during load time and that's why there's a crash. BTW which loading screen causes this crash/hang? The initial one or the second one when you load new game or save game?
Code:
try { Sim[] objects = Sims3.Gameplay.Queries.GetObjects<Sim>(); for (int i = 0; i < objects.Length; i = checked(i + 1)) { if (!simsWithGenderManager.ContainsKey(objects[i].SimDescription.SimDescriptionId)) { if (objects[i].IsFemale && objects[i].IsHuman) { simsWithGenderManager.Add(objects[i].SimDescription.SimDescriptionId, new GenderFemale(objects[i].SimDescription.SimDescriptionId, objects[i].SimDescription.TeenOrAbove)); } if (objects[i].IsMale && objects[i].IsHuman) { simsWithGenderManager.Add(objects[i].SimDescription.SimDescriptionId, new GenderMale(objects[i].SimDescription.SimDescriptionId, objects[i].SimDescription.TeenOrAbove)); } } } } catch (Exception exception) { Debug.ShowException(exception); Debug.WriteLog(exception); }
I am wondering if maybe too much is going on during load time and that's why there's a crash. BTW which loading screen causes this crash/hang? The initial one or the second one when you load new game or save game?
#5
13th Apr 2022 at 11:11 PM
Posts: 32
Thanks: 130 in 1 Posts
Quote: Originally posted by PuddingFace
@mingos Hmm what happens if instead of On World Load you placed this code in an interaction?
Code:
try { Sim[] objects = Sims3.Gameplay.Queries.GetObjects<Sim>(); for (int i = 0; i < objects.Length; i = checked(i + 1)) { if (!simsWithGenderManager.ContainsKey(objects[i].SimDescription.SimDescriptionId)) { if (objects[i].IsFemale && objects[i].IsHuman) { simsWithGenderManager.Add(objects[i].SimDescription.SimDescriptionId, new GenderFemale(objects[i].SimDescription.SimDescriptionId, objects[i].SimDescription.TeenOrAbove)); } if (objects[i].IsMale && objects[i].IsHuman) { simsWithGenderManager.Add(objects[i].SimDescription.SimDescriptionId, new GenderMale(objects[i].SimDescription.SimDescriptionId, objects[i].SimDescription.TeenOrAbove)); } } } } catch (Exception exception) { Debug.ShowException(exception); Debug.WriteLog(exception); } I am wondering if maybe too much is going on during load time and that's why there's a crash. BTW which loading screen causes this crash/hang? The initial one or the second one when you load new game or save game? |
Sorry for the delayed reply; I took your comment and thought more about the architecture of the mod.
Right now, I have it as onlt I can add new uterus classes to the sims via a debug interaction. With the help of alarm handlers and the SimClock, each new uterus class can keep track of it's own time and change the class state when it hits a certain sim hour.
However, right now the issue I'm facing is that the alarm handlers are going faster than the SimClock, missing the times to change over to remove the previous alarms, and failing to change each instance's state.
What I was thinking was implementing a global alarm handler to be the clock for all instances of the uterus class. However, I'm curious on what other modders have done in the past.
Thoughts?
Who Posted
|