Jasana_BugBreeder
27th Feb 2007, 1:16 PM
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:
[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 :cry: 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:
[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:
[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:
[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 :help:
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:
[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 :cry: 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:
[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:
[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:
[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 :help: