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!
Inventor
Original Poster
#1 Old 5th Jul 2022 at 10:47 PM
Default Update to CCLoader?
I'm finishing up my harvestable wheat project, and I wanted to replace some of the EA recipes to include the new ingredient. You can't do this with CCLoader because the game XML loading methods won't load a recipe that is already loaded.

I wrote a custom loader for my mod, but it would be pretty easy for me to add a flag to tell CCLoader to replace a recipe. I'm pretty sure DouglasVeiga's long gone though. His posted policy on his profile here is that he wants to be asked if someone wants to modify and rerelease his stuff. I'm happy do that, but I don't know what chance there is of getting a reply.

What's the MTS policy on departed to creators?

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
Advertisement
Virtual gardener
staff: administrator
#2 Old 6th Jul 2022 at 9:32 AM
Hey @echoweaver !

I moved the thread to site questions since I felt it was a bit more site-question-y related and it gives a bit more visibility for other staff to answer it thoroughly if necessary

So, regarding the CCLoader you made, in this case, did you edit the program itself? Or did you simply make a mod that hooks in/overrides whatever function CCLoader uses to read/load in the ingredients. (In other words, what aspects are you editing here? As CCLoader comes with both a package that loads in the CC and a program that generates a DLL file and makes it "load ready")

Because if it's a C# Script that simply hooks in, or overrides said function with yours, I wouldn't really worry about it as it's in that case more of a "plugin"; the user can simply delete your package it and it still would be in its original state.

However, say you edited the program/package itself with, say, DnSpy, then the following guidelines would apply:

Quote:
(Source: https://modthesims.info/rubrics/4045/)

Certain rules and conditions you need to read before uploading someone else's mod (ALL of these must be true)
  • The original creator must have been inactive for a period of at least 1 month, and has not stated when they will be returning (for vacation or personal reasons, etc.) This period of 1 month is counted from the last date the original creator has actively posted on MTS or their last blog post on third party sites.
  • The original creator cannot have posted policies specifically forbidding updating or editing their mods. If they have no stated policy regarding updating, or if their site or policy is permanently offline, it's okay.
  • Updates to items can be simple bugfixes or updates to work with the new patch(es)/expansion(s), or they can also include new features.
  • The original creator needs to be credited (see below)


Now, the last time Douglas was online, was in April of this year, so it may be good to PM them anyways It may well just be that it's going to take a long time for them to reply back, but at least you may get the permission necessary (IF it's necessary)
Inventor
Original Poster
#3 Old 6th Jul 2022 at 11:33 AM
Wow. I didn't realize Douglas had been on that recently. I'd much rather have his permission than not. Great to know he's still around!

I don't think that I could easily hook into his mod to add the bit of functionality because it would need to be inserted into the middle of his loading method. However, the more I think about it, the more I think it's important that my mod use CCLoader. It guarantees that custom ingredients and recipes are loaded together in proper order such that someone else can write CCLoader content using my custom ingredient. My custom-loaded ingredients are not guaranteed to be available when someone else's recipe loads.

I'll drop him a PM and see if he's around to chat about it.

From a technical perspective, what I'm doing is just checking to see if there is already a recipe loaded with the same key as a recipe I'm loading, and if so I delete it so the new one can replace it. CCLoader triggers on WorldLoadStarted. One workaround would be to delete the vanilla recipes before CCLoader runs, but I'm not sure what event that would be. Does LoadSaveManager.ObjectGroupsPreLoad run before or after WorldLoadStarted? Argh.

I'll see if he responds and, if so, what he thinks.

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
#4 Old 6th Jul 2022 at 2:22 PM
Quote:
but I'm not sure what event that would be. Does LoadSaveManager.ObjectGroupsPreLoad run before or after WorldLoadStarted? Argh.


I should probably add this to the Code snippets thread, but gamefreak said this on the discord ages ago:

Quote:
OnStartupApp -> First loading screen -> Main Menu -> Second loading screen -> PreLoad -> Load world file (including loading & setting persistable script values) -> PostLoad -> InWorldState/OnWorldLoadFinished


Regarding the permission thing, hopefully, he'll be around to answer your question!
Inventor
Original Poster
#5 Old 7th Jul 2022 at 1:36 PM
Quote: Originally posted by Lyralei
I should probably add this to the Code snippets thread, but gamefreak said this on the discord ages ago:


Oh, wow, that is HUGELY helpful. Thanks!

In that case, if I don't hear from Douglas, I'll try removing the offending recipes on PreLoad and see if that works.

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
Field Researcher
#6 Old 7th Jul 2022 at 7:36 PM
Why do you want to remove them? Why not override them?
Inventor
Original Poster
#7 Old 9th Jul 2022 at 5:12 AM
Quote: Originally posted by KittyTheSnowcat
Why do you want to remove them? Why not override them?


I'm not sure I understand.

I might not have a full picture of how this works, but I know two ways to load recipes:

1. Replace the entire MasterRecipeList resource. This is what Cooking and Ingredients Overhaul does.

2. Load individual recipes using the games XML loading methods. This is what CCLoader does.

I don't want to do #1 because that makes my mod incompatible with any mod that does this.

I tried #2 a couple of different ways, but the game's method to load recipe XML won't load a recipe if it already exists in the game recipe dictionary.

I can delete EA's recipe and then load a new one, and that's what I'm doing now with a custom loader. However, one of the most important things CCLoader does is that it loads ALL ingredients and recipes that use it so that use each other's custom ingredients in your own recipes. I don't want to use a custom loader because then I won't be able to guarantee that my ingredients load before someone else's custom recipe that uses them.

Does this make sense, or am I missing something important?

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
Field Researcher
#8 Old 9th Jul 2022 at 5:06 PM Last edited by KittyTheSnowcat : 9th Jul 2022 at 5:21 PM.
You showed me that code in the chat. I checks if the key already exists and if not it adds it. You can just tell it if it already exists replace it. its dictionary[key]= new data


So I would go with number two, but with your own script so it replaces the recipe.

Recipe recipe = new Recipe (row);
if (!NameToRecipeHash.ContainsKey (recipe.Key)) {
Recipes.Add (recipe);
if (recipe.IsSnack) {
Snacks.Add (recipe);
} else if (recipe.CookingSkillLevelRequired == 0 && recipe.Learnable) {
IntroRecipes.Add (recipe);
}
if (recipe.GetDessertType () != 0 && recipe.Key != "Wedding Cake") {
BakeSaleRecipes.Add (recipe);
}
NameToRecipeHash.Add (recipe.Key, recipe);
}


You sent me this in the chat a while ago. All you would have to do is add a:
if (NameToRecipeHash.ContainsKey (recipe.Key)) {
Recipes[ recipe.Key] = recipe;
}
And all the other stuff to if you want to add it to snack etc..
But that is all you have to do to override it. If it already exists -> replace you need that check because if you call that code on a key that does not exist you will crash the game.
Inventor
Original Poster
#9 Old 9th Jul 2022 at 11:55 PM
Quote: Originally posted by KittyTheSnowcat
And all the other stuff to if you want to add it to snack etc..
But that is all you have to do to override it. If it already exists -> replace you need that check because if you call that code on a key that does not exist you will crash the game.


OK, right. My current custom loader is basically do this. It's just that this requires a custom loader, which disconnects my mod from CCLoader, which assures that custom ingredients are loaded before custom recipes.

I figure I could either delete the offending recipes on an earlier event than where CCLoader runs, or I could do the replacement you're talking about on an event after CCLoader runs.

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
Inventor
#10 Old 10th Jul 2022 at 5:33 PM
Quote:
His posted policy on his profile here is that he wants to be asked if someone wants to modify and rerelease his stuff.


Nowadays, i'm not playing or modding The Sims anymore, so feel free to modify and re-release CCLoader as you wish.
*I just updated my Creator Policies to reflect this change.
Back to top