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!
Quick Reply
Search this Thread
Space Pony
Original Poster
#1 Old 22nd May 2022 at 9:27 PM Last edited by Battery : 22nd May 2022 at 10:19 PM.
Default The public Core Mod Project
Hello everyone this thread is about the public core mod project.

As you might know you can only have one core mod per assembly and there a a few core mods out there tied to different creators. This thread is there to combine useful modifications and everyone can contribute.
There are a few basic rules though to keep the integrity of the mod intact:
1. Do not remove functionality from the game
2. Dont make functionality more restrictive than it is in the original assembly
3. when making a suggestion state the purpose of the modification its benefits and drawbacks
4. as soon as your suggestion is accepted you agree that you cant remove your contribution from the project unless there are technical issues with it (needs to be reviewed then)
5. your suggestion needs to be reviewed first

your suggestion will be implemented based on the agree / disagree ratio

Root version change:
Sims3.Gameplay.Actors.Sim ->Removed sorting of interactions

Benefits: Interaction Pie menu has reduced lag
Drawbacks: none ?
Attached files:
File Type: 7z  GameplaySystems_1.00_1.67.7z (5.61 MB, 53 downloads)
Advertisement
Senior Moderator
staff: senior moderator
#2 Old 22nd May 2022 at 9:42 PM Last edited by zoe22 : 23rd May 2022 at 11:28 AM.
Exciting!

Couple of things:
The code for checking if a sim can plant something:
Code:
public static bool PlantInteractionGardeningSkillTest(Sim sim, GameObject plantableObject, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
	PlantableComponent plantable = plantableObject.Plantable;
	if (plantable == null)
	{
		return false;
	}
	Skill element = sim.SkillManager.GetElement(SkillNames.Gardening);
	int plantSkillLevel = plantable.PlantDef.GetSkillRequirement();
	if (element == null && plantable.PlantDef.Rarity == PlantRarity.Common)
	{
		return true;
	}
	if (element == null || element.SkillLevel < plantSkillLevel)
	{
		greyedOutTooltipCallback = (() => LocalizeString("CannotPlantInsufficientGardeningSkill", sim, plantSkillLevel, plantableObject));
		return false;
	}
	return true;
}

The plantSkillLevel either returns the value set in the XML or will base it of the rarity.
The second part where it says if the skill element is null, it will block the sim from planting even if plantSkillLevel is 0. Which is unfortunate if you want a plant to be uncommon but plantable straight away.
Also, the first part I think would mean that if the plant is common, it will always be plantable straight away. Not sure if this is on purpose but it seems more sensible to have the SkillRequirement defined in the XML override the requirement based on the rarity. If it's left blank, the rarity is used then instead anyway.
Kinda a niche issue but hey :p
Here's my fix:


Benefits - plantable skill level works more logically + more control for plant/ingredient modders
Drawbacks: None?
Space Pony
Original Poster
#3 Old 22nd May 2022 at 9:44 PM
Suggestion:


Add a delegate handler to Sims3.Gameplay.Actors.Sim
public static AudioEventSimModifier AudioEventSimModifierSingleton;

change Sims3.Gameplay.Actors.Sim.AudioEventModifier
add
Code:
	if (AudioEventSimModifierSingleton != null)
	{
		AudioEventSimModifierSingleton(objectId, ref name, out age, out voicePitchModifier, out flags);
		return;
	}

as very first instruction to allow other modders to supply modify the voices of sims

Benefits:
1. Voices can be changed from other mods
2. No effect on otherwise unmodded games

Drawbacks:
1. minimaly increased memory usage (bytes)
2. minimally slower execution time (should not be noticable by mere humans)
Virtual gardener
staff: administrator
#4 Old 23rd May 2022 at 2:19 PM
@zoe22 Maybe I'm misunderstanding the code but I actually think that EA's check on the rarity is fine, aka, this part of the code:

Code:
	if (element == null && plantable.PlantDef.Rarity == PlantRarity.Common)
	{
		return true;
	}


The reason I think that is because, without it, sims can never learn how to garden by simply planting things themselves. (With that I mean, learning the skill without ever touching the gardening skill book.)

Quick In-game example: If we play a sim that has not discovered or done anything with the gardening skill, When clicking on a seed, you notice how the uncommon and rare seed your sim might have collected shows "skill level too low". But with common seeds we don't see it grayed out. In fact, sims can grow those seeds with no gardening knowledge. And given that SKills set on -1, CAN be null, that null check is also helpful.

So that's personally why I'd keep it. Unless I'm simply missing any other parts of the code I'll set my vote to disagree therefore, unless further discussion of course changes my mind :p
Virtual gardener
staff: administrator
#5 Old 23rd May 2022 at 2:43 PM
Suggestion:
Adding an interface for "Electronical Object" and "plumbing object" for easier selecting objects of that nature.

Sims3.Gameplay.Interfaces -> add a "Electronical Object" interface and a "plumbing Object" interface.
Sims3.Gameplay.Objects.* -> Add to whichever object it needs those interfaces to the derived list.

Benefits: We can now easily sort electrical/plumbing objects without many performance issues.
Drawbacks: None, in fact it should only help performance even more :p



Reasoning:
I'm currently working on a power outage and a water shutoff feature for the game, but I find myself having to jump through quite some loops and IMO, performance hampering ways, which is by getting all GameObjects (this includes Sims, so it's a good couple of thousand objects I'm looping over), then checking the namespace they're using. Of course, this means that it's not easy to also get particular objects that sadly don't belong in a particular namespace. Take the register for example, or stage lights.

And then you've got the issue where if we take the namespace: "Sims3.Gameplay.Objects.Appliances" it also comes with a ton of non-electrical objects like a Clothesline!

It just makes the filtering code a bit messy :p
Senior Moderator
staff: senior moderator
#6 Old 23rd May 2022 at 2:57 PM Last edited by zoe22 : 23rd May 2022 at 3:09 PM.
Quote: Originally posted by Lyralei
@zoe22 Maybe I'm misunderstanding the code but I actually think that EA's check on the rarity is fine, aka, this part of the code:

Code:
	if (element == null && plantable.PlantDef.Rarity == PlantRarity.Common)
	{
		return true;
	}


The reason I think that is because, without it, sims can never learn how to garden by simply planting things themselves. (With that I mean, learning the skill without ever touching the gardening skill book.)

Quick In-game example: If we play a sim that has not discovered or done anything with the gardening skill, When clicking on a seed, you notice how the uncommon and rare seed your sim might have collected shows "skill level too low". But with common seeds we don't see it grayed out. In fact, sims can grow those seeds with no gardening knowledge. And given that SKills set on -1, CAN be null, that null check is also helpful.

So that's personally why I'd keep it. Unless I'm simply missing any other parts of the code I'll set my vote to disagree therefore, unless further discussion of course changes my mind :p



@Lyralei I don't think I explained it very well - I made more sense on discord, I promise!
But it's actually a 2 part thing. The first (I think more important) is
Code:
if (element == null || element.SkillLevel < plantSkillLevel)
	{
		greyedOutTooltipCallback = (() => LocalizeString("CannotPlantInsufficientGardeningSkill", sim, plantSkillLevel, plantableObject));
		return false;
	}

It's an issue if you want a rarer plant (uncommon or more) to have a set skill level rather than the default for the rarity, and you want it to be when the sim hasn't learnt the skill.
Eg if you have a plantable that's uncommon and want sims to be able to plant it immediately ie level -1 and 0, it won't let you because element is null. So it will say "You need to be level 0 to plant this". If you set it to -1 it will say "you need to be level -1" which is ridiculous :p
So my solution checks if the sim hasn't learnt any skill and will consider that Skill Level 0.

As for the other part:
Code:
if (element == null && plantable.PlantDef.Rarity == PlantRarity.Common)
	{
		return true;
	}

If you wanted to have a common plantable, but you wanted to set a skill level like level 2, then I think this would stop it working, because it doesn't even check the plant's skill requirement.
However, my change doesn't actually stop you from being able to plant common plants immediately. Because if the skill requirement isn't set in the XML it will get the skill requirement from the rarity:
int plantSkillLevel = plantable.PlantDef.GetSkillRequirement();
Which if the Rarity is Common, then it will return 0 which I think is the case for EA common plantables.

So then with my change, even if the sim has not learnt any skill (ie it's null) their skill level will be considered 0 and they can plant all plants that should have a skill level 0 (common plants with no set skill requirement, and rarer plants that have the set requirement to be 0)

Hope this clears it up!
Virtual gardener
staff: administrator
#7 Old 25th May 2022 at 8:23 PM
@zoe22 Woops I thought I already replied!

Ahh wait I see what you mean now! I thought the if statement was the problem here rather than the display of the levels (which... you'd think EA had picked up on when developing this :p)

Changed from disagree to agree
Inventor
#8 Old 31st May 2022 at 5:58 PM
My biggest vote would be fixing the broken sim randomizing code that has led to all generated sims having face one (value 0 on all sliders). I have the code that does this on my currently-unusable computer. It's in Simler's core mod. If you're looking for the code itself, I can probably produce it in a few weeks (sob).

I don't think I need to produce a cost/benefit analysis for eliminating face one .

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Scholar
#9 Old 1st Jun 2022 at 12:15 PM
Are the movement speeds of different running styles core locked? I can't find where this value is stored.

If you like my mods. Consider supporting me on Patreon
Check out my website for updates on my mods and other work PuddingFace.wixsite.com
Check out my Youtube channel for tutorials(modding tutorials) and other content Youtube

Follow me on Twitter Instagram Pinterest Tumblr
Inventor
#10 Old 1st Jun 2022 at 2:36 PM
Quote: Originally posted by PuddingFace
Are the movement speeds of different running styles core locked? I can't find where this value is stored.


Oh, wow. I don't know what speeding up or slowing down walk styles would look like -- the animations are built assuming a specific speed. Is it possible to run an animation faster or slower? Otherwise, you'd end up with a sim sliding forward or shuffling their feet.

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Space Pony
Original Poster
#11 Old 1st Jun 2022 at 9:58 PM Last edited by Battery : 2nd Jun 2022 at 7:48 PM.
Quote: Originally posted by echoweaver
My biggest vote would be fixing the broken sim randomizing code that has led to all generated sims having face one (value 0 on all sliders). I have the code that does this on my currently-unusable computer. It's in Simler's core mod. If you're looking for the code itself, I can probably produce it in a few weeks (sob).

I don't think I need to produce a cost/benefit analysis for eliminating face one .


Thats sounds like a good idea, though my vote depends on if you got Simler's consent to use her/his code. If not i would only agree if you would not use that code but could provide your own code which is not based on someone elses work.
Inventor
#12 Old 2nd Jun 2022 at 3:47 AM
Quote: Originally posted by Battery
Thats sounds like a good idea, though my vote depends on if you got Simler's consent to use her/his code. If not i would only agree if you would not use that code but could provide your own code which is not basaed on someone elses work.


That's fair. I just can't provide anything right now, and I'm grumpy about it. A lot of Simler's bugfixes are pretty straightforward, but tons of work can be reflected in just a line or two of code. I'll submit my own fix for the bug (WHEN I CAN Grr), but they should be credited anyway. More than the exact code in the core mod, what Simler gave us was meticulous documentation of bugs in the source code so that they could be fixed by anyone. Several of those have been background annoyances for so long that it was a revelation you could fix them at all.

That said, they've made it clear that they have no interest in breaking anything out of the megamod. I don't think consent is required to fix a bug someone else found. Credit definitely, though.

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Scholar
#13 Old 2nd Jun 2022 at 9:22 AM
Quote: Originally posted by echoweaver
Oh, wow. I don't know what speeding up or slowing down walk styles would look like -- the animations are built assuming a specific speed. Is it possible to run an animation faster or slower? Otherwise, you'd end up with a sim sliding forward or shuffling their feet.


Oh I wasn't talking about the animation's speed just the movement speed.

If you like my mods. Consider supporting me on Patreon
Check out my website for updates on my mods and other work PuddingFace.wixsite.com
Check out my Youtube channel for tutorials(modding tutorials) and other content Youtube

Follow me on Twitter Instagram Pinterest Tumblr
Inventor
#14 Old 2nd Jun 2022 at 1:19 PM
Quote: Originally posted by PuddingFace
Oh I wasn't talking about the animation's speed just the movement speed.


I was just wondering if you could speed up the movement without the animations looking out-of-sync. With walking, I'm not sure you could, but as I think about running where both feet are sometimes off the ground anyway, maybe you could.

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Space Pony
Original Poster
#15 Old 2nd Jun 2022 at 7:07 PM
Release Candidate 1.01 of GameplaySystems (for patch level 1.67)

Changes:
Added: IElectronicalGridObject added to Sims3.Gameplay.Interfaces
Changed: The following classes now inherit from IElectronicalGridObject


Added: IPlumbingObject added to Sims3.Gameplay.Interfaces
Changed: The following classes now inherit from IElectronicalGridObject


changed: PlantInteractionGardeningSkillTest see code below


Added: public static AudioEventSimModifier AudioEventSimModifierSingleton; in Sims3.Gameplay.Actors.Sim

Changed: Added AudioEventSimModifierSingleton on top of AudioEventSimModifier

Changed:
Sims3.Gameplay.Interactions.InteractionInstance
Run->public
RunFromInventory->public

Sims3.Gameplay.Interactions.InteractionDefinition<TActor, TTarget, TInteraction>
GetInteractionName->public
PopulateSimPicker->public
CreateInstance->public
AddInteractions->public
Attached files:
File Type: 7z  GameplaySystems_1.01_1.67.7z (5.58 MB, 16 downloads)
Inventor
#16 Old 2nd Jun 2022 at 10:22 PM
I'm pretty sure the word we want is Electronic, not Electronical?

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Space Pony
#17 Old 2nd Jun 2022 at 11:16 PM
Quote: Originally posted by echoweaver
I'm pretty sure the word we want is Electronic, not Electronical?


If it were me, I'd prefer Electrical.

"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt

If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Inventor
#18 Old 3rd Jun 2022 at 1:17 AM
Quote: Originally posted by gamefreak130
If it were me, I'd prefer Electrical.


Come to think of it, you're right. These are things affected by a power outage, which is everything that takes electricity. Electronics are a subset of that.

(Word nerd, yes I am.)

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Back to top