Replies: 70 (Who?), Viewed: 11333 times.
Page 2 of 3
Inventor
#26 Old 5th Feb 2015 at 5:38 PM Last edited by Arsil : 6th Feb 2015 at 12:12 PM.
The fact that you are curious and inquisitive is good, but you are making my life an hell :D
I wish someone explained all these things to me when I was getting started...
[Warning] SelfConfidenceMeter's value is raising dangerously, approaching prick level!
*takes a deep breath
[Warning] SelfConfidenceMeter's value is slowly dropping.
[Warning] SelfConfidenceMeter's value stabilized at default level.
Wow, that was close.

By the way, I make these stupid jokes as a diversion to hide the fact that deep down
I'm incompetent and probably I'm giving wrong/approximate answers. MTS has a
large repository of tutorials and technical info that can explain most of these things
way better than me (and with decent grammar/spelling and without abusing parenthesis!).

Quote:
Originally Posted by dawg
Everything seems to be working, I just don't have idea what these 2 highlighted strings do, as far as i remember we haven't done anything with them, they came with ccloader.

The one of type _KEY (also called NMAP, Name Map) is used to associate a human readable
name to a resource IID. In custom packages usually it's created and updated automatically by S3PE every
time you give a name to a resource (for example when you create a new one, like we did before) or you
change a name (double clicking on the resource). These names have no meaning for the game (probably
_KEY resources aren't even parsed, but I'm just speculating here), the game uses directly the RK (Resource
Key, aka TGI - Type+Group+Instance) to refer to a specific resource, they are only there to help developers
and users to understand what a resource is about (which toilet the texture is from, for example).
A mistake I did when I started modding was to think that the name of the resource was used as hashing
key to obtain the IID of the resource. While this may be true, it's not always the case, so when you change
the name of a resource never press the FNV64 button unless you know what you are doing.
_KEY resources somehow remind of NGMP resources and yet they are very different.

Resources of type S3SA (Sims 3 Signed Assembly) are simple wrappers for compiled programming code.
They contain libraries, .dll files. This one is generated by douglasveiga's tool and its purpose is to "link" the
xml resources in this package to the code of douglasveiga's mod that parse and load them into the game.
A coder may consider easy to write the code to do that, but it still requires some programming skills.

----------

Now it's time to clone an existing plant. If you recall we've chosen the "Apple Tree", who in turn uses
the "PlantLargeTree" Medator. PlantLargeTree is also the ModelName of the Medator, and, surprise
surprise, PlantLargeTree is also the name of the object to clone.
We are talking about a basegame plant, so we'll find it in FullBuild0.package
in TS3InstallationDirectory/GameData/Shared/Packages/.

Start S3OC and, if you haven't done this before, from the menu select Settings+GameFolders and set the
path where the basegame is installed. If you have set also the path for other EP/SP, untick their "enabled"
checkbox or we'll have to go through a crapload of objects when we search for the one we need.

We can search for it "manually"...

...or we can use, from the menu, Tools+Search.
Put "PlantLargeTree" in the "Search for text" input-field, tick "Resource Name" and press the "Search" button.

Once PlanLargeTree is selected, click on the "Clone or Fix..." button on the right/bottom part of the window.
In the "Options", make sure to tick "Deep Clone" and "Renumber/rename internally" and as "Unique name"
make sure you put something with your nickname in it, like dawg_CannabisPlant_blahblahblah to make an example,
blahblahblah being the random number suggested by the program to add.. well, randomness. Press the button "Start".
[it's not needed to change any settings of the object using the right side of the S3OC window, since they wont be used anyway]
The string you put in that (Unique name) field will also be the default name suggested to save the new package that S3OC will create, but if you want you can change that name.
If you want a tip, save the package as "dawg_CannabisPlant.package".

Are we done? Nope! Plants, Ingredients and Recipes (and maybe also other things I'm not aware of) have this
thing in common: in their xml definition, they refer to their mesh by name, but this name doesn't translates to an
Instance ID with the more common FNV64 hashing, but with another hashing algorithm (FNV24???).
To make this hashing we can use another software made by douglasveiga, a command line executable,
that can be downloaded HERE. It's the same we used before, I'm just putting the link again.

We have already used this earlier, but since we changed some names, we have to do it again.
So, the mesh of our plant is specified in the ModelName tag of the Medator.
Code:
<MedatorInstanceList>
  <MedatorName>dawg_CannabisPlant_MedatorName</MedatorName>
  <PlantHeight>High</PlantHeight>
  <ModelName>dawg_CannabisPlant_ModelName</ModelName>
</MedatorInstanceList>

So we have to hash that string with the specific tool and get the TGI (double check if you get the same value):
0x01661233-0x00000001-0x0000000000FD99B9
We are only interested in the Instance ID : 0x0000000000FD99B9

What we have to do now is change the IID of the mesh of the plant, in other words the IID of the
MODL and MLOD resources of our object, that were randomly generated by S3OC, with the IID
obtained with the correct hashing algorithm.

First thing to do is to open the package just created by S3OC with S3PE to copy in the clipboard
the random IID that S3OC assigned to the MODL resource. Then we close the file (no need to
close S3PE, just close the opened file, our .package).

I'm old school (or maybe simply fool) and I do this "manually", but I don't recommend that
(and I'm not even sure if the way I do that is completely right, even if it seems to work).

So with S3OC we open the package we've just created (to be clear, the one that S3OC itself
just created), we make sure that our object is selected and, from the menu, use Tools+ReplaceResourceKey.

In the "Search for ResourceKey" column, untick the "Any" checkbox of the Instance and fill the Instance
inputbox with the IID we just copied with S3PE.

In the "Replace with ResourceKey", untick only the Keep checkbox of the Instance and fill that field with
the IID obtained with douglasveiga's tool.

Click the button "Replace" in the bottom of the window. A list of the temporary changes made is displayed,
click on "Save" to make them permanent. The package get saved automatically after that. Close the file.

See post#30 for an important update on the replacing process!

Warning: using this method even the IID of other resources may be replaced, but that should not be a problem.

WARNING: this is optional and must be done carefully!
Now if you want you can open this package with S3PE. If you want you can replace (double click on a resource)
the resources' names that S3OC copied from the original object and put a more intuitive name: but when you
change the name, ticking "Rename if present", remember to NOT PRESS THE FNV64 BUTTON or you'll
change also the Instance ID of that resource and we want to change only it's associated name.
For example, you can change the name "PlantLargeTree" to "CannabisPlant" (the name you choose doesn't
have to match any of the names we used so far).
You may be able to notice that the name is not associated with the single resource but with the Instance of
the resource, so if other resources use the same IID (MODL and MLOD sure do) you'll change the name
of more than one resource.
This is not a mandatory step though.

A good thing to do is this: open the package with S3PE (if you didn't already), select all STBL and delete them.
Why? These were created by S3OC to translate the catalogue name and description of the object, but since
plants aren't showed in the Buy/Build catalog, these are useless. Name and description of the plant are
defined in the xml if you remember.

Note: Now we have two .package files. The first one we've worked on (the one with the _XMLs, STBLs, etc)
and this one for the cloned plant. My advice is to keep them separated, at least for now. I'd say to merge
all the packages (there will be a third and last one) only at the end, so in the meantime we can work on
them separately, keeping their resources apart. Maybe this is only a matter of tastes, but I find that
it's more comfortable to handle them in this way.

Oh my, I'm exhausted. It took me hours to write and revise this.
I'm saying this matter of factly, not for complaining.
And if this seemed hard/complicated, wait for the ingredient...

Send my a smoke signal if it's all right.
Test Subject
Original Poster
#27 Old 5th Feb 2015 at 7:24 PM
It's all right, you are right it gets complicated, but that doesn't mean we give up, right? I haven't done the optional step, because I don't want to screw something up.

Quote:
First thing to do is to open the package just created by S3OC with S3PE to copy in the clipboard
the random IID that S3OC assigned to the MODL resource. Then we close the file (no need to
close S3PE, just close the opened file, our .package).


I had trouble understanding this, but i merged this with IID obtained with douglasveiga's tool and it seems OK. (the screenshot is taken after all work has been done, I'm just showing how I obtained the IID)
Inventor
#28 Old 5th Feb 2015 at 8:19 PM Last edited by Arsil : 5th Feb 2015 at 11:12 PM.
The IID of MODL and MLOD should be 0x0000000000FD99B9 at the end of the process.

These are the steps:
- cloning the plant with S3OC, close the file (menu File+Close)
- open the brand new package with S3PE and copy the IID of the MODL, close the file (menu File+Close)
- open the package with S3OC and use the replacement feature, close the file (menu File+Close)

See post#30 for an important update on the replacing process!
Test Subject
Original Poster
#29 Old 5th Feb 2015 at 10:35 PM Last edited by dawg : 5th Feb 2015 at 11:13 PM.
Well, I've tried to figure it out but I can only make the MODL and MLOD have the same random number, I can't get the 0x0000000000FD99B9. I don't know what am I doing wrong, but if this has to be just like you wrote then I guess I need some kind of "guide for dummies"... Oh boy.
Inventor
#30 Old 5th Feb 2015 at 10:58 PM Last edited by Arsil : 7th Feb 2015 at 11:51 AM.
Nope. It turns out I involuntarily gave you only partial directions. Sorry, I had no idea it worked that way,
and probably that's why in the past I did the replacement manually, because I though that S3OC didn't worked.

Apparently the replacement feature of S3OC only changed the "internal" occurrences of the Instance ID
(used by a resource to refer to the TGI of another resource) and left the "external" occurrences intact
(the ones visible in the S3PE list of resources). So we have to change those manually. No big deal,
we can do that easily enough with S3PE.

We have to change the IID of every resource that has the same IID of the MODL, that looking at your
screenshot is 0xCBF4CA0E... I may have mistaken that "0" (zero) with a "O" (o).
Again, judging by your screenshot the resources interested are 3: MODL, MLOD and VPXY.
So, double click (left button of the mouse) on the first and edit directly the Instance putting
there the IID obtained with douglasveiga hashing tool (0x0000000000FD99B9) and do
the same thing with the other 2 resources.

EDIT: ehm...
Quote:
Originally Posted by Arsil
I may have mistaken that "0" (zero) with a "O" (o)
Sure, because "o" is legit in a hex number...

-----------------------------------------------------------------

EDIT: I'm going to edit this post because this is the best moment to do this.

NGMP UPDATING

We're done with the plant for now. But let's open its package with S3PE to copy into the clipboard the IID (Instance IDentifier) of the OBJD resource.

Now let's open with S3PE our "main" package, the one we used at the start,
the one with the xml definition.

Select the NGMP (a simple left click of the mouse in its line), then click
on the "Grid" button on the center-bottom of the window. A new window opens.

Let's click on the plus ("+") signs (two times in total, until there's no more plus
signs to click) and let's paste the IID we just copied into the Instance field.
Click "Commit", save and close the package.
Test Subject
Original Poster
#31 Old 5th Feb 2015 at 11:17 PM
OK, I've edited it manually. I was so ashamed that I had everything good 'til now, but I'm glad we figured that out.
Inventor
#32 Old 6th Feb 2015 at 4:34 PM
Well well well, it's time for the dreaded ingredient. There are both good news and bad news.

The good news is that the ingredient we want to clone (what was it? Oh, yes, KonaBean)
has its own OBJD (and OBJK, this will be implicit from now on). This is odd (at least to me)
because ingredients DON'T have their own OBJD and this makes them a bit harder to clone,
but uncle Arsil will see to that too.


The bad news is we want to clone an ingredient that comes from an EP. This complicates things.

[hours pass by...]

Well. I'm an idiot. There's no such OBJD for the KonaBean.
I'm like a cat: I saw something moving, got distracted and then confused a thing for another.

So we only have bad news.

Nah, that's not true. In the last days/hours I refined the technique I was using to clone ingredients
and this can be used also for recipes (I mean for cloning the meshes of foodEat, foodServe, etc)
and allows to retrieve all the related resources without searching for them manually. I'm not implying
that no one ever used or though about this method, that would indeed surprise me.

Let's start with a little bit of theory, shall we?

I'm going to simplify things a lot, for space/time reasons and because I don't know every detail.
There are some objects like those CAS related (clothes, etc), some Build items (like walls) and
others that probably don't fit well in what I'm going to say.

What is the most important resource for an object? The OBJD resource.
Why? Because this resource is connected with all other resources related to that object.
The OBJD refers to the OBJK, which in turn refers to the VPXY, which in turn refers to:
meshes (MODL and MLODs), _RIG. FTPT, etc, etc.

Ever paid attention to the fact that using S3OC you mostly get a list of OBJDs? Because the main feature
of that tool is to clone and starting from the OBJD it can retrieve all resources related to a particular object.

What does this have to do with ingredients? Specific ingredients don't have their own OBJD (and OBJK).

By the way, why do we need to clone one in the first place? To renumber the TGI of the resources,
otherwise we'll create resources that override the ones we are "copying", creating a so called
"default replacement".

So, how can we clone objects that don't have an OBJD? We create a dummy one!

We create an "empty" OBJD with S3PE (Resource+Add), we create an "empty" OBJK,
we connect the OBJD to the OBJK. And now we have to connect the OBJK to the
VPXY of the ingredient that we want to clone (I repeat, this works also with "recipes").

I've already prepared a .package with the dummy OBJD and OBJK (already connected),
so all there's is to do is:
- retrieve the TGI of the VPXY we are interested in (we'll see in a minute how)
- connect our dummy OBJK to the VPXY. How? With S3PE:
- open the DummyOBJD_ForCloningPurposes.package
- right click on the OBJK + Edit OBJK
- (new window opens) press "TGI blocks..." button
- (new window opens) press "Add" button
- press "Paste TGI" button [assuming we have copied it in the system clipboard]
- press "Save" button (window closes)
- in the "Model" line, select the right AssetResourceName using the dropdown menu (there's only an entry in the list, you can't go wrong)
- press "Save" button (window closes)
- press "Yes" button in the "Commit changes" dialog
- save the package

Now we can clone the OBJD in our DummyOBJD_ForCloningPurposes.package with S3OC,
making sure we defined the game folders (also of the EP the ingredient comes from) using,
from menu, Settings+GameFolders.



Worry not, in the next post I'll recap and make an example.
We will also see how to handle the difficulties that come cloning an ingredient from an EP.
Download - please read all instructions before downloading any files!
File Type: zip DummyOBJD_ForCloningPurposes.package.zip (328 Bytes, 47 downloads) - View custom content
Inventor
#33 Old 6th Feb 2015 at 4:51 PM Last edited by Arsil : 7th Feb 2015 at 10:38 AM.
We want to clone the KonaBean ingredient. Let's take a look at its tags,
as defined in the Ingredients _XML resource in GameplayData.package.
Code:
<Data>
  <Ingredient_Key>KonaBean</Ingredient_Key>
[CUT]
  <DataVersion>EP9</DataVersion>
[CUT]
  <Model_Name>coffeeBeanKona</Model_Name>
 [CUT]
 </Data>


Where can we find it? <DataVersion>EP9</DataVersion>
This ingredient comes with the University Life EP.
So its resources will be in
[whatever]/[TS3UL localized name]/GameData/Shared/Packages/FullBuild_p18.package
Note: even if an object comes with an EP, it may use also basegame resources.

We know that ingredients don't have an OBJD, so there's no point in using S3OC at this point.
What we have to do is to find its VPXY resource.

*** Attempt #1 ***

So first thing I try is to do a search based on the Ingredient_Key, "KonaBean",
the internal name of the ingredient

Let's start S3PE, set as name filter "KonaBean", activate the filtering and open
FullBuild_p18.package. We find 2 resources but they are not what we are looking for
(they are related to the auto soil version of the kona bean plant, maybe we'll cover that too later).

EDIT: probably this attempt is always doomed to fail, but I wanted to be honest:
that's the first thing I'd do (but being very careful to not mistake what we find with
the real deal).

*** Attempt #2.a ***

I'd try a new search, this time using the Model_Name: "coffeeBeanKona".
Bingo! And hey, there are OBJD and OBJK too! Arsil, you sonovallama!!!
Yep, for some reasons all beans of EP9 actually have OBJD and OBJK,
seems like I was right after all at the start of the previous post...

Does this mean that all I said was BS? Nope, this seems to be an exception
to the rule. So in this case we can clone the object directly, without middle steps.

Wait! How do we know this is the right one? From the OBJK we can see the TGI
of the VPXY (IID 0x0000000088D69986), using that Instance as filter we'll get
VPXY and meshes, and using the "MODL/MLOD Preview" feature of S3PE (right clicking on the MODL) we can confirm that it is indeed the kona bean.

EDIT: actually, the real proof that it is the right ingredient is to verify that
the MODL has the same IID that we get using douglasveiga's hashing tool
to hash the string "coffeeBeanKona" and adapting the result keeping in
mind that it's an EP item with that EP "hex code" in the GroupId and IID.
The IID in that case would be:
0x0000000000D69986 (vanilla result obtained)
0x0000000088D69986 (adapted result with UL "hex code")

NOTE to dawg: you can skip the next 2 Attempts if you are not interested,
but I'm going to handle the more common situation (no OBJD).

*** Attempt #2.b ***

Let's say that using the Model_Name (in string format) of our ingredient as name filter
for our search we find (and verify that is the right one) the resources of the ingredient:
at least the VPXY and the MODL (there may be or may be not MLODs).

We right click on the VPXY and from the popup menu select "Copy ResourceKey".

*** Attempt #3 ***

Let's say that the previous search didn't worked, because not all resources have a
human readable name. What we have to do now is search using as filter an Instance ID.
So we use douglasveiga's (DV from now on) hashing tool to traslate the Model_Name into an IID.

EDIT: this is probably the best method, but if I didn't try searching for the Model_Name in
string/textual format I would have never found out that the KonaBean actually has an OBJD.

  • Example A
    Let's say that we are searching for the apple ingredient VPXY (let's presume it doesn't
    have a human readable name, even if actually it does). Let's keep in mind that the
    apple is a basegame ingredient. The apple Model_Name is "apple".
    If we hash the string "apple" we get 0x01661233-0x00000001-0x0000000000010653
    Let's focus on the IID: 0x0000000000010653
    If we open FullBuild0.package (that's were VPXY/MODL resources are for basegame stuff)
    and search using that IID as filter we'll find the VPXY and MODL of the apple (no OBJD this time).

    We right click on the VPXY and from the popup menu select "Copy ResourceKey".

  • Example B
    Let's say that we are searching for the ghost chily ingredient VPXY: this dude doesn't have
    a human readable name, for real, no kidding! Let's keep in mind that this is NOT a basegame
    ingredient, it comes with Supernatural (EP7), you can verify that in the Ingredients _XML.
    Its Model_Name is "ghostChili" (the string to hash is case insensitive, by the way).
    If we hash the string "ghostChili" we get 0x01661233-0x00000001-0x00000000009884E0
    I don't have Supernaturals, but I tested this with inu300988. If we use the IID, 0x00000000009884E0,
    as is, we'll find nothing in FullBuild_THAT_EP.package.
    Why? Because we're talking about an ingredient that comes with an EP, so we have
    to adapt the IID we got with DV hashing tool. How? We have to replace the 9th and 10th
    hex digit of the ID with the "hex-code" used by that EP. The hex-code to use is the same used
    in the first 2 hex digits of the GroupID by most of the resource that come from a certain EP,
    in the Supernatural example the code is 70.
    So the complete TGI of the ghostChili will be 0x01661233-0x70000001-0x00000000709884E0
    If we use the IID as Instance Filter for the search will find VPXY and MODL of the ghost chili ingredient.

    We right click on the VPXY and from the popup menu select "Copy ResourceKey".

I have to take a break.
Inventor
#34 Old 6th Feb 2015 at 7:14 PM Last edited by Arsil : 6th Feb 2015 at 9:33 PM.
GENERIC DIRECTIONS
Note to dawg: You can skip this if you are not interested. Continue reading from "COMMON/SHARED DIRECTIONS".

Now we have the TGI of the VPXY in the clipboard.

With S3P3, we open DummyOBJD_ForCloningPurposes.package (I've uploaded it zipped in post#32), and
- right click on the OBJK and from the popup menu we select "Edit OBJK":
- (new window opens) press the "TGI blocks..." button
- (new window opens) press "Add" button
- press "Paste TGI" button
- press "Save" button (window closes)
- in the "Model" line, select the right AssetResourceName using the dropdown menu (there's only an entry in the list, you can't go wrong)
- press "Save" button (window closes)
- press "Yes" button in the "Commit changes" dialog
- save the package, close the package

Note: these steps presume you haven't used the Dummy*.package before,
otherwise you'll already find an entry for the VPXY in the OBJK. In that case
you have to edit the existing one instead of using "Add".

COMMON/SHARED DIRECTIONS:

Start S3OC. With Menu: Settings+GameFolders let's make sure that we have set correctly the
installation directories for the basegame (but this should be obvious) and also for the EP
(University Life, for dawg) our ingredient comes from and that the relative "Enabled" checkbox is ticked.

(for dawg)
You can clone directly the real OBJD of the ingredient, you don't need the dummy one
Start S3OC, from the menu, use the Tools+Search feature, put "coffeeBeanKona"
in the "Search for text" input-field, tick "Resource Name" and press the "Search" button.
Select the only result found and click on "Clone or Fix..." button.

(generic)
Open DummyOBJD_ForCloningPurposes.package with S3OC.
Select the only OBJD you'll see on the list click on "Clone or Fix..." button.

Now we are in the "Clone view" of S3OC with the Options.
Make sure to tick the following (some checkbox may not be enabled/tickable, leave them the way they are):
- Create clone package and Deep clone
- Find missing resources
- Renumber/Rename internally
- In the Unique name, use a meaningful name, leaving the random number added automatically by S3OC,
I suggest something like nickname_Ingredient<NameOfIngredient>_randomNumber.
- choose where to save the package (put it together with the other two packages of our custom plant) and,
if you want, change its name (don't use an ambiguous name, we must be able to distinguish easily the
package of the plant from the package of the ingredient from the "main" package (the first one we used,
with all the xml definitions).

Note: during the cloning, you may get some warnings about missing resources (you have to
press the "Ok" button to move on). It's all right, S3OC is doing is job, the thing is that some
objects (like ingredients) sometimes simply don't have TXTCs or MLODs.

Good. The package has been cloned. The IID of the resources have been renumbered randomly.

Open the package just created with S3PE and delete all STBLs resources.
They aren't used (the hashing key for the name of the ingredient was set in its xml definition
and we already created the STBLs for its localization). Save the package. Close the package
(I'm stressing about closing the package because we don't want the file open in S3PE while
we modify the same file with S3OC, that could be a bad thing.).

Are we there yet? Nope.
Inventor
#35 Old 6th Feb 2015 at 9:32 PM Last edited by Arsil : 21st Jun 2015 at 9:55 AM.
README

This post is only about handling the GroupID in case we cloned an ingredient that comes
with an EP (so dawg, you have to do this). ATTENTION: this method can be applied also
if we clone a plant that comes with an EP. And also for "recipes".

Of course we want our custom ingredient to be basegame compatible (if we are going
to change its mesh/textures, otherwise may be considered illegal to redistribute it!)

So if we cloned an ingredient that comes with an EP, we have to change the GroupID
of all resources removing the "hex code" of the EP. Actually we only have to change the
GroupID of the meshes (MODL and, if present, MLODs). I don't think the VPXY is
necessary, but it's not a bad idea to include that too.
EDIT: yep, the VPXY is necessary!
Anyway, since we are going to use S3OC for replacing the GroupID, there's the chance (we'll see exactly when this happens)
that it wont make any distinctions and replacing the GroupID of all resources (unless in
the replacing filter we also indicate the typeId of the resources of which we want to replace
the GroupID, solution that I suggest to expert users).

Why change the GroupID?
If we don't change the GroupID, we are forced to use the tags CodeVersion and/or
DataVersion in the xml definition of the ingredient (or plant or "recipe") in order to
allow to the game engine to translate correctly the model_name of the ingredient
into the TGI of its MODL. Why is that bad? Because we could use our custom
plant/ingredient/recipe only if we have that EP installed, and that would be a
preposterous requirement. Preposterous I say!

Note for expert users: the replacement of the GroupId we are going to do here
can be combined with the replacement that we will perform in the next post,
so maybe you want to wait before doing this (only to save time and not repeat
two times the "same" thing, no other reason).

So, let's open the package with S3OC, make sure to select our OBJD and
from the menu, use Tools+ReplaceResourceKey.

ATTENTION PLEASE: this "first" replacement may be unnecessary,
do it only if in your package there is a MLOD with GroupID 0x##000000, where ##
is the hex code of the EP (check with S3PE if you have such GroupId for a MLOD).
WARNING: dawg, you don't need to do this! Skip it.

In the "Search for ResourceKey" column, untick the "Any" checkbox of the Group and
fill the Group inputbox with the GroupID relative to the EP (0x88000000 for University Life, dawg).

In the "Replace with ResourceKey", untick only the "Keep" checkbox of the Group and fill that field
with "0x00000000", which is the GroupID of basegame resources.

Click the button "Replace" in the bottom of the window. A list of the temporary changes made is displayed,
click on "Save" to make them permanent. The package get saved automatically after that.

The MODL resource has a particular GroupID: its last hex digit (the 8th) is 1 instead of 0.
something like 0x##000001, where ## is the code of the EP.
If there are MLODs, they may have a particular GroupID too:
- 0x##010000
- 0x##010001
So we have to repeat (or do for the first time) the replacing using as
"Search for ResourceKey"/Group the correct GroupID and same thing
for the "Replace with ResourceKey"/Group (without the EP "hex code").

Specific directions for dawg

You didn't need that first replacement, so this will be your first one.

In your package there is a MODL (GroupID 0x88000001) and a MLOD (GroupId 0x88010000)
So do the replacing using:
- in the left as Group "0x88000001" and untick the relative checkbox
- in the right as Group "0x00000001" and untick the relative checkbox
- click Replace, click Save

Repeat the replacing using:
- in the left as Group "0x88010000", in the right as Group "0x00010000", click Replace, click Save

If you remember, the replacing done by S3OC only changes the "internal" occurrences of the TGI
(well, only of the GroupId) of the resources. To change the "external" occurrences (the ones you
see in the S3PE list) we have do it manually with S3PE. But first, as always, make sure that
our package in no longer open in S3OC (menu, File+Close).

So, let's open the package with S3PE.
If we did the "first" replacement, the one "optional", we'll have to update the GroupId of every
single resources (all those whose GroupId isn't already 0x00000000, there might be some).

So double click on each resource (starting from the top of the list) and, carefully,
replace the Group from 0x880?000? to 0x000?000?.
Ok, maybe this notation is not easy to understand.
Basically we have to repeat manually every substitution we did automatically with S3OC.

Specific directions for dawg

In your package there is a MODL (GroupID 0x88000001) and a MLOD (GroupId 0x88010000)
Double click on the MODL and change the Group's value from "0x88000001" to "0x00000001", click OK
Double click on the MLOD and change the Group's value from "0x88010000" to "0x00010000", click OK

Save the package.
Inventor
#36 Old 6th Feb 2015 at 10:38 PM Last edited by Arsil : 7th Feb 2015 at 11:25 AM.
Now we have to do what we did with the plant.

Change the IID of the meshes to make it match with the Model_Name
of our custom ingredient hashed with douglasveiga's tool (without any
adjustment this time, because our ingredient is basegame-compatible).

As defined in the xml of our ingredient, the Model_Name used is our example is
dawg_CannabisIngredient_ModelName

Let's use the hashing tool and we get (double check, typos are always ready
to ambush me): 0x0000000000F61F32 (we only care about the IID of the TGI)

Let's open our package (the one with the cloned ingredient, just to be crystal clear) with S3PE and let's copy in the clipboard the IID of the MODL (I can't tell you what it is because it was
randomly generated). Close the package (menu File+Close)!

So, let's open our package with S3OC and let's make the replacement.
Make sure the OBJD is selected and, from the menu, use Tools+ReplaceResourceKey.

In the "Search for ResourceKey" column, untick the "Any" checkbox of the Instance and paste
in the Instance inputbox the IID we just copied with S3PE.

In the "Replace with ResourceKey", untick only the Keep checkbox of the Instance and fill that field with
the IID obtained with douglasveiga's tool: in dawg case, 0x0000000000F61F32.

Click the button "Replace" in the bottom of the window. A list of the temporary changes made is displayed,
click on "Save" to make them permanent. The package get saved automatically after that. Close the file.

Let's open the package with S3PE to make the manual replacement:

We have to change the IID of every resource that has the same IID of the MODL and the MLOD
(allegedly only the VPXY, but if there are more is not a problem, let's change those too because S3OC certainly did it, unless we used a more restrictive filter).

So, double click (left button of the mouse) on these resources and edit directly the Instance putting
there the IID obtained with douglasveiga hashing tool (0x0000000000F61F32 for dawg).

Save the package.
Test Subject
Original Poster
#37 Old 6th Feb 2015 at 11:02 PM
OK, thank you for the straight forward directions for me, It makes me I don't know, more confident? It helps me understand what I really have to do and it makes me glad that everything is on its place.

Quote:
Specific directions for dawg

In your package there is a MODL (GroupID 0x88000001) and a MLOD (GroupId 0x88010000)
Double click on the MODL and change the Group's value from "0x88000001" to "0x00000001", click OK
Double click on the MLOD and change the Group's value from "0x88010000" to "0x00010000", click OK


Well I also changed the OBJD, OBJK, _IMG... etc; everything that had 88 in front of ID. I know you said "every, single resource", but as I've said, I like to have straight directions.

One little thing that bothers me is, when in attempt #2.a we searched for the Model_Name: "coffeeBeanKona" I couldn't find the VPXY resource. I don't know if I should worry.
Inventor
#38 Old 7th Feb 2015 at 10:46 AM
Quote:
Originally Posted by dawg
Well I also changed the OBJD, OBJK, _IMG... etc; everything that had 88 in front of ID. I know you said "every, single resource", but as I've said, I like to have straight directions.

The important thing is that you do the replacement with both S3OC (the automatic one)
and with S3PE (the manual one).

Quote:
One little thing that bothers me is, when in attempt #2.a we searched for the Model_Name: "coffeeBeanKona" I couldn't find the VPXY resource. I don't know if I should worry.

It's ok. With that search we find the OBJD and OBJK, from the OBJK we can get the IID of the VPXY
(and the MODL and the MLOD), which, by the way, is one of those resources without a human readable name.

Just checking: you cloned the right OBJD, right? You don't need to use the dummy one.

If I forget, you'll have to remind me that we still have to edit the NGMP.
We should have done that as soon as we cloned the plant.

If everything is clear, please wait to reply further until I edit post#36 (I hope the numeration
doesn't get screwed up if someone decides to delete one of their posts).
Inventor
#39 Old 7th Feb 2015 at 11:28 AM Last edited by Arsil : 7th Feb 2015 at 11:48 AM.
[Sorry for double posting]

I edited post#36. Tell me if everything is clear and went smoothly.

Please post a screenshot showing S3PE with the package open
and the TGI of the resources well visible/readable.
EDIT: make sure that in the screenshot the MODL is the selected resource
and use the "Preview" view of S3PE (as opposed as the "Hex" view you used
in the other screenshot) using the radio buttons in the bottom of the window.

Do you have NRaas DebugEnabler or MasterController?
They are not required, if you don't have/use them there's no need to get them.
Test Subject
Original Poster
#40 Old 8th Feb 2015 at 10:28 AM Last edited by dawg : 9th Feb 2015 at 7:56 PM.
EDIT: Sorry for the absence, I'm back again and everything went smooth and clear. Here's the current ingredient package.
I have NRaas MasterController.

Inventor
#41 Old 8th Feb 2015 at 11:04 AM
Take your time. I've updated a previous message, post#30, with directions on how to edit the NGMP
(warning: I hope I've explained this clearly even in that post, but those directions have nothing to do
with the package we have worked on in these last posts, they are about the package with our custom
plant and the first package we used, the one with the xml definitions).
Test Subject
Original Poster
#42 Old 11th Feb 2015 at 12:38 AM
I have some bad news for our project; im going to Asia for 2 weeks and we have to halt our work. I'm looking forward to continue it when I'll come back. Hope you get some rest too . Anyways, I'll send you a PM to remind you when I'm back.
Inventor
#43 Old 11th Feb 2015 at 11:55 AM Last edited by Arsil : 12th Feb 2015 at 9:19 AM.
Ok. By the way, we're pretty much done, of course excluding all the meshing work.

Keep in mind that dozens of things could have gone wrong, so if you try this and
it doesn't work the first time don't be discouraged and re-check all steps (be aware
that I could have missed something or made a few typos here and there).

If someone notices flaws in the procedure or steps that could be accomplished more
easily (from a beginner point of view), please don't hesitate to point that out.

A few tips for testing:
- go shopping in a grocery store type rabbit hole, see if there's a new ingredient (or an ingredient with no name if the localization went wrong)
- plant the ingredient (it works also as a seed) and make the plant grow (with NRaas Debug Enabler you can instantly pass to the next growing stage)
- test if harvesting works
- see if seed spawners (Rarity of the plant determines which ones) spawn the custom seed (if everything else works, this should be the case, but it's a boring/long task: put a crapload of spawners in a small area)

You can also make an auto soil version of the custom plant. This requires coding, I'm not sure
if that can be automatized too (maybe instead of hard-coding the name of the ingredient, the
name can be picked from an _XML resource)
and I don't think it can be automatized.
See the thread about douglasveiga's CCLoader linked in post#2.
WARNING: maybe this is only my experience and may be caused by a conflict with another mod,
but if you put an auto soil plant in a residential lot then shit happens.
EDIT: I got it. Some time ago I've ITUNed some gardening interactions so they are executed
autonomously, the routing fails happen because auto soil plants don't need tending/maintenance.

Hope you (dawg especially but also a generic you) enjoyed this kind of guide. This brief guide :P
If someone (expecially one with no or little modding experience) can confirm that following these instructions you can actually do a custom plant+ingredient, that would be nice.

SUMMARY

MAIN PACKAGE
- create the script to load the xml data OR use douglasveiga's tool that automatizes that
- create a first package with the script and the xml resources needed
- choose an existing plant and ingredient to copy/clone. Choose wisely: the one that more resemble what you want to do, so the meshing work is reduced (unless you want to create the mesh from scratch). If possibile, choose a basegame plant/ingredient to reduce/simplify the work needed (but we've seen how to handle that)
- compile the xml definitions of plant and ingredient in their respective _XML resources
- Create STBLs resources to localize plant, seed and ingredient, keys prefix:
--- Gameplay/Excel/Plants/PlantList: (for both plant name and seed name)
--- Gameplay/Excel/Ingredients/Data: (ingredient name)

PLANT PACKAGE
- Clone (with renumbering!) similar plant (ignore pop-up messages about missing resources). This will create a new package, keep it separated from the main one. STBL resources can be deleted since the object is not buyable, so they are not used.
- Use FNV24 hashing (douglasveiga's hashing tool) to hash the medatorName of the plant into the IID to assign to meshes
- S3OC+S3PE IID replacing for meshe's resources
- create NGMP: medator name FNV64 hash --> plant's OBJD IID (OBJD, not MODL!). You can put the NGMP resource in this package or in the main one, it doesn't really matters.

INGREDIENT PACKAGE
- find TGI of the VPXY of the ingredient you want to clone, edit the dummy OBJK to "point" to that TGI, clone (with renumbering) the dummy OBJD into a new package (ignore pop-up messages about missing resources). STBL resources can be deleted since the object is not buyable, so they are not used. OBJD and OBJK now could be deleted theoretically, but then you wont be able to edit the object with TSRW or other tools.
- We don't need the DummyOBJD package, don't even keep it in the mods' folder!
- Use FNV24 hashing (douglasveiga's hashing tool) to hash the IngredientName of the ingredient into the IID to assign to meshes
- S3OC+S3PE IID replacing for mesh's resources

TESTING
- Time to check it in game! If everthing works correcly (buy the ingredient at the store, plant it and wait for it to grow or use NRaas Debug Enabler to make it grow till it's harvestable), all you have to do is meshing.

MESHING
...
Note: It is (or may be considered) illegal to re-distribute a Store/EP/SP plant/ingredient as basegame (i.d. cloning without re-meshing and changing the textures).

AUTO SOIL VERSION OF THE PLANT (OPTIONAL)
...

FINAL STEPS
Put all 3 packages together (import all resource into the main one or into a new one). I suggest to keep the 3 packages separated so if you have to modify one of them further it's easier and less messy (personal opinion).
Icy Spicy
#44 Old 27th Feb 2015 at 6:22 PM Last edited by icemunmun : 27th Feb 2015 at 6:48 PM.
Can you help me out a bit?I am stuck so badly

I followed the instructions for creating a custom plant.

Code:
<!-- Place your PlantList tunings below this line -->
	 <PlantList>
  <PlantName>mun_yellowApple</PlantName>
  <LocalizationKeyPlantName>mun_yellowApple_Tree</LocalizationKeyPlantName>
  <LocalizationKeySeedName>mun_yellowApple_Seed</LocalizationKeySeedName>
  <LocalizationKeyDescription>mun_yellowApple_Description</LocalizationKeyDescription>
  <Rarity>Common</Rarity>
  <SkillPointsPlant>175</SkillPointsPlant>
  <SkillPointsHarvest>125</SkillPointsHarvest>
  <PerfThresholdAvgToGood>95</PerfThresholdAvgToGood>
  <PerfThresholdGoodToGreat>105</PerfThresholdGoodToGreat>
  <PerfBonusDrySoil>-30</PerfBonusDrySoil>
  <PerfBonusNeutralSoil>45</PerfBonusNeutralSoil>
  <PerfBonusWetSoil>90</PerfBonusWetSoil>
  <WaterDecay>2</WaterDecay>
  <WeedProblem>0.1</WeedProblem>
  <HarvestStateDurationMin>3</HarvestStateDurationMin>
  <HarvestStateDurationMax>8</HarvestStateDurationMax>
  <NumLifetimeHarvestables>40</NumLifetimeHarvestables>
  <NumHarvestablesMin>3</NumHarvestablesMin>
  <NumHarvestablesMax>5</NumHarvestablesMax>
  <MedatorName>PlantLargeTree</MedatorName>
 </PlantList>


<!-- Place your MedatorInstanceList tunings below this line -->
	 <MedatorInstanceList>
  <MedatorName>mun_yellowApple_MedatorName</MedatorName>
  <PlantHeight>High</PlantHeight>
  <ModelName>mun_yellowApple_ModelName</ModelName>
 </MedatorInstanceList>


I also edited the ingredient part:

Code:
<!-- Place your Data tunings below this line -->
	 <Data>
	  <Ingredient_Key>mun_yellowApple</Ingredient_Key>
	  <Ingredient_Name>mun_yellowApple</Ingredient_Name>
	  <Rarity>Common</Rarity>
	  <UiTab>Produce</UiTab>
	  <Parent>Fruit</Parent>
	  <Model_Name>mun_yellowApple#foodWhole</Model_Name>
	  <Thumbnail_Model_Name>mun_yellowApple#foodWhole</Thumbnail_Model_Name>
	  <Plant_Name>mun_yellowApple</Plant_Name>
	  <Fertilizer_Value>5</Fertilizer_Value>
	  <Fertilizer_Days>4</Fertilizer_Days>
	  <Nectar_Value>3</Nectar_Value>
	  <DrinkQuality_Min>0.005</DrinkQuality_Min>
	  <DrinkQuality_Max>0.05</DrinkQuality_Max>
	  <AncientNectarWeight>2</AncientNectarWeight>
	  <Price>4</Price>
	  <CanBuyFromStore>True</CanBuyFromStore>
	  <PetSpeciesThatCanEatOffGround>AllDogs,Horses,AB</PetSpeciesThatCanEatOffGround>
	  <IsMushrooms>False</IsMushrooms>
	  <SpawnAtNightOnly>False</SpawnAtNightOnly>
	  <IsEdible>True</IsEdible>
	 </Data>


I downloaded the dummy OBJD.But I cannot find an apple ingredient to clone using S3OC .How do I proceed with the ingredient?I followed the steps you mentioned about the dummy objd and TGI blocks.

(I think I should mention that I have no knowledge about programming languages.I come from a totally different field.But I a willing to try to learn )

Edit:Another question: Where do I find the store ingredients and recipes?
Inventor
#45 Old 27th Feb 2015 at 8:49 PM
In the plant definition, you used as medator an existing one:
<MedatorName>PlantLargeTree</MedatorName>
+
But then you defined your own custom medator. If you want to use the
custom one change the tag in the plant definition or it will not be used
(but do that only if you want to re-mesh/re-color the plant too, otherwise
there's no point in using a custom medator).

For the apple you have to search "apple"*** with S3PE in FullBuild0.package.
This way you'll find the VPXY of the apple ingredient: right click on it and select "Copy Resource Key".
+
Now open the dummyOBJD_dontRememberHowIsCalled.package, right click on the OBJK
resource and select edit OBJK. A new window open. Click on the button "TGI Blocks..."
on the bottom/left corner. A new window open. Now click on "Paste RK" (this way the OBJK
will "point" to the VPXY of the apple. Save and close the package.
+
Open the dummyOBJ_blahblahblah with S3OC and clone the apple from there.

Read the guide again, more carefully. I think these steps were explained clearly.

*** this is a shortcut that only works in this and a few other cases, the correct way to find it
is to hash the Model_Name of the ingredient with the FNV24 system (using douglasveiga's tool)
to get the IID of the model/VPXY and make a search using that as a filter.

### Where do I find the store ingredients and recipes?

If you mean the resources they are in their relative Sims3Pack or .package (if you converted them).

Right now I don't remember and I can't check if there's a single xml that lists them all or if they are
defined separately, if I'm not wrong they use, instead of the recipeMasterList, something else with
the word "store" in it.
Icy Spicy
#46 Old 27th Feb 2015 at 9:53 PM Last edited by icemunmun : 27th Feb 2015 at 10:10 PM.
Quote:
For the apple you have to search "apple"*** with S3PE in FullBuild0.package


I was doing this wrong.Instead of opening the fullbuild0 with s3pe,I was opening it with S3OC
I have pointed the dummy objk to the apple vpxy.Now do I export the "apple" modl and vpxy to the dummy package? Do I clone the dummy package after exporting?
What about the IMG file of the ingredient/apple?So many questions

I am sorry i am turning out to be an especially stupid .Your help is greatly appreciated.

Edit: Found the IMG file in fullbuild2.I will shut up now and go sit in a corner

Quote:
If you mean the resources they are in their relative Sims3Pack or .package (if you converted them).

Right now I don't remember and I can't check if there's a single xml that lists them all or if they are
defined separately, if I'm not wrong they use, instead of the recipeMasterList, something else with
the word "store" in it.


Thankfully I have found out the ingredient/harvestable resources .There was no masterlist like I was looking for.
Inventor
#47 Old 27th Feb 2015 at 10:21 PM
The whole point of using the dummy package is to avoid searching resources manually.
Once you create the link from the OBJK to the VPXY, cloning with S3OC will take care
of retrieving all resources. How convenient ^^
Icy Spicy
#48 Old 27th Feb 2015 at 10:40 PM Last edited by icemunmun : 1st Mar 2015 at 4:13 PM.
Quote:
Originally Posted by Arsil
The whole point of using the dummy package is to avoid searching resources manually.
Once you create the link from the OBJK to the VPXY, cloning with S3OC will take care
of retrieving all resources. How convenient ^^


I need to experiment more .Thank you so much for the help and the tutorial and the dummy package

Edit:Finally used the dummy package properly.Thank you

Edit 2: ...I have it in game.I have attached some pics.I am so thankful to everybody involved.Now onto recipes :P
Screenshots
Icy Spicy
#49 Old 2nd Mar 2015 at 11:06 AM Last edited by icemunmun : 2nd Mar 2015 at 11:18 AM.
Sorry for double posting but this is a different issue than the previous one

I cloned the coffeBeanMaui to make a Cardamom Plant and ingredient.The cardamom Ingredient mesh is not showing up in game nor is the thumbnail.But the Cardamom Plant grows with invisible cardamom which is harvestable, sim eats an invisible Cardamom and there are invisible cardamoms in the inventory and the grocery store.I have not made it base game compatible yet yet.

I have enclosed the package...Can you please tell me what has gone wrong.I have followed all the steps as best as I could.I will really appreciate it
Download - please read all instructions before downloading any files!
File Type: rar Cardamom.rar (176.9 KB, 12 downloads) - View custom content
Inventor
#50 Old 2nd Mar 2015 at 12:36 PM Last edited by Arsil : 21st Jun 2015 at 9:58 AM.
What? It worked? This guide was a big prank and you are saying that it really works!?

Dear icemunmun,
You are very naughty and distracted. It took me a lot of time and effort to write detailed
instructions and I'm not pleased to answer questions that are already answered in this
thread. On the other hand I realize that my writing skill is so and so, the guide is very
scattered and messy, and anyway I like to help, so I forgive you, because I love you,
and you know it, because you can feel it.

You don't see the fruits because in the xml definition you specified that they are from EP9
(DataVersion tag). This is reflected by the GroupID of the meshes (MODL and MLOD) but
not by their InstanceID. You have two options:

1) you change the IID of the meshes putting 88 (the code for EP9) as 9th and 10th hex
digit (0000000000XXXXXX becomes 0000000088XXXXXX), and you do this
with both S3PE and S3OC.

2) You change the GroupID of the meshes replacing "88" with "00" (with S3PE and S3OC)
and put "Basegame" as DataVersion in the xml of the ingredient (you can directly remove
that tag because Basegame is its default value).

With solution #2, that I recommend, the ingredient will be basegame compatible
(otherwise it will only show up if you have UL installed).

EDIT2: do the replacement of the IID also for the VPXY resource (with S3OC,
put as filter also the type ID of the VPXY, for both the "to be replaced" and
"replace with", otherwise it will replace the IID of all resources and that's not
necessary and it's a PITA to do with S3PE).
This is not strictly needed,
EDIT: it is actually needed!
but it's better to keep VPXY and meshes "synched"
(maybe one day you'll want to clone directly your custom ingredient and this
little extra step might come in handy).

You'll find the fixed version in the attachment.

See the last part of this post to get a better looking thumbnail for your custom
ingredients: http://modthesims.info/showthread.p...792#post4667792

EDIT: I almost forgot: congrats on making it work and thanks for testing the guide ^^
Download - please read all instructions before downloading any files!
File Type: zip Cardamom_FIXED.package.zip (177.1 KB, 21 downloads) - View custom content
Page 2 of 3
Back to top