- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Help regarding Adding Custom Recipe Books
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Help regarding Adding Custom Recipe Books
Posts: 1,408
Thanks: 110569 in 109 Posts
I have generated a new dll using BootStrap Creator by Twallan and exported into the package following theCustom Career Tutorial .
Then i have modified the XML according to this http://simswiki.info/wiki.php?title...tle_To_The_Game .
But in this bookfile tutorial by Twallan , it is mentioned that:
it is not possible to set the <skill> field to a custom skill name |
So I was wondering whether we can add custom recipe books( as custom skill books cannot be added)?
P.S.:I could not get my custom recipe books to show up
Posts: 997
Thanks: 22090 in 95 Posts
Let's suppose you did everything correctly and it's a xml problem. Here's an example
<!-- LEAVE THE FIRST ENTRY ALONE --> <BookRecipe> <Title>Title</Title> <Author></Author> <Recipe>None</Recipe> <Length>0</Length> <Value>0</Value> <PagesMinNorm>1</PagesMinNorm> <PagesMinBW>2</PagesMinBW> <NotInBookStore>False</NotInBookStore> <GeometryState>BookMediumThick</GeometryState> <MaterialState></MaterialState> <AllowedWorldTypes>Base,Downtown,University,Future</AllowedWorldTypes> <AllowedWorlds></AllowedWorlds> <CodeVersion>Basegame</CodeVersion> </BookRecipe> <!-- Only readable if Sim has cooking level >= recipe level and the recipe doesn't have auto_learn true --> <BookRecipe> <Title>ArsilWhiteRice</Title> <Recipe>ArsilWhiteRice</Recipe> <!-- this must be the string used in the Recipe_Key field --> <Length>30</Length> <Value>25</Value> <GeometryState>BookMediumThin</GeometryState> <MaterialState>BookRecipe1</MaterialState> </BookRecipe>
To set up the localized strings, set the keys in this way:
<!-- LOCALIZATION KEY: Gameplay/Excel/Books/<BookType>:<BookTitle|BookAuthor> Examples: Gameplay/Excel/Books/BookGeneral:Arsil_BookGeneral_Title Gameplay/Excel/Books/BookGeneral:Arsil_BookGeneral_Author Gameplay/Excel/Books/BookToddler:Arsil_BookToddler_Title Gameplay/Excel/Books/BookToddler:Arsil_BookToddler_Author Gameplay/Excel/Books/WrittenBookTitles:Arsil_WBT_Title1 -->
So, for a recipe book, you have to use as key:
Gameplay/Excel/Books/BookRecipe:<YourRecipeBookTitleOrAuthor>
As usual the suggestion of using unique strings/names applies, in order to reduce possible conflicts with other mods, present or future ^^
EDIT: well, let's complete the info:
Length should represent the number of pages of the book, hence the time it takes to read it.
Value is the price of the book
GeometryState is the shape of the book (as the name suggests it's actually a geostate of the book mesh)
You can choose between: BookLargeThick, BookLargeThin, BookMediumThick, BookMediumThin, BookSmallThin
MaterialState is the texture (to simplify the explanation, it's actually a material state, MTST, of the book)
used for the book (cover and what not), you can use that of whatever kind of book, not only the recipe ones or
limited to the genre (but for coherency maybe it's better to stick to those for recipes). There are a lot of options
here, let me see if a can list them...
- BookRecipe1
- BookRecipe2
- BookRecipe3
- too lazy to list the others, check Books _XML in GameplayData to see other examples
Posts: 1,408
Thanks: 110569 in 109 Posts
<Books> <BookRecipe> <Title>Title</Title> <Author></Author> <Recipe>None</Recipe> <Length>0</Length> <Value>0</Value> <PagesMinNorm>1</PagesMinNorm> <PagesMinBW>2</PagesMinBW> <NotInBookStore>False</NotInBookStore> <GeometryState>BookMediumThick</GeometryState> <MaterialState></MaterialState> <AllowedWorldTypes>Base,Downtown,University,Future</AllowedWorldTypes> <AllowedWorlds></AllowedWorlds> <CodeVersion>Basegame</CodeVersion> </BookRecipe> <BookRecipe> <Title>KiwiSummerSalad</Title> <Recipe>KiwiSummerSalad</Recipe> <Length>25</Length> <Value>20</Value> <GeometryState>BookMediumThin</GeometryState> <MaterialState>BookRecipe1</MaterialState> </BookRecipe> </Books>
My xml.I think I got my localization wrong.But I have Untranslated Key in game so it should show up without correct localization
I just saw that you have uploaded your Custom Book Loader (Earlier I had only seen the source code).I need a different script for different sets of recipes right( for ex: one for Green Vegetables,different one for Fruit Recipes etc)?
P.S.:I opened a thread for this so that other who maybe interested can see this too!
Posts: 997
Thanks: 22090 in 95 Posts
My Custom Book Loader is not flexible/versatile like the NRaas one or like douglasveiga's CCLoader, not sure how to explain
that, you can't "re-use it". My idea was to ask DV to integrate it with the CCLoader but then I found out that NRaas Careers
already does that and it seemed rude to me to make another (and yet integrating at least RecipeBooks to CCLoader doesn't
sound like a bad idea, so the same tool is able to handle all things related to recipes).
I've edited my previous post, check it again if you didn't already.
EDIT: oh, and to be safe, in the xml of course you also have to put the header and open/close the main tag, I took that for granted
<?xml version="1.0"?> <Books> ... </Books>
Posts: 1,408
Thanks: 110569 in 109 Posts
You should put all the books in the same xml, no need to create more than one (supposing they all belong to the same mod). |
I was talking about different mods because I have a huge no. of ingredients and recipes planned.Putting them all into one huge file seemed like a bad idea and cumbersome.So I am putting them into reasonably sized mods.
(and yet integrating at least RecipeBooks to CCLoader doesn't sound like a bad idea, so the same tool is able to handle all things related to recipes). |
Thats is an awesome idea and very practical too.
I've edited my previous post, check it again if you didn't already. |
Yes,I have seen the edited post.I was worried that maybe I had missed a step.There are no other additional steps to this right?
My end product has 4 entries:
1) The unique .dll XML with the following:
<CareerFiles> <BookFile> <Books></Books> </BookFile> <BookFile> <Books>mc_KiwiRecipeBooks</Books> </BookFile> </CareerFiles> |
2)Unique .dll S3SA
3)Custom Books XML
4)STBL
Am I missing something?Are the steps correct.
I am going to go and build it from scratch again.
Posts: 997
Thanks: 22090 in 95 Posts
used to generate its Instance ID (double click on it and then click on the FNV64 button
once you verify that the name is spelled correctly).
If it still doesn't work, upload it here.
Posts: 1,408
Thanks: 110569 in 109 Posts
Make sure mc_KiwiRecipeBooks is also the name of the xml (or course) and is the key used to generate its Instance ID (double click on it and then click on the FNV64 button once you verify that the name is spelled correctly). If it still doesn't work, upload it here. |
I have done that.Maybe something went wrong while building the file!I think I am going to rebuild the file and see.
I have attached all the kiwi files( fruit,recipe,recipe book)
Kiwi Recipe Books.rar (2.9 KB, 13 downloads) - View custom content | ||||||||||
Size Packed Ratio Date Time Attr CRC Meth Ver ------------------------------------------------------------------------------- Kiwi Recipe Books.package 4416 2845 64% 19-04-15 18:31 .....A. 94723B52 m3b 2.9 ------------------------------------------------------------------------------- 1 4416 2845 64% |
||||||||||
Kiwi Recipes.rar (49.5 KB, 14 downloads) - View custom content | ||||||||||
Size Packed Ratio Date Time Attr CRC Meth Ver ------------------------------------------------------------------------------- Kiwi Recipes.package 84711 50567 59% 19-04-15 18:33 .....A. 6228EF44 m3b 2.9 ------------------------------------------------------------------------------- 1 84711 50567 59% |
||||||||||
Kiwi.rar (271.7 KB, 15 downloads) - View custom content | ||||||||||
Size Packed Ratio Date Time Attr CRC Meth Ver ------------------------------------------------------------------------------- Kiwi.package 327760 278149 84% 10-04-15 23:52 .....A. 841378CC m3d 2.9 ------------------------------------------------------------------------------- 1 327760 278149 84% |
Posts: 997
Thanks: 22090 in 95 Posts
In kiwi.package there are no recipes defined and probably this occurrence of the resource
overrides the other one, so there's no recipe and the recipe book can't work (doesn't get initialized at all).
Let me do a quick test... just deleting the resource from kiwi.package should fix it... nope, still no book.
It works fine using my loader, I'm trying to understand why it doesn't work with NRaas Careers' one...
On another note, remember that you can also specify the author's name for the book, I didn't do that
in my example (I don't think it's mandatory).
Posts: 1,408
Thanks: 110569 in 109 Posts
There's the same xml resource for the recipe data in 2 packages. In kiwi.package there are no recipes defined and probably this occurrence of the resource overrides the other one, so there's no recipe and the recipe book can't work (doesn't get initialized at all). Let me do a quick test... just deleting the resource from kiwi.package should fix it... nope, still no book. It works fine using my loader, I'm trying to understand why it doesn't work with NRaas Careers' one... On another note, remember that you can also specify the author's name for the book, I didn't do that in my example (I don't think it's mandatory). |
Oops I forgot to delete the extra resource!
Thank you so much for looking taking the time to look into this :lovestruc
Posts: 997
Thanks: 22090 in 95 Posts
It's a problem related to the order or priority with which resources are parsed.
The game tries to parse your custom recipe book BEFORE your custom recipe has been parsed by CCLoader,
so when it tries to add a recipe book for a non existing recipe the process fails. It was a coincidence (so to speak)
that instead it worked using my mod, because for some reason my mod parsed your custom books AFTER
CCLoader had already parsed your custom recipes. It doesn't depend, like one may think, by the path+filename
of the packages or by the Instance ID of the resources, it depends on the order on which the event handlers are
called... but there's no need to be too technical, mostly because I don't fully understand it either ;P
Pretty sure I fucked up all verbs and consecutio temporum (sequence of tenses?) there, sorry!
I had my reserve for a form of gentlemen's agreement when I found out that NRaas Careers already allowed to add
custom books to the game, but now I think douglasveiga should really add also a custom book loader to his CCLoader,
because having one tool to handle all things related to recipes would be very handy and can guarantee that resources
are parsed in the correct order (as long as they belong to the same CCLoader "module").
Why?
CCLoader correctly parses things in this order:
- plants (they don't refer to anything else)
- ingredients (they MAY refer to plants previously defined)
- recipes (they MAY refer to ingredients previously defined)
Adding the parsing of books after the parsing of recipes will guarantee that the relative recipes were already been parsed
and added to the game. Of course, presuming that plants+ingredients+recipes+recipeBooks are all handled by the same
mod (i.e. the same module of CCLoader). I had already stated that but repetita iuvant. Wow, my Latin comes back at the
weirdest times.
@douglasveiga : sorry if I bother you (I don't like when I'm "mentioned"), but I think it's for a good reason.
I had already posted the sourcecode in the CCLoader thread - now sticky, in case you don't find it anymore :D
feel free to use and modify it. Of course it is up to you to decide to do it or not, but I think it will help a lot.
Posts: 1,408
Thanks: 110569 in 109 Posts
So I understand that to make it work in its current form I need to put my ingredients and recipes file in the override file and the custom books file in the main mods folder?
Parse order is chosen randomly?It really was subtle ! (I got a bit stuck at the latin though )
The best option really seems to be including in CCLoader!
Posts: 997
Thanks: 22090 in 95 Posts
The order is not random, otherwise it would change every time you run the game and I don't think
that's what happen. I'm not sure how the order is established (and it doesn't help that I'm super tired
and with an headache). My best guess involves a mix of:
- [EDIT] after all, maybe the path+filename of the package may play a role
- IID of the resources (or maybe the assembly name)
- the order with which event handlers (OnWorldLoadFinished and stuff like that) are added/called
The same thing that is happening to your custom books happened with my custom rabbit holes:
the careers xml (that, among their data, contain the reference to the rabbit hole enum used to
host the career) were parsed before the game "knew" about the custom rabbit holes.
I solved the problem (after cursing in ancient and forgotten languages) making sure that their
custom enum entries were added before the custom careers were parsed by using a "kind" of event
handler (PostInit) that - according to the GameFlow class constructor - is called before the "kind" of
event handler used by NRaas Careers to parse the xml resources with the career definitions/data
(OnAppStartUp if I recall it correctly).
[I'm not sure if I'm using the right terminology, my programming knowledge is outdated and rusty]
EDIT: I think the correct term may be "multicast delegate"
The solution to your issue is to create a script that loads your resources in the proper order or,
preferably, adding support to books to an existing script, that of CCLoader, that is already designed
with that purpose. I say preferably also because it makes little sense that every modder creates its
own script for something that now, thanks to CCLoader itself, can be "mass-produced" and
without risk of conflicts or having to merge default replacements of official resources (good thing
for an overhaul of recipes/ingregients/whatever, but not for adding custom stuff).
Gee, my head is exploding. Gotta go. I hope I haven't written too many stupid things.
Arsil, thanks for the amazing contribution.
Posts: 1,408
Thanks: 110569 in 109 Posts
Now supports custom books. This file is for testing purposes before replace the official mod file. Arsil, thanks for the amazing contribution. |
Going to test it now :lovestruc
Posts: 997
Thanks: 22090 in 95 Posts
icemunmun, remember to compile the fields Name and Creator in the main xml resource (also for the mod you already uploaded) ^^
Posts: 1,408
Thanks: 110569 in 109 Posts
Posts: 997
Thanks: 22090 in 95 Posts
I think it would be a good idea to put an advice/warning in the CCLoader thread (directly in the opening post)
to NOT make cross references between modules.
For instance, don't make a recipe that requires an ingredient defined in another module, because you
can't be sure that that module has already been parsed. Of course you can reference, for example, an
ingredient defined in the official resource "Ingredients" in GameplayData.package, AFAIK those resources,
even if there are default overrides of them, are always parsed before any xml parsed by a custom script.
Except when a certain modder decided to convert all ingredients to fruits in her overhaul and my poor,
innocent, candid White Rice stopped working. You were very very naughty Cinderellimouse :P
Let's suppose that the order between two CCLoader modules depends only by the path+filename of their packages.
What if one user rename the packages or put them in different folders? What if one user merges the packages?
That's what I meant before with not predictable.
Actually, it should not be too hard to verify how the order is established. With an experiment that
confirms/excludes the parameters taken into consideration. For example, we have 2 mods:
- one named A.package and the other B.package. They are in the same dir. See if A has priority over B.
- You also confronts the IID of the two S3SA (or maybe of the xmls that "activate" them) (this is just speculation, I've no clue if that matters)
- You also confronts the names of the two assemblies (this is just speculation, I've no clue if that matters)
- That said, if the same event handlers (if that's their correct name) are used by both mods, I think they use a list to
keep track of all the function delegates (if that's their correct name) added to them, so the order should depend by
one or a mix of the previous points.
Or we can find in the code how their are loaded/handled. But now that I think about it, I never asked myself
WHY mods work in the first place. Why the game checks the contents of the Mods directory?
Is it something the developers did to allow mods? At first the Mods folder was in the installation
dir and an additional dll was also required, right?
But I digress and these sounds like philosophical questions. Which came first, the Mods folder or the modder?
Maybe one day we can add support for custom minor pets. Well, maybe with another tool to not mix different things.
http://modthesims.info/showthread.p...564#post4718564
They are defined in a way very similar to plants, but there are a few complications:
- species are hard coded with an enum, so there's also need to specify (maybe in the same xml with the minor pet data)
- [optional] extra work to add the new species to its related spawner
Something like this
<?xml version="1.0"?> <CustomMinorPets> <Header> <EnumNamesList value="CustomLargeBird1, CustomLargeBird2" /> <EnumGuidsList value="1234567801,1234567802" /> <SpawnerNamesList value="MinorPetBirdLargeSpawner1,MinorPetBirdLargeSpawner1" /> <SpawnerProbabilitiesList value="1, 1" /> </Header> <!--Leave the first entry alone--> <LargeBirds> [...] </LargeBirds> <!--Define here your custom minor pets--> <LargeBirds> <Species>CustomLargeBird1</Species> [...] </LargeBirds> <LargeBirds> <Species>CustomLargeBird2</Species> [...] </LargeBirds> </CustomMinorPets>
Well, isn't this a - very sober, short, extremely clear and focused on just one subject - post?
Right. Yesterday I was too distracted and I forgot to thank you douglasveiga. I think it would be a good idea to put an advice/warning in the CCLoader thread (directly in the opening post) to NOT make cross references between modules. For instance, don't make a recipe that requires an ingredient defined in another module, because you can't be sure that that module has already been parsed. Of course you can reference, for example, an ingredient defined in the official resource "Ingredients" in GameplayData.package, AFAIK those resources, even if there are default overrides of them, are always parsed before any xml parsed by a custom script. Except when a certain modder decided to convert all ingredients to fruits in her overhaul and my poor, innocent, candid White Rice stopped working. You were very very naughty Cinderellimouse :P Let's suppose that the order between two CCLoader modules depends only by the path+filename of their packages. What if one user rename the packages or put them in different folders? What if one user merges the packages? That's what I meant before with not predictable.
Maybe one day we can add support for custom minor pets. Well, maybe with another tool to not mix different things. http://modthesims.info/showthread.p...564#post4718564 They are defined in a way very similar to plants, but there are a few complications: - species are hard coded with an enum, so there's also need to specify (maybe in the same xml with the minor pet data) - [optional] extra work to add the new species to its related spawner Something like this
Code:
<?xml version="1.0"?> <CustomMinorPets> <Header> <EnumNamesList value="CustomLargeBird1, CustomLargeBird2" /> <EnumGuidsList value="1234567801,1234567802" /> <SpawnerNamesList value="MinorPetBirdLargeSpawner1,MinorPetBirdLargeSpawner1" /> <SpawnerProbabilitiesList value="1, 1" /> </Header> <!--Leave the first entry alone--> <LargeBirds> [...] </LargeBirds> <!--Define here your custom minor pets--> <LargeBirds> <Species>CustomLargeBird1</Species> [...] </LargeBirds> <LargeBirds> <Species>CustomLargeBird2</Species> [...] </LargeBirds> </CustomMinorPets> Well, isn't this a - very sober, short, extremely clear and focused on just one subject - post? |
I believe it's possible to solve the dependencies between mods by building a Tree of tunings and them load everything from top (high dependency) to bottom (low dependency). Of course, we need to avoid any cross reference to avoid any loop in the tree.
I need to think about the bird loader later. I am sleepy...
Posts: 997
Thanks: 22090 in 95 Posts
and CCLoader could use that value to sort the tunings before parsing them.
But I'm not sure if this complication is necessary: if you make a recipe that requires one of your custom ingredient,
just put it in the same module.
About custom minor pets, it was just a random thought, the one I did didn't triggered much interest
(of course the fact it wasn't re-meshed nor re-textured played a role but that wasn't the point).
Posts: 1,408
Thanks: 110569 in 109 Posts
What happens if someone uses the new CCLoader and an harvestables package made with the old CCLoader_Generator?Is the books XML ignored as no book data is found?
The minor pets/birds idea is pretty cool.I will go check out your package in-game and will try a simple DDS replacement and post pictures(if you are okay with it).
I am being greedy...but what about Alchemy potions...they appear to be XML tunable too *runs away*
P.S. Are there any XML files for the University Barista bar drinks like the LN professional bar? I could not find them
See...I am keeping to the topic of the thread too
Posts: 997
Thanks: 22090 in 95 Posts
What happens if someone uses the new CCLoader and an harvestables package made with the old CCLoader_Generator?Is the books XML ignored as no book data is found? |
Yep, it's backward compatible. If there is no book defined in the xml, no xml at all or even no <Books_XML> field the CCLoader will keep doing its work.
The minor pets/birds idea is pretty cool.I will go check out your package in-game and will try a simple DDS replacement and post pictures(if you are okay with it). |
Sure. You can also upload it to MTS or wherever you want (but if someone else uses that script the two mods will conflict).
I am being greedy...but what about Alchemy potions...they appear to be XML tunable too *runs away* P.S. Are there any XML files for the University Barista bar drinks like the LN professional bar? I could not find them |
I only made a quick check, so very susceptible to errors.
I see an AlchemyRecipes xml (with Medators and ModelNames) that might work in a similar way to the Plants and MinorPets xmls.
The BaristaBar_blahblahblah xml lists the snacks and drinks available to buy.
Snacks are defined in the RecipeMasterList like regular recipes.
Drinks... well, seems like they will require more research. Seems like they are all variations of the same object,
accessoryCupBarBarista, they are divided in categories (teas, etc),
(for the texture or color of the drink probably)
a drink
Bottom line: it seems like there's room for "moddability".
See...I am keeping to the topic of the thread too |
Shame on you for going off topic!
EDIT: wanna try an Arsil's apple tea? It's very tasty and gives no nausea or side effects!
The VFX (Visual Effects?) is linked to the name of the ingredient
("ep9SpicePlate<IngredientNameWithBlanksRemoved>_main")
and I think refers to the name of a vfx defined in one of the _SWB resources.
Apples give no buffs, so no moodlet after drinking the tea.
Localization key : Gameplay/Objects/Appliances/BaristaBar:<drinkName>
With a default replacement of the BaristaBar_* xml you can't use custom ingredients though
(because this xml is parsed before the custom ingredients are added).
But you can use a script to add new drinks, making sure to add them after the related custom ingredients have been added.
Never mind, the drink list is re-created every time you use the interaction, so maybe it's not a problem.
Let me do a few test with your kiwi ingredient...
Oh, lovely, an infinite saving bug: welcome back sweet friend, I missed you sooo much.
Not sure if related. Yep, totally related. Even using a default Ingredient.
Attachment removed.
EDIT2: infinite saving even without it, must be something else then.
Too much experimental crap in my Mods folder or maybe a corrupted savefile
after too much crappy experiments...
EDIT3: Ok, it was something else. Apparently it works even with custom ingredients.
CustomDrinkForBaristaBar.package.zip (2.2 KB, 12 downloads) - View custom content | ||||||||||
4216 04-23-2015 16:09 CustomDrinkForBaristaBar.package --------- ------- 4216 1 file |
Posts: 1,408
Thanks: 110569 in 109 Posts
I will have to make a few tea ingredients!
I have recolored the cockatoo and posted it in the bird thread.Its very basic but I will do more stuff with it.
I may try something with the alchemy potions too!
Who Posted
|