Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Test Subject
Original Poster
#1 Old 14th Mar 2015 at 10:10 PM
Default So I want to create a program/utility. Any advice?
I would like to make something called "Drink Manager". My idea is that it could manage the unique drinks a Sim has created, including options to edit the look and mood of a drink, as well as delete drinks (because I think it's terrible that unique drinks aren't deletable). The first thing I want to do is have a deletion system. In another thread it was said that data for unique drinks isn't stored in a package file, so I don't know where I should start.

I want to do this because otherwise mixology is no fun! I had a mod that made it so that my Sims always make colorful drinks but when I travel to foreign countries the drinks all "revert" to the boring state.
Advertisement
Inventor
#2 Old 16th Mar 2015 at 1:16 PM
In savefiles, custom drinks are stored in the OBJS resource(s). You can only hex edit that kind
of resource, so it's a mess to find what a certain value refers to. Well, at least speaking for
myself, since I don't have much experience with binary file formats.

Deleting a custom drink should not be too hard to do, with a custom interaction, and I think
you can also create an interaction (or replace the existing one that creates new drinks) to
have more control on their customization (if I understand how it works, currently you can
only choose the name and all the rest is random, right?).
Test Subject
Original Poster
#3 Old 16th Mar 2015 at 3:47 PM
Quote: Originally posted by Arsil
In savefiles, custom drinks are stored in the OBJS resource(s). You can only hex edit that kind
of resource, so it's a mess to find what a certain value refers to. Well, at least speaking for
myself, since I don't have much experience with binary file formats.

Deleting a custom drink should not be too hard to do, with a custom interaction, and I think
you can also create an interaction (or replace the existing one that creates new drinks) to
have more control on their customization (if I understand how it works, currently you can
only choose the name and all the rest is random, right?).


Wow, thanks for all the help!

Yep, you can only name it and the rest is random. You also have the option to go to the book and rename drinks.
So custom interactions, any advice on that?
Inventor
#4 Old 16th Mar 2015 at 4:06 PM
Well, you use a pure scripting mod to add the custom interactions to existing bars and
newly bought/placed ones.

I'd say one custom interaction for deleting existing custom drinks and one custom interaction
that replaces the existing interaction to create custom drinks (you copy/paste its code and
make the changes you want, maybe using dialogs to choose the color, glass type, whatever,
I'm just speculating, I don't know what can be configured and what can not).

I think this approach is better than creating an external tool because you can manipulate
the data before it gets written on a file/resource (it should be way easier than having to
"decode" the binary format used in the savefile).

It's not a trivial mod, but seems doable and you sure proved to be VERY interested in it ^^
Test Subject
Original Poster
#5 Old 16th Mar 2015 at 5:43 PM
Okay, thanks. I'll look up scripting and the like.
Inventor
#6 Old 16th Mar 2015 at 10:18 PM Last edited by Arsil : 16th Mar 2015 at 10:49 PM.
So, you have to remove the PracticeMakingNewDrinks interaction and add a custom one from/to every existing
object of class BarProfessional (and every newly placed ones with an EventHandler).

The existing interaction calls a method defined in Bartending named CreateANewDrink, this one does the following:
- generates a random name for the drink then shows a dialog to the user so he/she can change it
- depending on a check on the mixology skill of the bartender it can assign a "mood" to the drink
- assigns the quality of the drink based on the mixology skill of the bartender
- adds the drink to a list that contains custom drinks. The instance variable used here, Bartending.mUniqueDrinks,
will be important for the custom interaction to remove/delete a custom drink
- other things (display a message in the top-right corner of the screen, play a sound, checks about opportunities, etc)

Unfortunately I don't see anything about the color of the drink, the shape of the glass or things
like that, but it doesn't mean there's no way to configure them.
EDIT: glass, color and something else called "pick" (it gets as values None, Black, Blue, Heart...
maybe it's the decoration on the glass?) are based on the mood of the drink and are assigned
when a new drink is created (new Bartending.CustomDrinkData(text, mood, quality)
that calls one of the constructors of the class CustomDrinkData).
But after that call nothing prevents you to change them again making them configurable by the
user with dialogs or whatever you want.

Your custom interaction will call (or directly contain) a custom method based on CreateANewDrink
(you can brutally copy/paste it) that you then will change to make the drink more customizable.

EDIT
The custom interaction to remove an existing custom drink should be a piece of cake
(unless that will conflict/confuse the skill journal, but I doubt it).
But there can be problems if your sims or the drinks are "ported" in another world
(vacation, university, ecc) because I don't think the settings about the glass, color and
pick (whatever that is) of the drink are saved, only the "mood" is saved and used to
set those 3 features of the drink. It works this way because this is how custom drinks
are exported/imported (CustomDrinkData.ExportContent and CustomDrinkData.ImportContent)
between worlds/savegames, I'm afraid that can't be changed with a non-core mod.
Inventor
#7 Old 5th May 2015 at 5:40 PM Last edited by Arsil : 9th May 2015 at 10:03 AM.
I made an attempt myself but I have a bad feeling about it, I think I missed something or did a trivial mistake somewhere.
I would like a second, third and also fourth opinion.

For some transcendental reason, I wasn't able to directly replace the existing interaction through the Singleton,
but I had to remove it and add the custom one.

PickerDialogs aren't fully localized and probably can be improved with images/titles.

Quote:
But there can be problems if your sims or the drinks are "ported" in another world
(vacation, university, ecc) because I don't think the settings about the glass, color and
pick (whatever that is) of the drink are saved, only the "mood" is saved and used to
set those 3 features of the drink. It works this way because this is how custom drinks
are exported/imported (CustomDrinkData.ExportContent and CustomDrinkData.ImportContent)
between worlds/savegames, I'm afraid that can't be changed with a non-core mod.

This. Oh, and the pick is the straw.

SPECIAL POLICY
You can use this mod only if you wear a funny hat.

EDIT: attachment removed after uploading the mod
Field Researcher
#8 Old 6th May 2015 at 5:29 AM
Chain_Reaction has updated the Traveler mod to make sure the custom drink data is exported and imported properly when traveling to another world if you want to check that out http://nraas.wikispaces.com/Update+History+Testing

That was quick work as usual Arsil The same issue was discussed on the NRaas forums (possibly by the OP though they have different screen names? Sorry if I'm mistaken) I was considering putting the option to edit already created custom drinks to Master Controller since the interfaces and dialogs are already provided there, but I guess there's no need for that now
Inventor
#9 Old 6th May 2015 at 9:36 AM Last edited by Arsil : 6th May 2015 at 10:04 AM.
Quick and dirty.

Would you like to take care of this mod?
I'm sure you can make the interface prettier and the overall code more robust and elegant.
I'm not in the mood to try to improve it myself and leaving it like this would be a shame.
IIRC you also have a mod to turn regular bars into professional bars so you could make them compatible.

You mean Traveler bypasses the limitations of the export/import methods?
Does it store those values (glass, color and pick) somewhere else to restore them in the new world?
Oh I see, that's clever. Sometimes I forget that I'm just a little modder in the vast modding world.

EDIT: "None" and "Regular" seem the same DrinkMood, so I guess in the picker there should be only one.
Field Researcher
#10 Old 6th May 2015 at 10:16 AM
Err, you'll have to ask Chain about Traveler I'm afraid. I can't remember off hand if the juice bar mod replaced the default practice making new drinks interaction but if it does and if you had it installed it might explain why replacing the SIngleton didn't work.

I haven't actually taken a look at the mod, but if you've actually done a custom version of the interaction that lets the user choose the exact look/color/pick/mood of the drink upon its creation that sounds more like what the OP (and any user playing a mixologist sim) is looking for and is certainly more than I was thinking of doing with MC so it might be worth your time to release it You could look somewhere in the Bartending skill class (probably where the tabs for the custom drinks are created for the Skill Journal) for the default localized strings you could use for the headers and the dialogs etc
Back to top