Replies: 20 (Who?), Viewed: 27460 times.
Instructor
Original Poster
#1 Old 27th Feb 2007 at 2:16 PM
Default More customizing for your custom foods - my finds, want more :)
I haven't seen this anywhere, or maybe I'm missed the thread somehow? If I did, please tell me where to search. If this is all new, I'd like to tell what I found now, because I'm likely to forget it to the time I end this project

First, simpler things - with menu.

Say, prototype for your new food appears only as Lunch, and you want to eat it for Breakfast as well.
Go to 'Function - Init - Menu' bhav and find a line like:
Quote:
[prim 0x0002] Expression (My [semi] attribute 0x0007 ("Menu Time Availability") Set Flag flag# Const 0x2005:0x02 (Value: 0x0002))

Replace, or insert more similar lines, for times. 0x01 is breakfast, 0x02 is lunch, 0x03 is dinner.

If you want to change cooking skill required, go to BCON with instance 0x00001001. Here's the weird part - for interactions started from different menu items, different constants are used:
- for menu items 1,3,4,5,7 - cooking skill must be between Const 0x1001:0x4 and Const 0x1001:0x10, then your food will appear in menu
- for the rest, cooking skill must be between Const 0x1001:0x5 and Const 0x1001:0x11
That's from the code. I suppose those indices are for menu items from fridge, but either they should be numbered differently as in TTAB, or menu items 1,3,4,5,7 are Serve Snack, Serve Meal, Have Grilled Food, Serve Dessert, Have Dessert - I see no logic in this selection Anyway, looks like these pairs of constants are the same (0x4 = 0x5, 0x10 = 0x11) in different foods.

Now, the most interesting part - cooking. I'm about to give up to find the sequence of bhavs called but - preparation/cooking/eat types are set in 'Function - Init - Food', preparation code (animation and stuff) dwell in counters, cooking code dwell in stove/microwave/grill. The values and meanings for some of them are below.

Preparation
The line in init bhav is like:
Quote:
[prim 0x0002] Expression (My [semi] attribute 0x0004 ("Prep Type") := Const 0x2002:0x04 (Value: 0x0004))

Constants:
0 - no preparation (i.e. TV dinner)
1 - pour (used by cereal)
2 - chop
3 - UNUSED - in base game, at least
4 - mix (in bowl)
5 - patty form (make cutlets for hamburger)
6 - UNUSED
7 - sandwich (put pieces)
8 - season (used by pork chops and salmon)
9 - stuff (used by turkey)
A - chop/mix (use food processor)
B - chop/season (no idea how it looks - found in code)
C - chop/stuff (used by lobster)
The fun part is that you can safely (seems so) change PrepType value. Useful when you want to make a food and there's no prototypes with suitable combination of prep/cook sequence.

Cooking
Cooking is most complex part - it is set as one or more flags (and not all I figured out ), and the flags seem to be of OR kind. For example, hamburger has flags 4 (fry on stove) and 9 (grill) set - it can be cooked in one of these 2 ways.
So, semi attribute 0x05 is first set to 0, then you see one or more lines like this:
Quote:
[prim 0x0002] Expression (My [semi] attribute 0x0005 ("Cook Types") Set Flag flag# Const 0x2003:0x04 (Value: 0x0004))

Constants:
0 - no cooking (i.e. chef salad)
1 - cook in toaster oven
2 - bake (in oven)
3 - cook in microwave
4 - fry on stove
5 - simmer (boil)
6 - unused? absent in code and not set in any foods
7 - fry on stove, then bake in oven
8 - bake, then flambe - used by Baked Alaska
9 - grill
A - slow grill
I hadn't tried to change cook flags, since I don't fully understand them, so any tests/hints are welcome
For example, I'm out of ideas why salmon has 1|2|4|5|7 cooking flags set. Usually it's fried then baked (flag 7); flags 1 and 2 should mean that it can be prepared in microwave/toaster oven when stove not available (if yes, why it doesn't appear in microwave menu, like TV dinner does?); don't know what to think about flags 4 and 5 - it can be just fried, or even boiled, if oven is busy?

Eat
The line in init bhav is like:
Quote:
[prim 0x0002] Expression (My [semi] attribute 0x000C ("Eat Type") := Const 0x200C:0x00 (Value: 0x0000))

Constants:
0 - eat by fork
1 - eat by spoon
2 - eat by hands
Hadn't tried, but this looks like safe to change too. Unfortunately, creation of fork/spoon is buried deep in dish semiglobals, so using a custom spoon would be a pain

That's all for now. If someone knows more, or played with this, please share your experience
17 users say thanks for this. (Who?)
Advertisement
Instructor
#2 Old 8th Mar 2007 at 3:12 PM
I have thanked for this as I find it extremely useful. Although I dont make foods,Ill keep this in mind if I can be creative enough to make a new food!
Thank you

DONT ASK ME FOR A REQUEST ^-^
New Policy,applies to all my meshes ^-^
Im not meshing/Simming now,details in my Policy thing
Retired Duck
retired moderator
#3 Old 9th Mar 2007 at 12:57 PM
Just throw a few extras in here from my collected bits and pieces (mostly the old EdithWiki)...

Cooking 0x6 is apparently "Flambe", but I don't think it's used for anything in TS2.

Prep Type: Only one prep type is allowed per food.
Cook Types: Multiple cook types are allowed per food.
Fridge Reach Type: Determines what animation is used to remove the food from the fridge and what the food's initial container is.
Eat Type: Determines how a sim eats the food. Ex. Fork vs. sandwich
Time Availability: Determines when the food is available.

Each food can have one prep type and any number of cook types. For most purposes in the food chain's code, the prep type is treated as an enum and cook type as a bit-field. There are however instances where prep types are accumulated in a bit-field, specifically when determining availability of a particular prep type.

Most of the rest of the interesting stuff is in the BCONs. Hunger points, cost per serve, skill gain etc are all in 0x1001. Not being a food modder myself I can't say how accurate the list is, but I'll copy it here anyway:

Food Pts - Base: Base hunger satisfaction pts.
Food Unit Cost - Single: Cost of single meal in food units. Food unit to simolean conversion tuning can be found in "SG - Tuning"
Food Unit Cost - Group: Cost of group meal in food units.
Hunger Pts/Loop: Controls how fast a sim eats the food
Menu - Req. Skill - Single: Cooking skill required for availability
Menu - Req. Skill - Group: Cooking skill required for availability
Food Pts - Max Prep Pts: Maximum pts contributed to overall pts in the prep stage
Prep Time Max - Single: Maximum time in sim minutes of the prep stage
Prep Time Max - Group: Maximum time in sim minutes of the prep stage
Prep - Skill Gain Rate: Rate of skill gain (as a percentage of standard rate)
Prep - Skill Gain Rate - Group: Rate of skill gain (as a percentage of standard rate)
Group Meal Serving Count: Number of single meals that can be generated from a group meal of this type
Food Difficulty: Unused
Spoil Time - Hours: Time in sim hours for food to spoil. Single meals inherit their parent group meal's timer
Max Skill - Pts/Time - Single: Threshold above which sims receive maximum food pts and minimum time to complete the prep and cook stages
Max Skill - Pts/Time - Group: Threshold above which sims receive maximum food pts and minimum time to complete the prep and cook stages
Menu - Max Skill - Single: Upper bounds of required cooking skill range
Menu - Max Skill - Group: Upper bounds of required cooking skill range
Calories: Unused
Instructor
Original Poster
#4 Old 14th Mar 2007 at 9:07 AM
Quote:
Originally Posted by Echo
Menu - Req. Skill - Single: Cooking skill required for availability
Menu - Req. Skill - Group: Cooking skill required for availability
Aha - so it was for single and group counts, thanks
Quote:
Originally Posted by Echo
Group Meal Serving Count: Number of single meals that can be generated from a group meal of this type
Tried to change it, and it worked! Good-bye to 6-portion-meals I always wondered why they chose number 6 - 4 or 8 looks more useful to me. Or... hm... it's not impossible to count sims on lot and set this count to the number of sims, right? I don't know about pets, though will they be included in SetToNext(person)?
Instructor
Original Poster
#6 Old 16th Mar 2007 at 6:55 PM
Reporting: changing EatType constant may produce weird/funny results - when you set to eat by hand and there's incorrect index in certain BCON

There's STR# list 0x85, which holds names of all CRESes for food states.
There's BCON list 0x1008 which contains indices of models from the STR# 0x85, which are used somewhere deep in the BHAVs to change food state (prepared/cooked/served/eaten/etc.).

So, some of those indices seem to be food states when:
0x1 - holding in hand while eating by hand
0x2 - preparing (just after taken from fridge)
0x3 - eating (state on plate/in bowl)
0x4 - serving
0x7 - frying
0x8 - boiling
0x9 - preparing - mixing in bowl

This list is not complete, just those I looked at while searching for fix. Problem was: for pancakes, 0x1 index pointed at frying state (with 'raw' material by default). So if you'd want to eat pancakes by hands, you could see then fully cooked pancake, while grabbed from plate to bite in, turns to raw dough
Field Researcher
#7 Old 20th Apr 2007 at 11:26 PM
I would like to thank Jasana for putting all of this in one place,
it's nice to see it here and not spread all over the forums, makes it difficult to look for.

I would also like to list a new fridge interaction based on the food
something i did not share as many new creators would have jumbled up the fridge with to many new interactions

If you change the line in "Text Lists"
usualy it is always the line called "Serve interaction.
(Example) "Serve Dessert" to "Serve Pies and Cakes"
it gives you a new fridge interaction called Well, "Serve Pies and Cakes" :P

Be careful not to make many as this will jumble up the fridge especialy with new foods,
try to keep new foods in your own new catigory.
Instructor
Original Poster
#8 Old 21st Apr 2007 at 7:34 PM
Quote:
Originally Posted by fireflies
I would like to thank Jasana for putting all of this in one place,
it's nice to see it here and not spread all over the forums, makes it difficult to look for.
Well, I just didn't found it anywhere else and I'm still hooked on making foods
Quote:
Originally Posted by fireflies
If you change the line in "Text Lists"
usualy it is always the line called "Serve interaction.
(Example) "Serve Dessert" to "Serve Pies and Cakes"
it gives you a new fridge interaction called Well, "Serve Pies and Cakes" :P
Yes, you could write almost anything there, and there's one annoying mess as result of it, with translations. The thing is, if you simply leave just default translation, non-English gamers will get an additional menu (i.e. 'Serve Dessert'), food will not be combined into their localized menu. So you have to adjust all menus - or at least some, since it's quite a lot of work. Actually, Maxis didn't always update menus in their foods properly - you can see in some 'Omelettes' instead of menu name in rare languages


Actually, I wanted to report another mistake which I had - it's about chaning eat type to 'eat in hand' again, I just don't know where my eyes were before so I didn't noticed it :"(
The thing is, the 'in hand' state usually needs to be shifted a bit to fit in hand exactly. I chose to fix it that way: cloned (with Fix TGI) the 'eat' CRES, added its name to 'Model - Name' STR#, and put new line value to BCON 0x1008:0x01.
Result: half-eaten piece 'reverts' to full while in hands sure I forgot to fix 'CT - Model Update' BHAV - all the instructions for True branch of
Expression (Temp 0x0000 == Const 0x2007:0x03 (Value: 0x0003))
should also be done when Temp 0x0000 == 0x01.
Or, alternatively, I probably could add animation which shifts slice to needed offset, but it'll require to change 'CT - Model Update' as well.

Be attentive, don't repeat my mistakes
Space Pony
#9 Old 31st May 2007 at 8:51 AM
Menu Type Flags (BCON 2001)

0x01 - Have Snack
0x02 - Serve Snack
0x03 - Have Meal
0x04 - Serve Meal
0x05 - Have Grill (not used)
0x06 - Serve Grill
0x07 - Have Dessert (not used)
0x08 - Serve Dessert

SG Model States BCON 2007

0x0 - Ingredients tray
0x1 - If Stack Object's 0x0009 (type) = Literal 2
0x2 - Counter
0x3 - Single plate
0x4 - Serving platter
0x5 - Oven Baking Pan if Local 1 = Literal 0
0x6 - Oven Baking Pan if Local 1 != Literal 0
0x7 - Frying pan
0x8 - Cooking Pot
0x9 - Mixing Bowl
0xA - Toaster Oven Tray if Local 1 = Literal 0
0xB - Toaster Oven Tray if Local 1 1 != Literal 0
0xC - Stove
0xD - BBQ Grill
0xE - Toaster Oven
0xF - Microwave
0x10 - Food Processor
0x11 - Fridge

Also, a good resource is http://simlogical.com/SMF/index.php Look for the Includes_FoodGlobals - when added to your SimPE folder it labels the constants in the BHAV for easy identification. Granted it only works for the food globals, but you can mport the labels into your custom food package & change the group/instance number to make it easier on yourself.
Instructor
Original Poster
#10 Old 28th Jun 2007 at 7:36 PM
By the way, my recent find - about food icon.
In the Food OBJD, Raw data, there's field '0x0048: object model guid 1 - Read-Only'. This field isn't really read-only, and it's value is the number of line in STR# 0x85 'Model - Name' - points to a CRES. Usually it's that <foodname>and plate CRES which seems to be unused. So you can safely change this field to, say, cooked state CRES index, and completely delete the food-and-plate stuff, if you want.
Space Pony
#11 Old 29th Jun 2007 at 4:40 AM
I think that it points to the food & plate so it can create the proper thumbnail when the sim eats the food.

I recently had to track this down because one of my foods had a blank icon when the sim was eating - it turned out that I had reorganized the STR #85 list & the OBJ raw data was pointing to nothing. Once I pointed it to the right thing the icon got the food/plate thumbnail.

I have a feeling that if you remove the food & plate & just point it to the cooked state you will get the food in the thumbnail but not the food on the plate or in the bowl.
Alchemist
#12 Old 29th Jun 2007 at 5:53 AM
Test list instance 0x85 line 1 is the usual place that points to the CRES in most objects. Not true for special things like fences and dog collars, but most of your regular catalog type items.

<* Wes *>
Instructor
Original Poster
#13 Old 29th Jun 2007 at 6:13 AM
Quote:
Originally Posted by Moraque
I have a feeling that if you remove the food & plate & just point it to the cooked state you will get the food in the thumbnail but not the food on the plate or in the bowl.
Yup, it'll be plateless. I don't think it's bad, though
Space Pony
#14 Old 29th Jun 2007 at 7:15 AM
Hi Wes!

The foods are quite different - it just depends on where food & plate show up in the list. Frequently it's listed at #6 but..... it changes. I wish Jasana had posted this yesterday - I spent hours trying to figure out why the darn "eat" icon was blank. LOL, then I come here today to report & find Jasana has just done it. Foods are such a learning experience!
Instructor
Original Poster
#15 Old 29th Jun 2007 at 12:46 PM
Quote:
Originally Posted by Morague
I wish Jasana had posted this yesterday
Sorry I actually figured it about a week ago, but was too lazy to post.
Space Pony
#16 Old 29th Jun 2007 at 1:39 PM
LOL - well don't feel bad - I learned a lot by figuring it out too. I appreciate that you are so willing to share
Test Subject
#17 Old 6th Oct 2007 at 11:26 AM
Quote:
Originally Posted by Jasana_BugBreeder
I haven't seen this anywhere, or maybe I'm missed the thread somehow? If I did, please tell me where to search. If this is all new, I'd like to tell what I found now, because I'm likely to forget it to the time I end this project

First, simpler things - with menu.

Say, prototype for your new food appears only as Lunch, and you want to eat it for Breakfast as well.
Go to 'Function - Init - Menu' bhav and find a line like:

Replace, or insert more similar lines, for times. 0x01 is breakfast, 0x02 is lunch, 0x03 is dinner.


maybe i'm stupid... i can't replace code because it doesn't let me write!! where do i write? thanks

enjoy my videos

°°°how wonderful life is now you're in the world°°°
Banned
#18 Old 11th Oct 2012 at 8:30 PM
This isn't working for me. I have been successfully able to change the menu times many times. I just stumbled across this thread by accident while searching Google. I'm trying to change the prep states, and cooking states. From something cloned from gelatin. I want instead of no prep state to be season, and instead of no cook state to be bake in oven. At first I got a big thrill seeing this thread and wondering about all the different possibilities I could come up with, but it's just not working for me. The way I made it was just to bring up the PJSE toolbox and change the values using the decimal area to the desired result. Should I be changing something in the BCONs as well? Jasana didn't mention in the first post that you needed to change BCONs to make prep and cook states work, but I really may be missing something. I know I've seen the BCONs tossed around a good bit in this thread. Any ideas?
Alchemist
#19 Old 6th Jun 2016 at 10:07 PM
I want to change the cooking skills from 10 (from what it's cloned from) to something lower, maybe 3 or so?
How can I simply do that?
I don't really understand the tutorial on that part.

Overview all my creations (MTS and beyond): Download at once (SimFileShare)
FAQ and policy: Policy S2I
The School Project (finished): The School Project (Completed)
Over 500 new food items to come in Fast & Healthy Cooking Project: F&HCP
Facebookpage: www.facebook.com/sims2idea
Mad Poster
#20 Old 4th Mar 2020 at 4:12 PM Last edited by gummilutt : 7th Mar 2020 at 6:32 AM.
I know this post is very old and hasn't had a reply in ages, but it's the only place I've found that has decent information about editing custom food, and wanted to contribute what I'd found. Like the poster above me I wasn't sure how to interpret the information given when it came to editing skill level required to cook it, and I thought I'd clarify it. What Echo posted in post 3 is correct, in regards to skill level at least. In BCON 1001, 0x04 controls skill level required for a single plate, and 0x05 controls skill level required for a serving platter. Keep in mind skills are on a scale from 0 to 1000, so if you want 2 blobs to be enough you set it to 200, if you want 5 then 500, and so on. You can set it to anything in between and when the Sim has studied enough towards the next point to reach that number it should appear.

In addition I wanted to add that if you play game in a different language than english and you would like to translate the custom food to your language so the pie menu doesn't get so cluttered there are two places you need to edit.
1. For regular pie menu (eat/serve, resume cooking etc) you need to edit instance 012E in Text Lists.In most packages this one will be called "[Text Lists]" but in some custom foods the creator will have renamed it. Just look for the instance number and you'll find the right one. Drop down menu to pick your language, and change the text there to what you want it to be. If there's a separate package for serving platter and single plate, you usually need to make these edits on the serving platter. The single plate won't have the text list in question.
2. For the OFB option make one/make many you need to edit the objects catalog description, as it will pull name of the food from there, rather than text lists. Same thing, drop down menu to pick your language and change to whatever you want

----

Edit: I keep going back to Echo's post to check, but without the number of the lines written out I find it hard to process what I'm reading, so I went and added numbers to it. I could just keep it on my PC but I imagine I'm not the only one that find it easier to have the number written down rather than try to estimate by eye which line it is, so I figure I'll post it All credit to Echo for posting it in the first place in post 3 on this topic.

0x0 Food Pts - Base: Base hunger satisfaction pts.
0x1 Food Unit Cost - Single: Cost of single meal in food units. Food unit to simolean conversion tuning can be found in "SG - Tuning"
0x2 Food Unit Cost - Group: Cost of group meal in food units.
0x3 Hunger Pts/Loop: Controls how fast a sim eats the food
0x4 Menu - Req. Skill - Single: Cooking skill required for availability
0x5 Menu - Req. Skill - Group: Cooking skill required for availability
0x6 Food Pts - Max Prep Pts: Maximum pts contributed to overall pts in the prep stage
0x7 Prep Time Max - Single: Maximum time in sim minutes of the prep stage
0x8 Prep Time Max - Group: Maximum time in sim minutes of the prep stage
0x9 Prep - Skill Gain Rate: Rate of skill gain (as a percentage of standard rate)
0xA Prep - Skill Gain Rate - Group: Rate of skill gain (as a percentage of standard rate)
0xB Group Meal Serving Count: Number of single meals that can be generated from a group meal of this type
0xC Food Difficulty: Unused
0xD Spoil Time - Hours: Time in sim hours for food to spoil. Single meals inherit their parent group meal's timer
0xE Max Skill - Pts/Time - Single: Threshold above which sims receive maximum food pts and minimum time to complete the prep and cook stages
0xF Max Skill - Pts/Time - Group: Threshold above which sims receive maximum food pts and minimum time to complete the prep and cook stages
0x10 Menu - Max Skill - Single: Upper bounds of required cooking skill range
0x11 Menu - Max Skill - Group: Upper bounds of required cooking skill range
0x12 Calories: Unused

If you have questions on how to use SimPE or WW, you're welcome to PM me.
Forum Resident
#21 Old 10th Mar 2021 at 12:48 AM
Sorry to necro this thread but I thought there might be other people like me who are having a really hard time working out how to simply prevent sims from cooking 'berry oatmeal' for dinner. I believe I had simply deleted the menu options I didn't want on several foods that were randomly available at the wrong time of day (Icecream sundaes I'm looking at you), but that was years ago and now I can't remember whether that's a safe way to do it or not. I never bothered with editing the bcon. If someone could please advise that would be very helpful!
Back to top