Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Pettifogging Legalist!
retired moderator
Original Poster
#1 Old 24th Jan 2016 at 4:56 PM
Default Custom Harvestables: An overview
Custom harvestables are actually not very complex (unless you make them complex =P); here's an overview of what you need to have a custom harvestable in game:


1. Harvestable object:

1.1 Object mesh for the harvestable: The Maxian harvestables I've seen so far have two geometry states, one for the seed and one for the fruit -- I haven't seen the seed being used anywhere though (when sims plant stuff in TS4, the actual fruit mesh is being used, not the seed mesh). So if you clone a harvestable to make a new one, you actually only need to make a fruit mesh and assign that to both states. See the Custom Foods thread in this forum for more info on how to deal with states.

1.2 Object texture for the harvestable: The Maxis fruits and flowers all use the same texture, which contains all the fruits/veggies/flowers in game. Whatever you do, do not override this, since it's being updated with nearly every patch. Just give your harvestable a small individual texture (64x64 should be plenty).

Harvestables need to have a 32bit ID, I'm not sure about the group atm.


2. Harvestable plant:

2.1 (somewhat optional) Plant mesh: The plants usually consist of several different objects; one or two for the sprout state (those are mostly generic, i.e. a bunch of plants is using the same sprout object), plus the actual grown-up plant which (as far as I've seen) has two states, "healthy" 0xAB5783E0 and "unhealthy" 0x21519F0F. These are pretty simple to make, since the unhealthy one is basically the same minus a few leaves / twigs / whatever appendixes your plant has (i.e. when assinging the state, select all and then remove parts by shiftclicking with the clicky tool).

The sprout objects / states / are linked in the object tuning of the plant (see below). The ones I've seen only had one state, "soil" 0x28F896A4 which included the plant too though.

Before you set out to make a new mesh and all, check if you can't simply re-use an existing one -- they can look quite different with different textures.

2.2 Plant textures: this is a bit fiddly since the plants have an Instanced shader, I believe that is why TSRW does not recognise / load the textures for those parts so you could simply replace them there. All references are preserved though when you export to package, so what I do is just clone the thing and link the textures in s4pe.



You don't really need to know all that in detail to replace the textures -- you can just C+P the IDs of the diffuse maps in your clone and find them in Fullbuild0, so that you can see which texture is wet/normal and which one is dry, then replace the IDs accordingly. From what I've seen so far, the "wet" texture in Maxis plants is identical with the "normal" one, only with a more glossy specular, so the textures you need to make in order to match that setup are:

  • one diffuse for the regular and wet states
  • one diffuse for the dry state
  • one specular for the regular and dry state
  • one specular for the wet state
  • one bump map

To edit texture references in s4pe, select MODL (low poly LOD) in the left-hand list, click "Grid", then click the three dots next to "ChunkEntries", select one from the list on the left, cick "Expand All", scroll to e.g. "0x6CC0FD85 (DiffuseMap)" -- this is the resource key for the diffuse map. The last four definitions are (often? always? usually?) the soil texture; you don't need to do anything with that. Repeat for MLOD group 0x00000000 (high poly LOD) and 0x00000001 (mid poly LOD).


3. Tuning:

Two object tuning files come into play here, one for the harvestable and one for the plant (if you make custom sprout objects, they do not need any tuning). The harvestable tuning has the info which plant should grow from this fruit; the plant object tuning tells the game which sprout models to use and links to the material states/effects/etc of the grown-up plant. The latter may not need to be customised.

3.1. Harvestable tuning:

Right at the top is a list of animation overrides; this defines how sims should hold/carry the object -- might be important if you changed the shape of your harvestable very much:




The one part that you will want to change is in fruit_component, near the top: the name hash (what the object is going to be called in game), and which plant to grow from it.

Code:
    <V n="gardening_component" t="fruit_component">
      <U n="fruit_component">
        <V t="fruit_does_not_fall" n="fruit_fall_behavior" />
        <T n="fruit_name">0x9B0AFA2C<!--pbox_object_GardeningFlower_Lettuce_name--></T>
        <T n="plant">2732072927<!--pbox_object_GardeningPlant_Bush_lettuce--></T>
        ..


2732072927 is the OBJD/COBJ ID of the custom object to use. The rest of it you can probably just ignore unless you want to do something really specific.


3.2. Plant tuning:

You don't necessarily need to edit this or have custom plant tuning at all -- if you don't do anything special with your plant, use Maxis tuning instead (has the advantage that they will update it for you =P).


Shoots are defined in plant_component > shoot_definition:

Code:
    <V t="plant_component" n="gardening_component">
      <U n="plant_component">
        <T n="shoot_definition">22469<!--gardenShootGEN_01 / object_GardeningShoot_Generic--></T>
        <L n="states_that_support_fruit">
          <T>77615<!--CommodityBasedObjectStateValue: PlantGrowth_3_Blossoming--></T>
          <T>15295<!--CommodityBasedObjectStateValue: PlantGrowth_2_Mature--></T>
        </L>
      </U>
    </V>


This number is the ID of the OBJD/COBJ of the shoot model, expressed as decimal value. This is not the sprout! It is the object that sims get when they do the "Take Cutting" thing.


Sprouts are defined in the "PlantGrowth" state list, similar to the abovementioned textures. If the Maxis generic sprouts work OK for your plant, you don't need to edit them.




At the very bottom of the tuning is also the interactions list, should you want to give your plant custom interactions or disable some.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
1 users say thanks for this. (Who?)
Advertisement
Icy Spicy
#2 Old 30th Jan 2016 at 10:23 PM
How do we tag a harvestable as a fruit or veggie?
Pettifogging Legalist!
retired moderator
Original Poster
#3 Old 30th Jan 2016 at 11:20 PM
That is in the tags in COBJ. See sticky in Object Creation (the one on COBJ/OBJD) if you're unsure how to edit them!

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Icy Spicy
#4 Old 30th Jan 2016 at 11:45 PM Last edited by icemunmun : 31st Jan 2016 at 12:01 AM.
Quote: Originally posted by plasticbox
That is in the tags in COBJ. See sticky in Object Creation (the one on COBJ/OBJD) if you're unsure how to edit them!


I somewhat know how to edit the COBJ and have some idea about the catalogue tags but I cannot figure out which specific tag to change if I want to tag a harvestable(Garlic) as a veggie.Thank you so much for the pointers and the tutorial!
Pettifogging Legalist!
retired moderator
Original Poster
#5 Old 31st Jan 2016 at 12:25 AM Last edited by plasticbox : 31st Jan 2016 at 12:39 AM.
Off the top of my head the tag is Func_Veggie. If you use s4pe, that has autocomplete for the tags (select the Func category in the first box, then in the tag box type "veg" or something).

E: you can also look up tags in S4_03B33DDF_00000000_D89CB9186B79ACB7_tag.xml.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Icy Spicy
#6 Old 31st Jan 2016 at 12:43 AM
Quote: Originally posted by plasticbox
Off the top of my head the tag is Func_Veggie. If you use s4pe, that has autocomplete for the tags (select the Func category in the first box, then in the tag box type "veg" or something).

E: you can also look up tags in S4_03B33DDF_00000000_D89CB9186B79ACB7_tag.xml.


Thank you so much! It is so much easier to tag things in s4pe :lovestruc . Earlier I was using S4S to manually edit the category flags and i only knew the value for fruit(0x031B).I did not know about this function of s4pe!
Pettifogging Legalist!
retired moderator
Original Poster
#7 Old 31st Jan 2016 at 12:56 AM
You're welcome. Yes, there is not a lot of documentation for s4pe, unfortunately.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Back to top