PDA

View Full Version : What type of modding would I need to do to accomplish this?


Golddossier
13th Jun 2011, 01:43 AM
Lately I've been working on a mixology mod that focuses on adding new drinks to the game. So far I've got making new drinks worked out completely, however I want to add new colours to change the drink's appearance. I've cloned one of the glass models and I understand that each colour (except for the rainbow drinks) is just a variation on the main texture.

To help better understand this, here are the options of the Bars xml which has the data for each servable drink:

<Drinks>
<ProductVersion>BaseGame</ProductVersion>
<Mood>Regular</Mood>
<Price>5</Price>
<Color>None</Color>
<Pick>None</Pick>
<Glass>Bar</Glass>
<IsLearnable>True</IsLearnable>
<IsFlaming>False</IsFlaming>
<WorldRequired>Undefined</WorldRequired>
<AgesEncouraged>TYAE</AgesEncouraged>
<GenderEncouraged>None</GenderEncouraged>
<RelativePopularity>1</RelativePopularity>
</Drinks>

From what I know so far, the only colours you could use are: None, Red, Orange, Yellow, Green, Purple and Rainbow.

If I were to add a new colour, how would I get the game to recognize it?

velocitygrass
13th Jun 2011, 11:28 AM
Unfortunately the color is parsed into the drinks data as an enum and eventually used in the functions Sims3.Gameplay.Skills.Bartending.GetRgbValuesForDrink(Drink, Single&, Single&, Single&) as well as Sims3.Gameplay.Skills.Bartending.GetMaterialStateName(Drink)
Both of these functions return hard-coded values. I guess they could be changed, though I'm not sure what material states would be recognized as valid (a state is e.g. "drinkGreen") and how you could use it to simply change the color (the RGB value should be less of a problem). To change this you would probably have to override all points where the glass is created. One such point is certainly the bar, but there might be others for putting the glass on the tray or into the hand of the sim. I have only skimmed over the code and it doesn't seem trivial. In any case, the above functions could be a starting point if you'd like to delve deeper in the code. Maybe someone else knows more.

Golddossier
14th Jun 2011, 07:49 AM
Ah, thank you! I spent a lot of time trying to find out where the colours were from. But I was wondering, is this the same for the glass the drink is served in? Because there may be a way to work around this where I could create a new glass with a different colour and get the game to recognize that. It would also add more ways to change the drink's appearence.