- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Custom Content Loader - CCLoader
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Custom Content Loader - CCLoader
#1
27th Jan 2015 at 8:16 PM
Last edited by douglasveiga : 22nd Jan 2016 at 5:06 AM.
Custom Content Loader - CCLoader
Last update: 19th Jan 2016Requires basegame patch v1.67
This mod will be able to load into the game custom content tunings for Ingredients, Recipes, Books, Plants and Buffs/Moodlets created by third party modders.
Files:
CCLoader.zip -> Contains the required mod to load CC tunings.
CCLoader_Generator.zip -> For custom content creators . Contains the required files to create new CC tunings.
How to install CCLoader:
1- Unzip the content from the 'CCLoader.zip' inside your mods folder. Like any other mod.
Updates:
- 19th Jan 2016:
- Loads Events and custom Buffs/moodlets into the game.
- Recipe supports ingredient substitutions.
- Easy autosoil for custom plants.
- Shows a very basic report regardless the loading process, after an error happens.
- Cross reference between CC mods are correctly handle.
How to create new CC tunings:
1- Make sure the CCLoader is installed in the game.
2- Unzip 'CCLoader_Generator.zip'.
3- Run 'CCLoader_Generator.exe' to create the files (only Windows OS).
4- Open S3PE and click on File > New.
5- Drag all the created files inside the S3PE and click on "Import" button.
6 - Edit the tuning files as you wish. (_Plants, _Ingredients or _Recipes)
7 - Save inside your Mods folder and close s3pe.
=== Tips ===
You can edit the "CCL*******.dll" XML file as you wish.
For example, include your name or even remove some references to unused XML files. If you won't use the _Recipes xml, you could remove the reference to speedup the loading process.
=== Checking if everything is OK ===
If any problem happens during the xml parse process, a small popup will appear to display the info, next time you load a saved game.
Another option: Open the cheat console (Ctrl+Shift+C) and write "CCLoader" to display all the loaded CC tunings.
=== Helpful links for custom content creators ===
http://modthesims.info/showthread.p...050#post4917050
Additional files for testing purposes:
GreenApple_Ingredient.zip -> GreenApple Ingredient example.
ChocolatePie_Snack.zip -> ChocolatePie Snack example.
Credits and Help:
Arsil, Inge and Peter Jones.
icemunmun
Tools
s3pe, s3oc, Notepad++,
Microsoft visual studio
Attached files:
CCLoader.zip (13.7 KB, 71064 downloads) - View custom content | ||||||||||
17895 2016-01-22 03:06 douglasveiga_CCLoader.package --------- ------- 17895 1 file |
||||||||||
CCLoader_Generator.zip (17.8 KB, 14087 downloads) - View custom content | ||||||||||
34788 2015-12-15 18:32 CCLoader_Generator.exe 0 2015-12-14 18:18 base/ 4231 2015-01-27 14:24 base/CCLoaderData.s3sa 8159 2015-12-15 18:02 base/_Books._xml 1688 2015-12-16 17:30 base/_Buffs._xml 781 2015-12-15 18:12 base/_data._xml 343 2015-12-15 18:12 base/_EventHandlers._xml 1484 2015-12-16 17:31 base/_Ingredients._xml 2072 2015-12-16 17:31 base/_Plants._xml 2427 2015-12-18 00:36 base/_Recipes._xml --------- ------- 55973 10 files |
||||||||||
GreenApple_Ingredient.zip (435.7 KB, 20282 downloads) - View custom content | ||||||||||
542428 01-27-2015 20:06 GreenApple_Ingredient.package --------- ------- 542428 1 file |
||||||||||
ChocolatePie_Snack.zip (294.7 KB, 19674 downloads) - View custom content | ||||||||||
354873 04-04-2015 17:38 ChocolatePie_Snack.package --------- ------- 354873 1 file |
Advertisement
#2
28th Jan 2015 at 9:25 AM
Posts: 997
Thanks: 22090 in 95 Posts
Thanks for sharing your hard work. If it is not clear, this mod/tool creates skeletons/templates of the XML
resources used to define new recipes, ingredients and plants, and also automates the scripting needed
to load and make them available into the game (like the NRaas tool to generate the script/S3SA to load
custom careers). Very useful for creators without coding expertise.
OT: This reminded me that some time ago I tried to do an auto soil plant for your strawberry mod.
I tried again and this time I was able to do it. Do you mind if I share it here? If you like you can put
it as optional download along with the main mod, no need to credit me (and I'll delete the attachment).
EDIT: Sorry if it was inappropriate to mention that here, I don't want to diverge the focus from this tool.
resources used to define new recipes, ingredients and plants, and also automates the scripting needed
to load and make them available into the game (like the NRaas tool to generate the script/S3SA to load
custom careers). Very useful for creators without coding expertise.
OT: This reminded me that some time ago I tried to do an auto soil plant for your strawberry mod.
I tried again and this time I was able to do it. Do you mind if I share it here? If you like you can put
it as optional download along with the main mod, no need to credit me (and I'll delete the attachment).
EDIT: Sorry if it was inappropriate to mention that here, I don't want to diverge the focus from this tool.
#3
28th Jan 2015 at 9:24 PM
Quote: Originally posted by Arsil
Thanks for sharing your hard work. If it is not clear, this mod/tool creates skeletons/templates of the XML resources used to define new recipes, ingredients and plants, and also automates the scripting needed to load and make them available into the game (like the NRaas tool to generate the script/S3SA to load custom careers). Very useful for creators without coding expertise. |
Thank you for the additional explanation. I avoided all the technical details and didn't notice that the text is unclear.
Quote: Originally posted by Arsil
OT: This reminded me that some time ago I tried to do an auto soil plant for your strawberry mod. I tried again and this time I was able to do it. Do you mind if I share it here? If you like you can put it as optional download along with the main mod, no need to credit me (and I'll delete the attachment). EDIT: Sorry if it was inappropriate to mention that here, I don't want to diverge the focus from this tool. |
That is awesome, of course you can share here. I believe it will be useful for learning purpose.
#4
28th Jan 2015 at 10:35 PM
Last edited by Arsil : 3rd Feb 2015 at 10:09 AM.
Posts: 997
Thanks: 22090 in 95 Posts
I tested it extensively and it seems to work like any other auto soil plant.
You'll find it in the Buy Catalog, under ByFunction/Debug/PlantAndSeedSpawners.
It has the CC icon, so to find it quickly you can filter for that if you have many items
in that category.
Don't ask me how it works, I don't know I just tried to copy how existing auto soil plants work.
I guess it's simply a matter of referring to the name (string) of the ingredient/fruit "strawberry",
since that also works as the seed of the plant, and the game will create the exact same plant
but already in the "mature"/"ready to harvest" stage (my game is localized, probably they are
not the correct English terms) that doesn't need any maintenance and never withers
(if put in a community lot).
Feel free to modify it, change my lame/awkward STBL strings and rename the package.
If you want to put it with your main mod as optional download (I repeat, no need to credit me),
please let me know so I'll delete my attachment (no need to have more copies in multiple places).
It's NOT compatible with the strawberry auto soil plant of Bohemian Garden Fruits and Nuts,
and with that I mean that there will be 2 auto soil plants but both will generate the same plant based on
the priority of the mod vs the store content (I think .package wins over .Sims3Pack, otherwise is the path
plus packageName that determines the priority between 2 .package files).
EDIT: how moron can I be? It's not about the priority (that is only true if 2 packages have resources with
the same TGIs) but about what resource is parsed/read/initialized before the other, based on the TGI I guess.
I also tried to optimize the package (I hoped I could only leave OBJD, OBJK, S3SA, NGMP and STBLs)
but when I tried to cut some resources (even just FTPT, _RIG, LITE and RSLT) using instead "links" to
the resources of the cloned auto soil potato plant it didn't seem to work correctly[***], so I gave up and left all
resources. Maybe the NGMP isn't even needed (the hashing key is the class name of the auto soil plant).
If you are interested you can try to experiment with that more, I may have not tried hard enough
(and also never cleared the cache between an attempt and the other). I'm a lazy ass modder ^^
[***] EDIT: trying to optimize it and understand what resources are strictly needed is worth another shot,
I was very tired when I tried to do that and maybe I misread the results: at first when a plant had no
fruits I though it wasn't working correctly, then I discovered that when you place an auto soil plant it
doesn't always already has fruits to harvest, I didn't figure out if it's random or how else it works.
I'm not in the mood to try again right now, I'll leave that experimentation to others.
You'll find it in the Buy Catalog, under ByFunction/Debug/PlantAndSeedSpawners.
It has the CC icon, so to find it quickly you can filter for that if you have many items
in that category.
Don't ask me how it works, I don't know I just tried to copy how existing auto soil plants work.
I guess it's simply a matter of referring to the name (string) of the ingredient/fruit "strawberry",
since that also works as the seed of the plant, and the game will create the exact same plant
but already in the "mature"/"ready to harvest" stage (my game is localized, probably they are
not the correct English terms) that doesn't need any maintenance and never withers
(if put in a community lot).
Feel free to modify it, change my lame/awkward STBL strings and rename the package.
If you want to put it with your main mod as optional download (I repeat, no need to credit me),
please let me know so I'll delete my attachment (no need to have more copies in multiple places).
It's NOT compatible with the strawberry auto soil plant of Bohemian Garden Fruits and Nuts,
and with that I mean that there will be 2 auto soil plants but both will generate the same plant based on
the priority of the mod vs the store content (I think .package wins over .Sims3Pack, otherwise is the path
plus packageName that determines the priority between 2 .package files).
EDIT: how moron can I be? It's not about the priority (that is only true if 2 packages have resources with
the same TGIs) but about what resource is parsed/read/initialized before the other, based on the TGI I guess.
I also tried to optimize the package (I hoped I could only leave OBJD, OBJK, S3SA, NGMP and STBLs)
but when I tried to cut some resources (even just FTPT, _RIG, LITE and RSLT) using instead "links" to
the resources of the cloned auto soil potato plant it didn't seem to work correctly[***], so I gave up and left all
resources. Maybe the NGMP isn't even needed (the hashing key is the class name of the auto soil plant).
If you are interested you can try to experiment with that more, I may have not tried hard enough
(and also never cleared the cache between an attempt and the other). I'm a lazy ass modder ^^
[***] EDIT: trying to optimize it and understand what resources are strictly needed is worth another shot,
I was very tired when I tried to do that and maybe I misread the results: at first when a plant had no
fruits I though it wasn't working correctly, then I discovered that when you place an auto soil plant it
doesn't always already has fruits to harvest, I didn't figure out if it's random or how else it works.
I'm not in the mood to try again right now, I'll leave that experimentation to others.
Attached files:
DV_Strawberry_AutoSoilPlant.package.zip (186.8 KB, 803 downloads) - View custom content | ||||||||||
231214 01-28-2015 00:28 DV_Strawberry_AutoSoilPlant.package --------- ------- 231214 1 file |
#5
30th Jan 2015 at 6:04 PM
Last edited by Arsil : 15th Feb 2015 at 10:43 AM.
Posts: 997
Thanks: 22090 in 95 Posts
I found the time (not the mood) to try again. It works fine with this minimalistc set of resources:
OBJD, OBJK (refers to the VPXY of the potato plant), S3SA and STBLs. The NGMP apparently
is not needed, I put it there in the first place because that's what the store auto soil plants do.
About how auto soil plants work: the script just return a string, which is the name of the ingredient,
now in the ingredient definition it is specified the plant associated with that ingredient, so when
you place an auto-soil plant the game create the normal plant associated with that ingredient.
This is only my speculation, I haven't checked the code to verify if it's true.
EDIT: I took a peek at the code and, yep, I guessed right, that's pretty much what happens.
Another thing I noticed is that when you place an auto soil plant, two objects are created:
the auto soil plant and the normal plant (you can verify that there are indeed two objects
clicking on the "dirt" of the plant and NRaas Debug Enabler will display pie menu entries
for two items: the frostable plant and the autosoilplant - you can also verify that with
NRaas Master Controller clicking on the ground and examining all object in the radious).
EDIT: That happens also with regular plants (the second one, in this case, is of class soil).
Sorry for the confusion, I never played much with gardening.
I noticed something else very creepy though: if you put an auto soil plant in a residential lot,
sims will start to continually route fail trying to wet them. This behaviour continues also if you
delete all plants (and I verified they were actually deleted with Master Controller). Do you know
if this is a well known issue or maybe is it caused by a mod or a combination of "conflicting" mods?
EDIT: I got it. Some time ago I've ITUNed some gardening interactions so they are executed
autonomously, so the routing fails happen because auto soil don't need watering (but doesn't
explain why sims still try to water plants after I utterly destroy/remove them...)
For now I'm leaving the attachment of the "extended" version of the mod, just in case.
OBJD, OBJK (refers to the VPXY of the potato plant), S3SA and STBLs. The NGMP apparently
is not needed, I put it there in the first place because that's what the store auto soil plants do.
About how auto soil plants work: the script just return a string, which is the name of the ingredient,
now in the ingredient definition it is specified the plant associated with that ingredient, so when
you place an auto-soil plant the game create the normal plant associated with that ingredient.
This is only my speculation, I haven't checked the code to verify if it's true.
EDIT: I took a peek at the code and, yep, I guessed right, that's pretty much what happens.
Another thing I noticed is that when you place an auto soil plant, two objects are created:
the auto soil plant and the normal plant (you can verify that there are indeed two objects
clicking on the "dirt" of the plant and NRaas Debug Enabler will display pie menu entries
for two items: the frostable plant and the autosoilplant - you can also verify that with
NRaas Master Controller clicking on the ground and examining all object in the radious).
EDIT: That happens also with regular plants (the second one, in this case, is of class soil).
Sorry for the confusion, I never played much with gardening.
I noticed something else very creepy though: if you put an auto soil plant in a residential lot,
sims will start to continually route fail trying to wet them. This behaviour continues also if you
delete all plants (and I verified they were actually deleted with Master Controller). Do you know
if this is a well known issue or maybe is it caused by a mod or a combination of "conflicting" mods?
EDIT: I got it. Some time ago I've ITUNed some gardening interactions so they are executed
autonomously, so the routing fails happen because auto soil don't need watering (but doesn't
explain why sims still try to water plants after I utterly destroy/remove them...)
For now I'm leaving the attachment of the "extended" version of the mod, just in case.
Attached files:
DV_Strawberry_AutoSoilPlant.package.zip (3.1 KB, 440 downloads) - View custom content | ||||||||||
6515 01-30-2015 18:55 DV_Strawberry_AutoSoilPlant.package --------- ------- 6515 1 file |
||||||||||
Description: Minimalistc version of the auto soil plant (6.6kB instead of 231.2kB) |
#6
3rd Feb 2015 at 6:05 PM
Last edited by Arsil : 9th Feb 2015 at 12:29 PM.
Posts: 997
Thanks: 22090 in 95 Posts
I made a custom plant (and fruit, of course). This is not pretty enough to use it as is in your game,
I did it only as a learning experience and as a reference. Of course it needs douglasveiga's mod.
Feel free to use it and modify it, but please don't redistribute it because if more than one person
does that then there will be conflicts. Don't try to renumber the resources with S3OC, that will only
screw it up because it uses an NGMP resource (uhm... maybe this one is safely renumerable) and
also that particular hashing algorithm that connects plant/ingredient name to the IID of their
respective MODL.
This is organized in three packages, because that was very handy when developing it and I've
left it in this format because I though that maybe it's more "readable" this way. You can merge
them or import all resources in the same package. I didn't change the meshes (mostly because
the ingredient uses geostates and I can't use TSRW or the Blender plugin to handle them), but
as you can see in the screen shot I've put a mark on the textures to show that they are indeed
two different plants/fruits.
The thumbnail sucks (it's generated automatically based on the mesh/textures), to change it you
can use the smart workaround used by tenmang HERE (wait, that was for store ingredients,
maybe in this case it's easier to calculate the IID to assign to the THUM resource, whatever).
The _XML resources in the "main" package are heavily commented, but if you are interested
I'm making a kind of step by step guide to create a custom plant from scratch in this THREAD.
Thank you again douglasveiga ^^
I did it only as a learning experience and as a reference. Of course it needs douglasveiga's mod.
Feel free to use it and modify it, but please don't redistribute it because if more than one person
does that then there will be conflicts. Don't try to renumber the resources with S3OC, that will only
screw it up because it uses an NGMP resource (uhm... maybe this one is safely renumerable) and
also that particular hashing algorithm that connects plant/ingredient name to the IID of their
respective MODL.
This is organized in three packages, because that was very handy when developing it and I've
left it in this format because I though that maybe it's more "readable" this way. You can merge
them or import all resources in the same package. I didn't change the meshes (mostly because
the ingredient uses geostates and I can't use TSRW or the Blender plugin to handle them), but
as you can see in the screen shot I've put a mark on the textures to show that they are indeed
two different plants/fruits.
The thumbnail sucks (it's generated automatically based on the mesh/textures), to change it you
can use the smart workaround used by tenmang HERE (wait, that was for store ingredients,
maybe in this case it's easier to calculate the IID to assign to the THUM resource, whatever).
The _XML resources in the "main" package are heavily commented, but if you are interested
I'm making a kind of step by step guide to create a custom plant from scratch in this THREAD.
Thank you again douglasveiga ^^
Attached files:
custom_plant_example.package.zip (938.6 KB, 473 downloads) - View custom content | ||||||||||||||||||
17166 02-03-2015 15:28 Arsil_CustomFruit.package 1133450 02-03-2015 15:02 Arsil_CustomPlant.package 12975 02-03-2015 18:30 custom_plant_example.package --------- ------- 1163591 3 files |
#7
9th Feb 2015 at 2:17 PM
Last edited by Arsil : 11th Feb 2015 at 1:18 PM.
Posts: 997
Thanks: 22090 in 95 Posts
Hello douglasveiga ^^
Are you interested in adding support to custom books in your CCLoader?
I wanted to come to you with a working code so you only had to fit it in yours,
but my loader still has some problem: it adds the book (as you can see with
the debug messages) but for some reason the book is not available (it is if I
override the whole Books _XML and I append my custom book data there,
but that system doesn't allow to share custom books easily).
EDIT: it's working now, see below.
I also got side tracked and spent some time trying to find out if custom covers
(books' textures) are possible. Unfortunately it doesn't seem likely.
The bottom line is: if you are interested,I'll try to make the loader work and all you'll
have to do is to integrate it with your code (I guess it will be very easy). Personally I'm
not very interested in adding custom books to my own game, but your CCLoader came
to mind, so I decided to ask.
I said that I don't care about custom books, but I was a bit disappointed after doing
an almost perfect replica of the cover of one of my favourite books and discovering
that I couldn't use it ^^
If someone is interested in helping me (honestly I have no idea why it's not working)
I'll post my source-code (it's very short) and also the package I'm using so you wont
have to make your own, as easy as it is.
EDIT: It's working fine now. Other than regular books (BookGeneral), I was also
successful creating a BookToddler (a book readable to toddlers) and a BookRecipe
(tested with my White Rice, removing the auto-learn flag from the recipe's definition).
I'm sure creating other kind of books is likewise easy. Unfortunately custom textures
really seems out of questions (and without those, custom books, at least for me, are
much less appealing), but I'd really like confirmation from someone expert in those
kind of resources. For example: what if we use "external" instead of "private" in the
field where the drop down menu is opened or in the RefType of the single entries?
Would that make any difference in the way the _IMG resource is retrieved?
Are you interested in adding support to custom books in your CCLoader?
I wanted to come to you with a working code so you only had to fit it in yours,
the debug messages) but for some reason the book is not available (it is if I
override the whole Books _XML and I append my custom book data there,
but that system doesn't allow to share custom books easily).
EDIT: it's working now, see below.
I also got side tracked and spent some time trying to find out if custom covers
(books' textures) are possible. Unfortunately it doesn't seem likely.
Quote:
In a xml definition for a "BookGeneral" there are these two tags that take a string as value: - GeometryState (BookLargeThick, BookLargeThin, BookMediumThick, BookMediumThin, BookSmallThin) - MaterialState (bookFiction, ...) While I had no doubt that you could not use a custom geostate to change the size/shape of the book (I knew that geostates are defined in the mesh itself), I hoped that you could reference an external resource for the texture. So I tried with a custom MaterialState value in the book definition, created the relative _IMG resource, but it doesn't work. The geometry state refers to a geostate defined in the MODL/MLOD of the book (IID 0x00000000008E0FC4 in FullBuild0). Example: BookLargeThick, fvn32 hashed, is 0x6653D7DA and it's defined in the geometrystate [04] of MODL/MLOD (chunkentry [01)) The material state refers to a MTST defined in the MODL/MLOD of the book. The value of MaterialState works like this:
I can't figure out how the two (Resource block entry and MTST entry) are connected, I don't understand how the indexing works and I don't think it depends by how they are sorted. Not that understanding that can change anything... I thought about overriding the meshes of the book and add the Resource entry for the TGI of the custom texture and a MTST entry, but honestly I have no clue how to add the last one. I mean, I can but I don't know how to index it to the right resource entry. Anyway this is not a practical solution if the purpose is to let anyone add and share custom books with custom covers/textures. I also thought about changing the texture with a script, but buying books from the bookStore rabbit hole or getting them from a shelve doesn't trigger an event (and there are other means too to get a book). Anyway if a book get exported/imported (it happens when traveling or moving into another world) the texture will be resetted to the default one (since the custom one is not officially enlisted in the mesh). But this is an idea I throwed away immediately because doesn't seem very practical either. That's why I don't think it's possible to have custom covers (with a reasonable effort). |
The bottom line is: if you are interested,
have to do is to integrate it with your code (I guess it will be very easy). Personally I'm
not very interested in adding custom books to my own game, but your CCLoader came
to mind, so I decided to ask.
I said that I don't care about custom books, but I was a bit disappointed after doing
an almost perfect replica of the cover of one of my favourite books and discovering
that I couldn't use it ^^
I'll post my source-code (it's very short) and also the package I'm using so you wont
have to make your own, as easy as it is.
EDIT: It's working fine now. Other than regular books (BookGeneral), I was also
successful creating a BookToddler (a book readable to toddlers) and a BookRecipe
(tested with my White Rice, removing the auto-learn flag from the recipe's definition).
I'm sure creating other kind of books is likewise easy. Unfortunately custom textures
really seems out of questions (and without those, custom books, at least for me, are
much less appealing), but I'd really like confirmation from someone expert in those
kind of resources. For example: what if we use "external" instead of "private" in the
field where the drop down menu is opened or in the RefType of the single entries?
Would that make any difference in the way the _IMG resource is retrieved?
#8
11th Feb 2015 at 4:23 PM
ok. I will include in the main mod. I never created any new books so I am not too familiar about the subject.
#9
11th Feb 2015 at 4:50 PM
Posts: 275
Quote: Originally posted by Arsil
I also got side tracked and spent some time trying to find out if custom covers (books' textures) are possible. Unfortunately it doesn't seem likely. |
AFAIK, there are several 'classes' of books, and each class has one cover.
New books must use one of these classes; it seems to be impossible to add new classes that the game will recognize.
Here's a thread at SimsAsylum for a mod for modified book covers: http://simsasylum.com/tfm/index.php...dated-12-18-13/
Nobody is Perfect. I am Nobody. And I'm trying to make something wonderful for The Sims 3.
#10
11th Feb 2015 at 5:01 PM
Posts: 997
Thanks: 22090 in 95 Posts
Books are a piece of cake, you'll understand how they work in no time.
Basically you do the same thing explained HERE, but with a loader
that read the xml data from a custom resource, so there will be no more
need to override the Books _XML, so it will be more easy to add and share
custom books between users. I don't want to make you pressure, I'm aware
that books (especially without custom covers) aren't exciting as plants,
ingredients and recipes, so don't worry about saying no.
If you confirm that you want to include it, what you want me to do? Upload the package here?
If you have no problem about it, I'd also like to post directly the sourcecode,
so maybe it will be more easy to see what it does and spot if there are issues.
Of course you are free to modify it as you see fit, not only to integrate it with
your framework and the tool that generates the xml files, but in any way you want.
Basically you do the same thing explained HERE, but with a loader
that read the xml data from a custom resource, so there will be no more
need to override the Books _XML, so it will be more easy to add and share
custom books between users. I don't want to make you pressure, I'm aware
that books (especially without custom covers) aren't exciting as plants,
ingredients and recipes, so don't worry about saying no.
If you confirm that you want to include it, what you want me to do? Upload the package here?
If you have no problem about it, I'd also like to post directly the sourcecode,
so maybe it will be more easy to see what it does and spot if there are issues.
Of course you are free to modify it as you see fit, not only to integrate it with
your framework and the tool that generates the xml files, but in any way you want.
#11
13th Feb 2015 at 4:44 PM
Last edited by Lyralei : 15th Jul 2020 at 11:00 AM.
Reason: fixing bbcode
Posts: 997
Thanks: 22090 in 95 Posts
Reading old posts, I found out that NRaas Careers already implements a loader to
read book data from a custom xml resource. I don't think that feature is used much
(but, on the other hand, I only use the self-employed careers that come with the
mod itself, so what can I know about it). There's also a new class derived from Book
(not sure why that's needed, but I've only gave a quick peek), it uses 1 or 2 custom
textures, but because it uses a custom MODL that "mentions" them, so not very
interesting for a more universal customization point of view.
Not sure if it's still worth it to add it to douglasveiga's CCLoader, anyway here's the
package and the source-code (mind that this will only read data from the xml
resource whose name is hard-coded in the script).
I post the source-code only because this way is more easy for me to highlight a few
things that I deem noteworthy and others that may need improving (mostly debugging
messages, I guess a better solution would be to use a delayed StyledNotification.Show).
All comments use italic to make them more distinguishable from the rest.
read book data from a custom xml resource. I don't think that feature is used much
(but, on the other hand, I only use the self-employed careers that come with the
mod itself, so what can I know about it). There's also a new class derived from Book
(not sure why that's needed, but I've only gave a quick peek), it uses 1 or 2 custom
textures, but because it uses a custom MODL that "mentions" them, so not very
interesting for a more universal customization point of view.
Not sure if it's still worth it to add it to douglasveiga's CCLoader, anyway here's the
package and the source-code (mind that this will only read data from the xml
resource whose name is hard-coded in the script).
I post the source-code only because this way is more easy for me to highlight a few
things that I deem noteworthy and others that may need improving (mostly debugging
messages, I guess a better solution would be to use a delayed StyledNotification.Show).
All comments use italic to make them more distinguishable from the rest.
Code:
namespace Arsil.CustomBookLoader { public static class Instantiator { [Tunable] internal static bool kInstantiator = false; internal static bool alreadyParsed = false; static Instantiator() { World.OnWorldLoadFinishedEventHandler += new EventHandler(OnWorldLoadFinished); } public static void OnWorldLoadFinished(object sender, EventArgs e) { if (!alreadyParsed) { ParseBooks(); } alreadyParsed = true; } public static void ParseBooks() { string xmlRes = "ArsilCustomBooks_XML"; // I don't know how to format/show a ulong or string into hex format //string hashCode = ResourceUtils.HashString64(xmlRes).ToString("X16"); XmlDbData xmlDbData = XmlDbData.ReadData(xmlRes); if (xmlDbData == null || xmlDbData.Tables == null) { //SimpleMessageDialog.Show("[DEBUG] CustomBookLoader", "Resource " + xmlRes + " (IID "+hashCode+") of type _XML not found or with no data defined!" ); SimpleMessageDialog.Show("[DEBUG] CustomBookLoader", "Resource " + xmlRes + " of type _XML not found or with no data defined!"); return; } //SimpleMessageDialog.Show("ArsilCustomBookLoader", "PRE-ADD Book Count : " + BookData.BookGeneralDataList.Count); try { // when a new book is created, to the rowIndex field is assigned an index or counter (based on how many books have been created so far) // such field seems unused (at least in the visible code), so it should not be a problem, // but at first I created a copy of the LoadBookData method to deal with that (it's inside a nested spoiler's tag in the post) //LoadExtraBookData(xmlDbData, "BookGeneral", BookData.BookType.General); BookData.LoadBookData(xmlDbData, "BookGeneral", BookData.BookType.General); BookData.LoadBookData(xmlDbData, "BookSkill", BookData.BookType.Skill); BookData.LoadBookData(xmlDbData, "BookRecipe", BookData.BookType.Recipe); BookData.LoadBookData(xmlDbData, "MedicalJournal", BookData.BookType.MedicalJournal); BookData.LoadBookData(xmlDbData, "SheetMusic", BookData.BookType.SheetMusic); BookData.LoadBookData(xmlDbData, "BookToddler", BookData.BookType.Toddler); BookData.LoadWrittenBookTitles(xmlDbData); // there's no way to use custom material states (MTST), so this can be commented (must be removed from the xml too) //BookData.LoadWrittenBookMaterials(xmlDbData); BookData.LoadBookData(xmlDbData, "BookFish", BookData.BookType.FishBook); BookData.LoadBookData(xmlDbData, "BookAlchemyRecipe", BookData.BookType.AlchemyRecipe); BookData.LoadBookData(xmlDbData, "BookComics", BookData.BookType.Comic); BookData.LoadBookData(xmlDbData, "BookComics", BookData.BookType.VintageComic); BookData.LoadBookData(xmlDbData, "AcademicTextBook", BookData.BookType.AcademicTextBook); } catch (Exception e) { // if the stackTrace is too long, the "OK" button might be unreachable and the game becomes unplayable SimpleMessageDialog.Show("CustomBookLoader", e.StackTrace); //SimpleMessageDialog.Show("[DEBUG] CustomBookLoader", "Error parsing custom book data from "+xmlRes + " (IID "+hashCode); SimpleMessageDialog.Show("[DEBUG] CustomBookLoader", "Error parsing custom book data from " + xmlRes); } // the bookstore item dictionary is also used by BookStoreRegister, bookshelves pick books directly from BookData Bookstore.mItemDictionary.Clear(); Bookstore.LoadData(); // the following was used for debugging, it's no longed needed //SimpleMessageDialog.Show("ArsilCustomBookLoader", "POST-ADD Book Count : " + BookData.BookGeneralDataList.Count); } /*public static void LoadExtraBookData(XmlDbData spreadsheet, string bookSheet, BookData.BookType bookType) { if (!spreadsheet.Tables.ContainsKey(bookSheet)) { return; } XmlDbTable xmlDbTable = spreadsheet.Tables[bookSheet]; int num = 0; num = BookData.BookGeneralDataList.Count; //num += 1000; List<StoreItem> listG = null; List<StoreItem> listA = null; //list = new List<StoreItem>(); listG = Bookstore.mItemDictionary["General"]; listA = Bookstore.mItemDictionary["All"]; //BookGeneralData current = null; foreach (XmlDbRow currentRow in xmlDbTable.Rows) { BookData.AddNewBook(currentRow, bookType, num); num++; //foreach(BookGeneralData bgd in BookData.BookGeneralDataList.Values) //{ // current = bgd; // break; //} //ThumbnailKey thumb = new ThumbnailKey(new ResourceKey((ulong)ResourceUtils.XorFoldHashString32("book_standard"), 23466547u, 1u), ThumbnailSize.Medium, ResourceUtils.HashString32(current.GeometryState), ResourceUtils.HashString32(current.MaterialState)); //StoreItem item = new BookGeneralStoreItem(current.Title, (float)current.Value, current, thumb, current.GenerateUIStoreItemID(), new CreateObjectCallback(Bookstore.CreateBookGeneralCallback), new ProcessObjectCallback(Bookstore.ProcessBookGeneralCallback), current.AllowedWorlds, current.AllowedWorldTypes, current.Author, current.Title, current.Length, current.GenreLocalizedString); //listG.Add(item); //listA.Add(item); } Bookstore.mItemDictionary.Clear(); Bookstore.LoadData(); }*/ } }
Attached files:
Arsil_CustomBookLoader.package.zip (13.4 KB, 494 downloads) - View custom content | ||||||||||
20640 02-12-2015 17:43 Arsil_CustomBookLoader.package --------- ------- 20640 1 file |
Lab Assistant
#12
14th Feb 2015 at 6:30 PM
Posts: 132
Thanks: 1515 in 20 Posts
This is awesome! Thank you so much for providing this for those of us who cannot code!
I just tried it out and successfully transferred my existing plant/recipe/ingredient mod using your new tools, generating a new .dll! I just checked it alongside your green apple example and it was fine! I had errortrap in too and it didn't shout at me like it normally would when I break something! This means I can add new ingredients much more easily, without having to over-ride the master xmls each time. And now the ingredients can be optional, instead of all included in one big mod!
Thank you so much for doing this, you're awesome!
I just tried it out and successfully transferred my existing plant/recipe/ingredient mod using your new tools, generating a new .dll! I just checked it alongside your green apple example and it was fine! I had errortrap in too and it didn't shout at me like it normally would when I break something! This means I can add new ingredients much more easily, without having to over-ride the master xmls each time. And now the ingredients can be optional, instead of all included in one big mod!
Thank you so much for doing this, you're awesome!
Instructor
#13
2nd Mar 2015 at 1:32 AM
Posts: 496
Thanks: 6862 in 28 Posts
What is the difference between a autosoil plant and a normal plant?
#14
2nd Mar 2015 at 1:14 PM
Posts: 997
Thanks: 22090 in 95 Posts
The autosoil one is buyable from the catalog (debug), it's already in the mature or harvestable
stage when you place it, needs no maintenance and never withers (in a community lot).
stage when you place it, needs no maintenance and never withers (in a community lot).
#15
13th Apr 2015 at 11:29 PM
Posts: 114
Hi there !
So i'm having a little problem with your mod, it's not working.
I have installed it with my other mods as usual but once my game is done loading i get like a pop up. I took a picture but i don't know how to post the image on here.
The message says :
CCLoader
Name:Undefined
Creator:undefined
Error: System.NullReferenceException: A null value was found where an object instance was required.
It's not the entire message but i can't be bothered to copy all of it ... Can you help at all ?
So i'm having a little problem with your mod, it's not working.
I have installed it with my other mods as usual but once my game is done loading i get like a pop up. I took a picture but i don't know how to post the image on here.
The message says :
CCLoader
Name:Undefined
Creator:undefined
Error: System.NullReferenceException: A null value was found where an object instance was required.
It's not the entire message but i can't be bothered to copy all of it ... Can you help at all ?
#16
14th Apr 2015 at 8:48 PM
Posts: 997
Thanks: 22090 in 95 Posts
If you upload your package I'll gladly take a look at it to check what's the problem
(I guess there's something wrong in one of your xml resources).
When you reply to a post, see the "Manage Attachments" section below the textbox for the message.
(I guess there's something wrong in one of your xml resources).
When you reply to a post, see the "Manage Attachments" section below the textbox for the message.
#17
14th Apr 2015 at 10:12 PM
Posts: 114
Hum i'm not sure what you want me to send you. I'm trying to attach the picture but looks like it's to big of a volume cause it's not attaching if thats makes sence ..
#18
14th Apr 2015 at 10:21 PM
Posts: 997
Thanks: 22090 in 95 Posts
Unless there's the stacktrace included I doubt the screenshot (or the error message itself) can help much.
You should upload the file with ".package" extension you are trying to use with the CCLoader,
that's the easiest way to understand what's the problem and hopefully help you to fix it.
You should upload the file with ".package" extension you are trying to use with the CCLoader,
that's the easiest way to understand what's the problem and hopefully help you to fix it.
#19
14th Apr 2015 at 10:55 PM
Last edited by cinthila : 15th Apr 2015 at 7:57 PM.
Posts: 114
Quote: Originally posted by Arsil
Unless there's the stacktrace included I doubt the screenshot (or the error message itself) can help much. You should upload the file with ".package" extension you are trying to use with the CCLoader, that's the easiest way to understand what's the problem and hopefully help you to fix it. |
Ok no problem !
Well that's the one i'm trying to use. What i don't understand is why i seem to be the only having troubles with that mod. If there's a problem with the package it should limit everybody right?
Thanks again for helping me !
#20
15th Apr 2015 at 9:52 AM
Posts: 997
Thanks: 22090 in 95 Posts
Oh! You could have just said you had a problem with icemunmun's mod. Please remove the attachment.
Did you try to modify it or it's the original version?
Have you tried to re-download it?
Have you tried other packages that requires the CCLoader to work? If not, try with one posted by
douglasveiga on the opening post of this thread.
Is your game fully patched? Not sure if it's relevant, but better be safe than sorry.
EDIT: Have you downloaded only this file? You have to download both files. This only contains
the recipes, you also need the one with the ingredients and plants to make it work.
Did you try to modify it or it's the original version?
Have you tried to re-download it?
Have you tried other packages that requires the CCLoader to work? If not, try with one posted by
douglasveiga on the opening post of this thread.
Is your game fully patched? Not sure if it's relevant, but better be safe than sorry.
EDIT: Have you downloaded only this file? You have to download both files. This only contains
the recipes, you also need the one with the ingredients and plants to make it work.
#21
15th Apr 2015 at 10:50 AM
Last edited by icemunmun : 15th Apr 2015 at 12:39 PM.
Posts: 1,408
Thanks: 110574 in 109 Posts
Quote: Originally posted by cinthila
Hi there ! The message says : CCLoader Name:Undefined Creator:undefined Error: System.NullReferenceException: A null value was found where an object instance was required. |
This error message generally pops up if the ingredients defined in the recipe is not present in game like for example CC ingredients/EP or store ingredients which you do not have.
As Arsil has pointed out,you need both the packages(Ingredient+Recipe) for the recipes to work.
#22
15th Apr 2015 at 8:03 PM
Posts: 114
Thank to both of you for you help! I did download both of the files and it was the original version.
After talking to you yesterday i tried to clean up my mods by removing the cache files and I redownloaded (if that makes sence) both CCloader and you mod icemunmun. I don't know what i did differently but it seemed to work after that. I only played for about 30 minutes though and then my game crashed. Am pretty sure it as nothing to do with any of these mods, I just have too much rubbish on my game and my computer can't handle it.
Anyway, if I have time today i'll try again and see if it's still working, I don't see why not.
Thank you for taking the time to help!
After talking to you yesterday i tried to clean up my mods by removing the cache files and I redownloaded (if that makes sence) both CCloader and you mod icemunmun. I don't know what i did differently but it seemed to work after that. I only played for about 30 minutes though and then my game crashed. Am pretty sure it as nothing to do with any of these mods, I just have too much rubbish on my game and my computer can't handle it.
Anyway, if I have time today i'll try again and see if it's still working, I don't see why not.
Thank you for taking the time to help!
#23
9th May 2015 at 8:44 PM
Posts: 2,478
I just wanna say: thank you very very much. You keep on stretching the possibilities of what Ts3 can do.
Who needs official game patches when you can have this?
#BlairWitchPetition
TS3 NEEDS: TENNIS COURTS > BUSES > PIGS/SHEEP
Can't find stuff in build and buy mode? http://www.nexusmods.com/thesims3/mods/1/?
Who needs official game patches when you can have this?
#BlairWitchPetition
TS3 NEEDS: TENNIS COURTS > BUSES > PIGS/SHEEP
Can't find stuff in build and buy mode? http://www.nexusmods.com/thesims3/mods/1/?
Lab Assistant
#24
25th May 2015 at 7:37 AM
Posts: 94
First off, thank you for this awesome mod! I really appreciate it.
My problem is that I can't get the game to detect CCLoader at all. I've tried playing the game with a fresh Documents folder that had just CCLoader and some custom ingredients in, taking out all my mods except CCLoader and the custom ingredients, deleting caches and thumbnails, reinstalling CCLoader countless times... No dice. When I go to test it by entering the CCLoader cheat code, it just says "Unknown Command."
What am I doing wrong? I would really love to play with custom ingredients, but I just can't get it to work.
My problem is that I can't get the game to detect CCLoader at all. I've tried playing the game with a fresh Documents folder that had just CCLoader and some custom ingredients in, taking out all my mods except CCLoader and the custom ingredients, deleting caches and thumbnails, reinstalling CCLoader countless times... No dice. When I go to test it by entering the CCLoader cheat code, it just says "Unknown Command."
What am I doing wrong? I would really love to play with custom ingredients, but I just can't get it to work.
#25
2nd Jun 2015 at 1:31 AM
Quote: Originally posted by katiekatiekat
First off, thank you for this awesome mod! I really appreciate it. My problem is that I can't get the game to detect CCLoader at all. I've tried playing the game with a fresh Documents folder that had just CCLoader and some custom ingredients in, taking out all my mods except CCLoader and the custom ingredients, deleting caches and thumbnails, reinstalling CCLoader countless times... No dice. When I go to test it by entering the CCLoader cheat code, it just says "Unknown Command." What am I doing wrong? I would really love to play with custom ingredients, but I just can't get it to work. |
Did you patch your game? requires v1.67.
Who Posted
|