View Full Version : Help with Model State Indicies BCON
Morague
30th May 2007, 1:29 PM
Hi :)
I swear I have search for this information but I can't find it. Perhaps because the terms are too vague. In any event here's the situation.
I know the basic relationship of the various parts of a model. I'm working on food mods right now & I'm running into a problem.
I have cloned the pancakes & converted them to the Nectarine Tartlett. Pancakes are made using the frying pan but the tartlette gets baked in the oven. Ok - the whole thing is working - the sim prepares it with the mxing bowl, puts the pan in the oven, the food comes out, the food disappears off the plate. Great - the only problem is that nothing is getting put into the oven pan - everything else works perfectly. Alternatively, I cloned the pork chops - again everything worked perfectly, except this time, nothing got put into the mixing bowl. In both cases I changed how the procedure works.
I've spent all weekend trying to figure out how to get the tartlette to appear on the oven tray & or a texture in the mixing bowl :/
What am wondering about is:
Model - Mesh Groups (STR 0x00000087) - something is controlling what textures are associated with whatever state or states are listed - my guess is the Model State Indicies BCON, but, I can't find any info on what it is doing.
Model Materials (0x00000088) - why are only some of the textures listed here?
I'm not havng any issues with cloning & making new foods that are basically the same as the original - same prep, same cook type. The problem is arising because I want to change one or the other.
I'm certain I've figured out the CT- Model Update BHAV, but even adding in the lines to make it update the texture isn't working. So, I'm pretty sure this part is being controlled by the Model State Indicies BCON but all it is is a list of numbers that I haven't a clue as to what it's pointing to.
Any insight would be greatly appreciated.
Jasana_BugBreeder
30th May 2007, 4:37 PM
Moraque, check this thread (http://www.modthesims2.com/showthread.php?t=222202), I reported my findings there :)
In short, food states are really controlled by 'Model Indicies' BCON. Constants from it are used in 'Default - Model - Update' BHAV (called from CT - Model - Update) - Stack Object's graphic is assigned to proper constant. Constants from this BCON point to STR# 0x85 'Model - Name', which contains names of CRESes, which are roots to particular state. You can add a new state - if you add entire chain, starting from CRES, list that CRES in 'Model - Name', and then put its index into a used value in Indicies - BCON (i.e. - if your food is eaten by fork, it's useless to put any index to 0x01 which corresponds to eating by hands).
'Model - Mesh Groups' and 'Model - Materials' STR# are used by ChangeMaterial calls only, so they list only those needed by these calls (i.e. boiled food turns from raw to cooked, of fried food turns to burned).
Other meshes and materials are listed in SHPE, as usual.
Morague
30th May 2007, 9:28 PM
Hi Jasana,
Thanks - this is what I had thought was happening but I wasn't quite sure how to put it together. So, basically, if I want it to use the batter GMDC then in line 0x9 I need to put the line number from STR#85 of the mixing bowl GMDC. OK - I'm going to test this out.
Here's the list I have come up with for BCON 2007 (SG Model States):
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
I've managed to pin most of these down, but if anyone can add anything or notices any errors, please let me know.
Jasana_BugBreeder
31st May 2007, 7:05 AM
So, basically, if I want it to use the batter GMDC then in line 0x9 I need to put the line number from STR#85 of the mixing bowl GMDC.Not exactly - STR#85 lists CRESes, not GMDCs. So you have to determine the CRES which corresponds to mixing bowl GMDC (usually names are enough for that, but if not - you have to track entire GMDC-GMND-SHPE-CRES chain by instances), and put that CRES number there.
Thanks for the full list of indicies :) Though, I'm not sure - what does this mean in game?
0x5 - Oven Baking Pan if Local 1 = Literal 0
0x6 - Oven Baking Pan if Local 1 != Literal 0
Could it be that you can have different meshes for raw and cooked states while in baking pan? That's interesting, I will try it :)
Morague
31st May 2007, 7:27 AM
Hello Jasana,
Ok - in most cases the GMDC matches the CRES one to one, but I suppose there would be times when it doesn't. Thanks for the pointer.
My Nectarine Tartlette is finally working properly :) I've just finished the Filet Mignon, just the Fried Chicken & Lime Seared Prawns left to do. Squinge had done these quite some time ago, but the preparation anims were never added. It has always bothered me, so I decided to fix it. Plus it is a good learning experience - I now feel I "know" foods. I will be releasiing this stuff & more as soon as the people who are testing them report back. I've managed to figure out how to get single desserts to work with the Make Many option - which is something many people have asked for, for a long time.
I'm not positive about the Oven Baking Pan being listed twice. I think it's one stage when they put it in & another when they peek at it (when the steam effects are shown inside the oven) so, perhaps you can have uncooked when they put it in & switch to cooked when they peek, although the microwave tray is the same, I'm just not sure. I also haven't figured out line 0x01 means exactly. Oh well, I think I did pretty good sorting out most of the index entires :)
I don't know how I missed your earlier thread. It's really too bad you didn;t find the PJSE_Include_FoodGlobals.package I did last year - it has almost all of the food globals information in it http://simlogical.com/SMF/index.php - it would have saved you a lot of time!
Morague
31st May 2007, 8:35 AM
Hi :)
0x5 - Oven Baking Pan if Local 1 = Literal 0
0x6 - Oven Baking Pan if Local 1 != Literal 0
0x5 is if it's a single serving to be baked - like the pork chops
0x6 is if it's a group serving to be baked
Jasana_BugBreeder
31st May 2007, 11:09 AM
I also haven't figured out line 0x01 means exactly.I wrote it in the other thread - when the food has to be eaten by hands, its state is changed to 0x1 while it is in sim's hands, and back to 0x3 when it is on plate.
0x5 is if it's a single serving to be baked - like the pork chops
0x6 is if it's a group serving to be bakedAh, I see. That'd be useful, though I wonder how it would look like if group serving is baked and 'throw baked thingy up to flip' anmation is choosen :D it looks OK for a single pancake, but if there'd be more than one piece on the pan, it would probably look funny.
I don't know how I missed your earlier thread. It's really too bad you didn;t find the PJSE_Include_FoodGlobals.package I did last year - it has almost all of the food globals information in it http://simlogical.com/SMF/index.php - it would have saved you a lot of time!Thanks for the link! Looks really useful :)
Morague
31st May 2007, 1:01 PM
It gets used in other places as well, so I don't think it's just for the hand/food plate thing.
For the pork chops it points to the raw, single pork chop, for the hamburger & hotdog it's pointing to the eating a single, for the ribs the group cooking & salmon - cooking a single salmon. Most of the time it just points to the NULL CRES. I'm sure you are correct that it needs to be set to 0x1 & 0x3 when hand eating, but I think it has a larger purpose - that's what I was meaning when i said I didn't know what it represents. Sorry - I'm just one of those people who needs to understand what all of the parts are doing - it drives my husband crazy!
Jasana_BugBreeder
31st May 2007, 2:21 PM
I swear you 0x1 is for 'eat while in hand' state, I did messed up with it :) I did finished one thing - caviar crepes (http://www.pc-sims.com/smb/showthread.php?t=7295) (didn't uploaded it to MTS yet because I wanted to make more second dishes for full set) and almost finished another thing - apple pie - which are using this state. I did complained in the other thread how those crepes worked before I corrected 0x1 index :)
Maxis foods use the same value as 0x3 for eating by hands because food usually looks the same while on plate and in hands. I had made separate CRES for 0x1 state with only translation values changed (the rest of chain was the same as for 0x3 state) and it was applied. If the food isn't supposed to be eaten by hands, then 0x1 state can hold anything, including null state - it would be never used so who cares what's there ;)
It gets used in other places as well, so I don't think it's just for the hand/food plate thing.Can you please point to an example of food where it is also used? I'd like to look at the code too. Since I'm certain it is used for in-hands state, I expected it is used only for it - or we'd be able to get something funny for certain combinations of prep-cook-eat types :)
Sorry - I'm just one of those people who needs to understand what all of the parts are doing - it drives my husband crazy!I understand you well :) When you miss something, it may give sad results, which would need crazy workarounds :(
Morague
31st May 2007, 9:42 PM
I finally found it :)
0x01 - If Stack Object's 0x0009 (type) = Literal 2
This is checking to see if the Stack Object is a person. I found the information in the original objects.package Group 0x7FE59FD0 - the Object Definitions are stored in STR# 0x000000CC & the flags in STR# 0x000000F6
Some of the food BHAVs are changing to stack object from the food to the sim, then invoking different anims - like when they eat with their hands, or flip the pork chop, then the BHAV sets the stack object back to being the food.
The pork chops have 0x01 set to a value of 3, which in the STR#85 is "foodCookSinglePorkChop" - this makes sense so the sims can do the flip anim. The other foods that do the flip anim also have the 0x01 set to "foodcooksingle" The sandwiches, hotdogs, hamburgers have it set to "foodeat" which is for the hand/plate anims.
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.