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!
Lab Assistant
Original Poster
#1 Old 3rd Oct 2021 at 12:38 PM
Default Create PlantSim In CAS, a problems.
Hello everyone, I ran into a problem when creating a mod, this is that the hair, the beards and eyebrows does not change its color, to the one that which PlantSim should have. here is a piece of code i changed.
Screenshots
Advertisement
Forum Resident
#2 Old 4th Oct 2021 at 9:48 PM
I don't have anything useful to add on the modding side of things, but I'm curious. How on earth did you get PlantSims to show up in CAS in the first place, as a chooseable lifestate and everything?

I would've thought something like that would've been hard-coded or at the very least very difficult to implement.

You have been chosen. They will come soon.
Inventor
#3 Old 5th Oct 2021 at 1:55 PM
I'm pretty excited to see a mod released that would let me create PlantSims in CAS. Is that what you're doing there? I also don't know what could be causing the recolor problems. When you edit a PlantSim in CAS using MasterController, those bits recolor just fine.

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
Lab Assistant
Original Poster
#4 Old 6th Oct 2021 at 12:06 PM
Quote: Originally posted by Jathom95
I don't have anything useful to add on the modding side of things, but I'm curious. How on earth did you get PlantSims to show up in CAS in the first place, as a chooseable lifestate and everything?

I would've thought something like that would've been hard-coded or at the very least very difficult to implement.
.
Sorry, but I'm too lazy to search for this now, you can search it in my posts because I have already provided the code here.
Quote: Originally posted by echoweaver
I'm pretty excited to see a mod released that would let me create PlantSims in CAS. Is that what you're doing there? I also don't know what could be causing the recolor problems. When you edit a PlantSim in CAS using MasterController, those bits recolor just fine.

The problem is that when you select PlantSim in CAS, the color of hair, eyebrows and beard remains what it was, and not green or blue or whatever, there is not this filter in the life mode, only the color of the eyes changes to yellow.
Forum Resident
#5 Old 6th Oct 2021 at 5:02 PM
Quote: Originally posted by whiteman-Dara
.
Sorry, but I'm too lazy to search for this now, you can search it in my posts because I have already provided the code here.

Erm... this was the first I've heard of anyone doing something like this. I'm not a modder so I was curious how it was possible. I thought lifestates weren't possible to add to the game. I didn't even realize anything prior had been posted about it.

You have been chosen. They will come soon.
Scholar
#6 Old 7th Oct 2021 at 4:07 AM
Something in the Plant Sim code. The beard should become green right? And you should have the plant sim hair style. No other occult style changes hair style or color. Werewolves do get body hair though. That could help. I think checking the plant sim code for hair and Werewolf code for body hair is the way to go.

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
Lab Assistant
Original Poster
#7 Old 7th Oct 2021 at 7:15 AM
Quote: Originally posted by PuddingFace
Something in the Plant Sim code. The beard should become green right? And you should have the plant sim hair style. No other occult style changes hair style or color. Werewolves do get body hair though. That could help. I think checking the plant sim code for hair and Werewolf code for body hair is the way to go.

Hi, PuddingFace. Not green, but the color of the hair plantSim, no, but mummies and symbots cannot be created in CAS because of the skin tone, and their hairstyle intersects with the scalp. It won't help with the werewolf body hair, the body hair is applied because of the occultwerewolf class and the color is really applied random.
Virtual gardener
staff: administrator
#8 Old 11th Oct 2021 at 2:12 PM Last edited by Lyralei : 12th Oct 2021 at 10:45 AM. Reason: accidentally wrote "new new"...
Quote: Originally posted by whiteman-Dara
Hi, PuddingFace. Not green, but the color of the hair plantSim, no, but mummies and symbots cannot be created in CAS because of the skin tone, and their hairstyle intersects with the scalp. It won't help with the werewolf body hair, the body hair is applied because of the occultwerewolf class and the color is really applied random.


You can actually change this, even in CAS

You can really use CASlogic's approach for at least the beard by doing:

Code:
Color[] plantsimHairColors =  new Color[4] {
         new Color(0, RandomUtil.GetInt(80, 200), 0),
         new Color(0, RandomUtil.GetInt(80, 200), 0),
         new Color(0, RandomUtil.GetInt(80, 200), 0),
         new Color(0, RandomUtil.GetInt(80, 200), 0),
};
base.AddStep(new SetAllHairColorStep(BodyTypes.Hair, plantsimHairColors, true , plantsimHairColors[2], true, true));


If you're curious how other CAS changes are made in real time, then the 'RandomizeSimoperation may be helpful, of course, this snippet won't work for in-game (So outside of CAS). For that, I'd check OccultPlantSim.OnAddition

Regarding hiding the scalp and such, that's actually not difficult at all, since SimOutfit includes the ENTIRE sim, including the scalp and eyeballs:

Code:
CASLogic singleton = GetSingleton();
SimBuilder mBuilder = singleton.mBuilder;

// Getting our CASpart outfit string for the Frankenstein sim...
string mSimoutfitName = "";

	string text = "e";
	string text2 = "bodyFrankenSim";
	string text3 = RandomUtil.GetInt(1, 3).ToString();
	string text4 = "LTR"; // This will generate a clean simbot. otherwise do: string.Empty for a dirty one or make it empty anyways if it doesn't work.
	if (singleton.Gender == CASAgeGenderFlags.Male)
	{
		mSimoutfitName  = text + "m" + text2 + "Male" + text4 + text3;
	}
	mSimoutfitName = text + "f" + text2 + "Female" + text4 + text3;

string instanceName = "OccultManager.CreateOutfit_" + mSimoutfitName + "Instance";
ResourceKey key = ResourceKey.CreateOutfitKeyFromProductVersion(mSimoutfitName, ProductVersion.EP2);

SimOutfit simOutfit = new SimOutfit(key);
	if (simOutfit.IsValid)
	{
		mBuilder.UseCompression = true;
		mBuilder.Age = singleton.Age;
                
                // This is what makes the sim's skin invisible/transparent.
                mBuilder.SkinTone = new ResourceKey((ulong)CASSkinTones.NoSkinTone, 55867754u, 0u);
                mBuilder.SkinToneIndex = 0f;

		OutfitUtils.SetAutomaticModifiers(mBuilder);
		OutfitUtils.SetOutfit(mBuilder, simOutfit, null);
		ResourceKey key2 = mBuilder.CacheOutfit(instanceName);
		SimOutfit mFrankensteinOutfit = new SimOutfit(key2);
	}
OutfitUtils.SetOutfit(mBuilder, mFrankensteinOutfit, singleton.mCurrentSimData);
singleton.ExecuteSetOutfit(mFrankensteinOutfit);
singleton.UpdateCurrentSim(false);


And voila! you got yourself a simbot in CAS So it's not impossible, it'\s just not easy to find the right piece of code for it if you're new to CAS excecutions and CASparts really.
Lab Assistant
Original Poster
#9 Old 11th Oct 2021 at 2:49 PM Last edited by whiteman-Dara : 12th Oct 2021 at 9:54 AM.
Quote: Originally posted by Lyralei
You can actually change this, even in CAS

You can really use CASlogic's approach for at least the beard by doing:

Code:
Color[] plantsimHairColors =  new Color[4] {
         new new Color(0, RandomUtil.GetInt(80, 200), 0),
         new new Color(0, RandomUtil.GetInt(80, 200), 0),
         new new Color(0, RandomUtil.GetInt(80, 200), 0),
         new new Color(0, RandomUtil.GetInt(80, 200), 0),
};
base.AddStep(new SetAllHairColorStep(BodyTypes.Hair, plantsimHairColors, true , plantsimHairColors[2], true, true));


If you're curious how other CAS changes are made in real time, then the 'RandomizeSimoperation may be helpful, of course, this snippet won't work for in-game (So outside of CAS). For that, I'd check OccultPlantSim.OnAddition

Regarding hiding the scalp and such, that's actually not difficult at all, since SimOutfit includes the ENTIRE sim, including the scalp and eyeballs:

Code:
CASLogic singleton = GetSingleton();
SimBuilder mBuilder = singleton.mBuilder;

// Getting our CASpart outfit string for the Frankenstein sim...
string mSimoutfitName = "";

	string text = "e";
	string text2 = "bodyFrankenSim";
	string text3 = RandomUtil.GetInt(1, 3).ToString();
	string text4 = "LTR"; // This will generate a clean simbot. otherwise do: string.Empty for a dirty one or make it empty anyways if it doesn't work.
	if (singleton.Gender == CASAgeGenderFlags.Male)
	{
		mSimoutfitName  = text + "m" + text2 + "Male" + text4 + text3;
	}
	mSimoutfitName = text + "f" + text2 + "Female" + text4 + text3;

string instanceName = "OccultManager.CreateOutfit_" + mSimoutfitName + "Instance";
ResourceKey key = ResourceKey.CreateOutfitKeyFromProductVersion(mSimoutfitName, ProductVersion.EP2);

SimOutfit simOutfit = new SimOutfit(key);
	if (simOutfit.IsValid)
	{
		mBuilder.UseCompression = true;
		mBuilder.Age = singleton.Age;
                
                // This is what makes the sim's skin invisible/transparent.
                mBuilder.SkinTone = new ResourceKey((ulong)CASSkinTones.NoSkinTone, 55867754u, 0u);
                mBuilder.SkinToneIndex = 0f;

		OutfitUtils.SetAutomaticModifiers(mBuilder);
		OutfitUtils.SetOutfit(mBuilder, simOutfit, null);
		ResourceKey key2 = mBuilder.CacheOutfit(instanceName);
		SimOutfit mFrankensteinOutfit = new SimOutfit(key2);
	}
OutfitUtils.SetOutfit(mBuilder, mFrankensteinOutfit, singleton.mCurrentSimData);
singleton.ExecuteSetOutfit(mFrankensteinOutfit);
singleton.UpdateCurrentSim(false);


And voila! you got yourself a simbot in CAS So it's not impossible, it'\s just not easy to find the right piece of code for it if you're new to CAS excecutions and CASparts really.

Thank you, this was an example, I was not going to create skinless in CAS, I have a question when change gender or age in CAS will skin invisible remain? Or as a Simbot when age up?
As for PlantSim, I will rewrite the code and Write this you how everything works
Lab Assistant
Original Poster
#10 Old 12th Oct 2021 at 10:06 AM
Upset , in fact, in the simo files, each plantSimoutfit has its own hair color for every gender or age, and there are about 30 of them, and it's not a fact that a random hair color will suit a random plantSimoutfit.
Virtual gardener
staff: administrator
#11 Old 12th Oct 2021 at 10:41 AM
Quote: Originally posted by whiteman-Dara
Thank you, this was an example, I was not going to create skinless in CAS, I have a question when change gender or age in CAS will skin invisible remain? Or as a Simbot when age up?


I'm guessing that it will turn pitch black if you were to do that currently, as CAS doesn't have anything (yet) to check "hey this sim is a SimBot!" and just gets some random clothing/hair etc. It's the same problem that triggers the grim reaper to turning into a human when you age him up

Now what you may be able to do (and they do this for fairies and CAS-compatible occults) to just check what their occult is when you age them up IN Cas, or when entering cas.

All the operations that you see in CAS logic are, what I'd consider 'event listeners but cooler'. With that I mean, they always get 'triggered' if you add the step in your code and voila, it's doing stuff for you!

Anyways! Sorry for the rambling! I think really your own concern might be once the simbot ages into an elder in CAS, but even for that they have an 'operation' you could expand on and add the Simbot code for (Or better yet, I'd just make the snippet I shared into it's own function and then all you do is just call that function when you detect the sim is a SIMbot and aged up )
Inventor
#12 Old 26th Oct 2021 at 2:15 PM
I only know outfits at a very high level, but after the game has chosen the Plantsim outfit, isn't it possible to retrieve the hair color from it and apply that to the sim in CAS?

Honestly, I think it's a win even if the hair color doesn't change. I change a PlantSim's clothes almost immediately, and I think a lot of players do also. Leaving the hair color for the user to customize in CAS doesn't make the mod unusable.

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
Virtual gardener
staff: administrator
#13 Old 26th Oct 2021 at 9:18 PM
Quote: Originally posted by whiteman-Dara
Upset , in fact, in the simo files, each plantSimoutfit has its own hair color for every gender or age, and there are about 30 of them, and it's not a fact that a random hair color will suit a random plantSimoutfit.


Oh I totally missed this!

Well just because the SIMO tells it that it needs to be red or green or some other colour, doesn't mean that programmatically we can't change it In fact, that's exactly what EA does :p

However, I'd seriously suggest checking out the Sims3.Gameplay.ActorSystems.OccultPlantSim and then the OnAddition() function. I know it's in-game but the same code can be used (see my Simbot example for you) to apply the right clothing data to plantsims and how EA initially 'chose' a random Uniform/SIMO key
Lab Assistant
Original Poster
#14 Old 28th Oct 2021 at 5:20 PM Last edited by whiteman-Dara : 6th Nov 2021 at 2:06 AM.
Quote: Originally posted by echoweaver
I only know outfits at a very high level, but after the game has chosen the Plantsim outfit, isn't it possible to retrieve the hair color from it and apply that to the sim in CAS?

Honestly, I think it's a win even if the hair color doesn't change. I change a PlantSim's clothes almost immediately, and I think a lot of players do also. Leaving the hair color for the user to customize in CAS doesn't make the mod unusable.


it was a testing mod, I tested Plantsim in CAS, when the time comes I will release a mod that is cooler, related to CAS.
Inventor
#15 Old 5th Nov 2021 at 2:31 PM
Quote: Originally posted by whiteman-Dara
it was a testing mod, I tested Plantsim in CAS, as the time comes I will release a mod that is cooler, related to CAS.


Oh, haha. I'd be delighted if you released just this.

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
Lab Assistant
Original Poster
#16 Old 14th Nov 2021 at 9:44 AM
Quote: Originally posted by Lyralei
I'm guessing that it will turn pitch black if you were to do that currently, as CAS doesn't have anything (yet) to check "hey this sim is a SimBot!" and just gets some random clothing/hair etc. It's the same problem that triggers the grim reaper to turning into a human when you age him up

Now what you may be able to do (and they do this for fairies and CAS-compatible occults) to just check what their occult is when you age them up IN Cas, or when entering cas.

All the operations that you see in CAS logic are, what I'd consider 'event listeners but cooler'. With that I mean, they always get 'triggered' if you add the step in your code and voila, it's doing stuff for you!

Anyways! Sorry for the rambling! I think really your own concern might be once the simbot ages into an elder in CAS, but even for that they have an 'operation' you could expand on and add the Simbot code for (Or better yet, I'd just make the snippet I shared into it's own function and then all you do is just call that function when you detect the sim is a SIMbot and aged up )

But what about plumbots, they remain with invisible scalp when changing gender.
Virtual gardener
staff: administrator
#17 Old 14th Nov 2021 at 3:52 PM
Quote: Originally posted by whiteman-Dara
But what about plumbots, they remain with invisible scalp when changing gender.


Plumbots have their own CAS variation, therefore EA made it so that the engine doesn't automatically think that the scalp needs to be added (or the face even for that matter). In fact, it has way less categories and an entirely different sets of categories as well (so instead of hairs, eyebrows, makeup,etc, we can really only customize the arms, legs, etc)

So initially it's just a simplified CAS. You could probably make the simbot "clothing" plumbot compatible to have them show up though, so you don't have ot do any coding. it would mean that the game would think it's a plumbot though, but that's what nraas can change
Back to top