|
Post by anska on Aug 20, 2016 16:21:32 GMT -5
So, I like food and my sims like food and custom food is generally a great thing. Currently there are a lot of interesting tutorials and discussions on the subject available - unfortunately they are a little scattered and maybe not very easy to find. This thread aims at linking to existing tutorials and resources as well as adding one or two of my own making. If you have questions, suggestions or general comments, feel free to post them here as well. Tutorials and resources outside this threadHow to make a custom food for a custom microwave and Prelude to custom food by necrodog While the first focuses on how to connect a custom recipe with an object, the latter gives a in-depth explanation of the different steps a EA recipe consists of. Custom Foods: An overview by plasticbox As the title says an overview about the components of custom recipes. The food group at MTSA group which centers around custom food, which is added to the game via a custom option added to fridges, stoves, etc. In this threadInstant Food - Add tuning and stirA tutorial for those who want to bring their mouthwatering custom dishes on their sims' tables without bothering with the finer details of sim-cuisine. Showing that the glass is only half full - Circumventing geostatsA short note on how to show different levels of fullness in a sim meal without having to rely on geostats.
|
|
|
Post by anska on Aug 20, 2016 16:37:09 GMT -5
Instant Food – add tuning and stir
I IntroductionThis minitutorial will show you how to create a buyable and sellable object, which will generate a group serving of a custom meal upon activation. Its purpose is to get your food objects working with the least amount of tuning expertise. Food generated this way may be sold in retail stores and will appear in the menu selection of Dine Out restaurants. It is however not in any way connected to a fridge or stove nor is it intended to be. The tutorial assumes that you have a basic understanding of what tuning is, having read this tutorial should suffice. II What you will needA mesh/recolour for the single serving of your food A mesh/recolour for a group serving of your food A decorative object to trigger the food The Foodchemistry Kit for Instant Food ( to be downloaded here) For purpose of illustration, I have frankenmeshed together some items which I will turn into edible food in this tutorial: A Gugelhupf on a wooden board (the group serving), a slice of it (the single serving) and the little pink box (the buyable object). All of them are included in the Foodchemistry Kit for Instant Food so you can look at their files and poke through them should need arise. III Setting up the single servingCreate your new object as usual. Please note that it is necessary for food objects to have a 32bit ID. For this reason, I find it easiest to start with a selective clone of an existing foodobject, as this gives me an option to generate my object with a 32bit ID to begin with (see figure a). To learn more about selective clones please take a look at this tutorial. What you wish to retain from the original object depends on whether you simply wish to recolour an existing mesh or wish to add a mesh of your own – in my example I will turn the Caprese Salad into cake. Extract the object and recipe tunings of the food you cloned. You will notice that along with the recipe tuning a SimData is generated (see figure b). Import the recpective xmls from the foodchemistry kit into your tunings. The SimData cannot be imported for some reason – but it can be copied via copy&paste. Give the object and recipe tunings a unique name each and make sure their IDs updates properly. Once you renamed the recipe tuning, its Instance number will most likely be different from that of the SimData. Copy the instance number from the recipe tuning to that of the SimData so they match again (figure d). As you can see (figure c) you have the choice between two object tunings, one is for food that is served on a plate and eaten with a fork, the other for soups. Generate two custom text tooltips ( as shown in this tutorial). One should be the name of your food (Hence to be known asTooltip01), the other should hold a tooltip of the „create/cook/bake your food“ type (Tooltip02). Note their hashtags somewhere. Also generate the the decimal value of the instance of the object definition of your item (Object ID), write it down somewhere and while you are at it, also copy the Tuning ID of your recipe tuning (Recipe ID). In my example they are:- Tooltip01: D93B8153 („Slice of Gugelhupf“)
- Tooltip02: 3BF4760C („Bake Gugelhupf“)
- Object ID: 254643788
- Recipe ID: 9319341026492907286
Now to the fun part: - Object Tuning: is fine the way it is. (Yeah!)
- Recipe Tuning: Search for <!--Single Serving Object Definition--> (it will appear twice) and enter your Object ID. Continue to search for <!--Hash of the name of your Food--> and enter your Tooltip01 and for <!--Hash of cooking tooltip for your Food--> where you enter your Tooltip02.
- SimData: Again search for <!--Hash of the name of your Food--> and <!--Single Serving Object Definition--> to replace them with the respective numbers. Also change the name to that of the recipe tuning. (In my example this means „recipe_Food_Gourmet_SaladCaprese-Single“ becomes „Anska:recipe_gugelhupf_single“)
- Object Definition: Copy the name of your Object Tuning in the Tuning field, the Tuning ID should update on its own. Save. (see figure e)
IV Setting up the group servingSetting up the group serving works basically the same way as setting up the single serving, with one difference: In the recipe tuning of your family or party size serving search for <!--Single Serving Recipe Tuning ID--> and enter the recipe ID you previously copied. Please note: The way this tutorial works, you can only have a family (4) or party (8) size serving. You do however not need separate models for them. If you use a mesh with geostats (that is: if you recoloured a maxis foodmesh) the tuning will automatically discern the size of your meal and display the proper mesh portion. V Tying it to the buyable objectCreate a new decorative item as you are used to. Like you did for your food items, add the object and interaction tunings found in the Instant Food Kit (Anska_object_foodchemistry_box and Anska_interaction_foodchemistry_box) to your package, rename them and add the object tuning to your object definition. In the object tuning, search for <!--Tuning ID of the interaction tuning for your object--> and enter the Tuning ID of your Interaction Tuning. Also in the Object Definition at the very top you will see the topic Components. Click "Edit Items". In the pop-up menu which opens choose "Add" and choose "LiveDrag" from the list. Create a new tooltip like you did before. It will be the text people click to activate your object and generate the food item. Write its hashtag down. In the Interaction Tuning, search for <!--Hash of the Tooltip for the opening interaction--> and enter the hash of the tooltip you just generated, then search for <!--The Tuning ID of your recipe here-->. This time enter the Recipe ID of your group serving. If you chose to make a Family size group serving, you will have to change 15323 <!--Servings_LargeUntouched--> to 15327 <!--Servings_SmallUntouched--> (or to 15113 <!--Consumable_Untouched--> for a single serving). Save and test in game. PS: A note on restaurantsYour newly generated dish will appear under Main Courses, Misc in the restaurant menu. It will be available for breakfast, lunch and dinner and may be ordered by children. It has a base price is 5§ and it can be cooked by the most inexperienced of cooks.
|
|
|
Post by necrodog on Aug 20, 2016 19:30:50 GMT -5
Oh. Its a good tut anska. A good way to cheat the game to "craft" the food in the sims inventory. I have a question. Its neccesary to be the present/decorative item in the sims inventory to be open?
|
|
|
Post by Mathcope on Aug 20, 2016 23:38:22 GMT -5
This is a wonderful tutorial Anska! Thanks for sharing with us!
|
|
|
Post by anska on Aug 21, 2016 3:43:23 GMT -5
Thank you both for your kind words. necrodog while in my example it is necessary due to the following portion of code, it generally isn't necessary. <T n="allow_from_object_inventory">False</T> <T n="allow_from_sim_inventory">True</T> <T n="allow_from_world">False</T> The banquet table from the Luxury Party Stuff Pack and the fizzy drink tray from the Spa Day Game Pack for example both work in a very similar way as my decorative object, but are both located outside the sim's inventory, won't get destroyed in the process and even generate the the food on specific slots outside the sim's inventory. Both work nicely for adding recipes (custom or otherwise) to the world, but I am not entirely sure if the specific slottypes they use are additions to basegame or whether you can only use them when you own the respective packs.
|
|
|
Post by anska on Aug 21, 2016 13:30:02 GMT -5
Showing that the glass is only half full - Circumventing geostats The different levels of fullness (or emptiness depending on your view of the world) of sim plates and cups usually depend on so called geostats, which determine which part of the mesh gets shown at a certain point of a sim meal and which doesn't. The code for this in the object tuning of your food looks like this: <U> <T n="key">15110<!--Consumable_HalfFull--></T> <U n="value"> <V t="apply_new_value" n="geometry_state"> <V n="apply_new_value" t="set_to_custom_value"> <T n="set_to_custom_value">singleServePartial</T> </V> </V> <V t="apply_new_value" n="model" /> </U> </U> As fas as I know, using geostats is currently impossible, showing the state of of your sims' plates and glasses however isn't - as can be seen in the coding of the empty single-plate (shown below). Here the code does not link to a different geostat in the same model, but to a completely different object - in this case the empty plate. Objects used in this fashion apparently don't have to have the same cut or mesh number as the original object (the empty plate has one mesh group less than the full ones and its cuts are in a different order as well) and will also retain their own diffuse maps, etc. <U> <T n="key">15108<!--Consumable_Empty--></T> <U n="value"> <V t="apply_new_value" n="model"> <V n="apply_new_value" t="set_to_custom_model"> <U n="set_to_custom_model"> <V n="model" t="from_definition"> <U n="from_definition"> <T n="definition">7170<!--foodPlateGEN_01_prop (Used Plate)--></T> </U> </V> </U> </V> </V> </U> </U>
|
|
|
Post by Merry927 on Aug 21, 2016 19:56:48 GMT -5
Thank you so much for this tutorial, anska.
I have been playing with it, but I want something that will serve drinks and they don't have large servings.
So I haven't prepared a group serving component and replaced "Servings_LargeUntouched” with "Servings_Single" in interaction tuning of the food trigger.
But I am not deciphering what might have been changed in your food object and recipe tuning that would relate specifically to this mod and not to the fact that they are food and not drinks, so I'm unsure what to change there.
|
|
|
Post by anska on Aug 22, 2016 0:49:17 GMT -5
Hi Merry, I am afraid the game cares very little about whethter you write "Servings_LargeUntouched” or "Servings_Single", what it cares about are the numbers in front of the pointy breaks. The stuff between the pointy breaks is pure commentary, so the poor human writing the code and juggling all those numbers does not get completely lost, it will be ignored by the game.
If you wish your object to spawn only a single glass, cup or plate of your food or drink you will have to replace 15323<!--Servings_LargeUntouched--> with 15113<!--Consumable_Untouched-->. Maybe I should add this to the guide as well ...
Also please note, that the recipe/object tunings for drinks differ from those for food in some points ... so your custom drink will most likely look very odd and be in the completely wrong restaurant section, if you just used my templates.
|
|
|
Post by Merry927 on Aug 22, 2016 15:50:08 GMT -5
Hi Merry, I am afraid the game cares very little about whethter you write "Servings_LargeUntouched” or "Servings_Single", what it cares about are the numbers in front of the pointy breaks. The stuff between the pointy breaks is pure commentary, so the poor human writing the code and juggling all those numbers does not get completely lost, it will be ignored by the game. If you wish your object to spawn only a single glass, cup or plate of your food or drink you will have to replace 15323<!--Servings_LargeUntouched--> with 15113<!--Consumable_Untouched-->. Maybe I should add this to the guide as well ... Also please note, that the recipe/object tunings for drinks differ from those for food in some points ... so your custom drink will most likely look very odd and be in the completely wrong restaurant section, if you just used my templates. Thank you very much for your reply, anska. I should have been clearer about what I did, which included using the hex numbers for single servings (I do understand that part). And I did start with the game drink tuning instead of your food tuning too. I only used your tuning for the triggering object. So I see that the first thing that I needed to change was to use 15113<!--Consumable_Untouched--> instead of the hex numbers for single servings. But do I understand correctly then that the tuning you provide for the food object and recipe has not been changed, except for the "fill in the blanks" parts or is there more to it? I didn't see anything especially different in your tunings and others I compared them to, but I'm not super familiar with them and know little to nothing about actual coding and programming. I should also add that I selectively cloned both the drink and the triggering item and left all boxes checked for both, since all I was changing was the tuning and not messing with actually changing the item produced besides what it is called. I will do the triggering object as a 3D mesh instead. The script call fails for the triggering object with the custom tuning even with 15113<!--Consumable_Untouched-->.
|
|
|
Post by Merry927 on Aug 22, 2016 15:57:03 GMT -5
Oh! This is rather obvious, but I only just thought of it...is Dine Out required, because I don't have it?
|
|
|
Post by anska on Aug 22, 2016 16:53:01 GMT -5
Hello again, no you don't need DineOut. While the SimData will make your recipes available for DineOut restaurants, they themselves were part of the basegame patch (I think?). Drinks for example use different animation overrides than food and have also different consumption strategies (depending on which the drink is or isn't qualified to be drunk by a child) and of course, while some drinks modify the hunger motive, all of them influence the bladder motive. Also drinks have different restaurant categories and while this should not affect whether or not the object loads, wrong categories will probably cause trouble for other people trying to use your drinks. Also the bar drinks (+milk and orange juice) use a pretty ingenious system of geo- and materialstats to display a variety of different drinks from one model, which is again activated in the object definition - and of course not touched by my templates. It could also be that the trashconsumablehasfood bit causes problems, as drinks usually do not have this state. I think it would be easiest, if you allowed me to take a look at your package, because otherwise all I can do is guessing. On a more positiv note, I know that you can spawn drinks like this.
|
|
|
Post by Merry927 on Aug 22, 2016 17:06:10 GMT -5
Oh, thank you for getting back so quickly, anska. Here are the packages for the ale and cask I'm experimenting with. The Vol. 2 cask was created via 3D mesh and has the 15113<!--Consumable_Untouched--> in it. Those are the only two things I changed before posting the first time. It now places but I am not getting the menu for the interaction, so the Sim can't try it. I will go recheck what I did with tool tips... cask of ale
|
|
|
Post by anska on Aug 22, 2016 17:39:50 GMT -5
Thank you! I am too tired to check if everything works ingame now, but in your recipe tuning, you linked to the object tuning (10223430042584424129) not to the actual object. Which would be the decimal value of your Object Definition's Instance number (000000000396F149 -> 60223817) - a whole lot of numbers, I know. I am not sure, if it is easier to remember this way, but the recipe creates the object, while the tuning defines the characteristics of the object. Any way, switch the numbers and it should work. =)
|
|
|
Post by Merry927 on Aug 22, 2016 17:44:55 GMT -5
Ah, thank you! I will work on that...
|
|
|
Post by anska on Aug 23, 2016 11:04:11 GMT -5
Serving a Dish - A recipe in steps I IntroductionIn the following I will explore the tuning xmls of the object and recipe tunings and the simdata files. The tutorial will consist of a more theoretical part and an actual example. For the latter, I will add a recipe to the gtw croissants to make them cookable at an ordinary stove - for who needs to a gigantic cupcake machine to bake croissants, right? Right. What I will not write about is, how to tie your recipe to the ingame applicances, as I personally think, the foodgroup at mts is doing a pretty amazing job in this regard. If you wish to quickly test your selfcreated recipes though, you are welcome to use Valerie's magical cookie jar ( to be downloaded here). The jar is fashioned as a portable crafting object, just add your recipes to the Anska:interaction_MagicalCookieJar tuning and place the object somewhere on your sims' lot - currently the recipe list of the object only contains Grilled Cheeses. II. Object TuningII.a) Animation OverridesThe files usually start with lines describing how the food objects are held and eaten. Foods, with the exception of foodballs, usually also need a prop with which the dish is eaten. Foodballs are things like muffins. Comparing these with the object tuning of the croissant will tell you, that sims usually eat croissants from objects which are carried like plates and eat them with a croissant-shaped prop.
- Common Food Options: plate, bowl, foodball, pot
- Common Drink Options: drinkTumbler, drinkTumblerShort, espressoCup, drinkStemmed, drinkStemmedLarge
Common Props include for example:- 7199<!--toolSpoonGEN_01_prop (Spoon)-->
- 7204<!--toolForkGEN_01_prop (Fork)-->
- 23666<!--foodHandGENCookieChocolateChip_01 (Chocolate Chip Cookie)-->
- 117258<!--foodHand_EP02GENPainAuChocolat (Pain Au Chocolat)-->
- 43867<!--foodHandGENCookieHeart_01 (Heart Cookie)-->
- 117342<!--foodHand_EP01GENskillCroissant (Croissant)-->
II.b) Affordance TuningsThe first bit of the _components section contains further options on how sims handle the food or drink objects and how they consume them. The carryable portion obviously gives details about how the food is handled, while the consumable portion gives details of how the food affects the sim's motives and weather it adds buffs. While many buff-giving food/beverages have direct details about the buffs they give, sometimes added buffs are also passed along by the consume_affordances. Commonly used bits in the carryable department include: - 28729<!--PutDownStrategy_Food_Single-->
- 96999<!--PutDownStrategy_Food_Single_Empty-->
- 28726<!--PutDownStrategy_Food_Multi-->
- 35852<!--PutDownStrategy_Drink-->
- 97304<!--PutDownStrategy_Drink_Empty-->
In the consumable section obviously the hunger and bladder motives are touched, but it also defines how long a meal will last (consumption_turns) and how many calories it has - yes, sim food has calories and yes it affects weight-gain. Usually food which has more consumption turns raises the hunger bar more strongly than dishes who have less, most commonly food will have either 6 or 4 consumption turns. Calories vary and from what I have seen covers a range from 0 to 500 calories. Healthy stuff like garden salad has 50. (And before you worry the exemplary croissants are super low fat with 0 calories). The following are some of the most commonly used consume-strategies. - 13431<!--generic_consume_drink_bar-->
- 13433<!--generic_consume_food-->
- 75561<!--generic_consume_foodBall-->
II.c) Inventory ItemDefines in which types of inventory your food can be stored, basically the same for most food. The exception being the BAKING_WARMINGRACK option, which defines, whether you can store your food in the retail store warming rack. It should be applied to bakery goods. II.d) Retail ComponentsDefines how appealing customers will find your food to buy in a retail store - usually food has a low appeal. The options however are: - 115301<!--retailComponent_Default_LowAppeal-->
- 110393 <!--retailComponent_Default-->
- 115303 <!--retailComponent_Default_HighAppeal-->
II.e) StatesWhile the first bit defines which states exist and when they are triggered, the second bit actually says what is triggered. In the case of the single serving Croissant dish, things get interesting again in line 295. Here the tuning defines, what is shown at different parts of the meal, you can change geostat, materialstats or the whole model, should you desire, a code changing all of it would look like this: <U> <T n="key">15110<!--Consumable_HalfFull--></T> <U n="value"> <V t="apply_new_value" n="model"> <V n="apply_new_value" t="set_to_custom_model"> <U n="set_to_custom_model"> <V n="model" t="from_definition"> <U n="from_definition"> <T n="definition">12345678<!--Object ID of your item--></T> </U> </V> </U> </V> </V> <V t="apply_new_value" n="geometry_state"> <V n="apply_new_value" t="set_to_custom_value"> <T n="set_to_custom_value">geometry_state_name<!--name of your state--></T> </V> </V> <V t="apply_new_value" n="material_state"> <U n="apply_new_value"> <V n="state_name" t="set_to_custom_value"> <T n="set_to_custom_value">material_state_name<!--name of your state--></T> </V> </U> </V> </U> </U>
Next to the fullness of the plate, the freshness of the dish and the quality of the food are defined - and that it sparkles if it has outstanding quality. To be continued
|
|