Sims 2 Pet Food Bag Makes Fill Dish Free
#1 16-02-2018 
I have a very rudimentary knowledge of object modding. I've been poking around, but I don't really know what I'm doing Wink As the title suggests, I want to make it so if you buy a bag of pet food, filling the dish is free. I'm guessing, the best way to go about it is to actually mod the dishes to search for the bag in the room and go from there? But like I said, I'm really not sure. I've been digging through the primitives, and can't figure out what, if anything, to use to even make that possible.
a.k.a amotherofthreegirlswhosslowlylos​​singhermindmoreandmoreveryday

0
#2 16-02-2018 
I think you're off at a good start. Changing the "Fill" BHAV on the dishes to search for the bag is what I would do as well.
But I would not just search for the bag in the room. I would include the entire lot or apartment (not the entire apartment BUILDING, though), and even the inventory of the sim filling the dish.

0
#3 16-02-2018 
Ok, well good to know I'm on the right track. I must know a bit more than I thought I did, lol. I just don't know what primitive (I'm guessing?) to use for the searching.

Edit: I've been poking around in things that I can think of that require another object for certain interactions, so far haven't figured out what it is I need to do, lol. But I'm trying Wink
(This post was last modified: 16-02-2018 11:57 PM by justJones.)

0
#4 17-02-2018 
In my Reward Catalog mod, I had to add two subroutines (sets of multiple lines of code) to make sure that it was acceptable for the active sim to use the clicked catalog. Yeah, that's quite a bit more than simply adding a primitive, I'm afraid.

Not only did I need to figure out how to search for existing copies of the catalog, but also how to figure out what kind of lot the current lot was, and in the case of apartment buildings I had to develop a technique to find out if the catalog was in the apartment where the active sim lived. That required searching the lot for an Apartment door, which is done with the rather difficult-to-master "Set-to-next" primitive. You could try looking at that mod. See if you can figure out my technique and adapt it for your own needs. I know it's a tough assignment, but that's how I learned to make mods as well.

2
#5 17-02-2018 
I will most definitely give it a shot! I don't mind poking around to learn, I just needed a good object to look at and that sounds perfect Smile I figured it wouldn't be as simple as adding a single primitive, I just meant that they are usually the start of everything, and I wasn't sure where to start.

Ok, I've just been looking at the catalog for a minute, but it's already clearing things up a bit. It'll still take me while to fully get it, but I'm starting to piece together the right path at least
(This post was last modified: 17-02-2018 04:11 AM by justJones.)

1
#6 17-02-2018 
That's great, @justJones. I'm glad my suggestion helps you. Feel free to use whatever parts of my mods you need to get yours to run, OK? Oh, and after having a look myself, I now remember that the important stuff for you would be in the "Is it ours?" and "OK to use?" BHAVs. Smile

1
#7 17-02-2018 
Thanks! You and your catalog have been/will be very helpful!

1
#8 17-02-2018 
Oh, there is also another approach possible. It is to NOT edit anything on the dishes, but to add an option to the BAG from where the sim can fill a nearby dish. This means that both the bag and the dish must be on the lot, not in anyone's inventory. And if you limit it to only dishes in the same room as the bag, you might not even need to do all the apartment-related stuff. Still requires you to figure out how to search for items, though...

0
#9 17-02-2018 
Oh I see. So make it an interaction for the bag. Hmmm... Food for thought.

I'd really like the food bag to only last for x amount of dish fills, so if I made the interaction on the bag itself, is that even in the realm of possibility? Again, I'm not asking for a walk-through or anything, just want to know if it's in the realm of possibility before I pull my hair out trying to figure out something that isn't even possible.

1
#10 17-02-2018 
Sure it is. For example something like this:

On the Bag, you make a BCON "Servings" and four BHAVs: "Refill Bowl", "Refill Bowl - Test", "Dispose" and "Init".
You set "Servings" to 12
When you buy a bag, the "Init" BHAV should copy the "Servings" BCON to the bag's "attribute 0" property, so that attribute will now be 12.
"Refill Bowl - Test" first tests if "attribute 0" is greater than 0. If NOT, then all the portions in the bag have been used, so it's empty. The "Dispose" option in the menu is enabled, and the "Refill Bowl" option is disabled. When you click the "Dispose" option, the "Dispose" BHAV makes the sim pick up the bag and throw it in the trashcan.
If there are still portions, however, the "Dispose" option is disabled/greyed-out, and another check is done to see if there is an empty bowl in the same room. If NOT, then there is no bowl to refill, so the "Refill Bowl" option is also disabled/greyed-out.
But if there IS an empty bowl, the "Refill Bowl" option is enabled. When you click that option, the "Refill Bowl" BHAV makes the sim refill the bowl, and subtracts a point from "attribute 0".

The result is that the bag can only be used 12 times to refill the bowl, and after that, the only thing that your sim can do, is throw the empty bag away!
If you want another number of refills in the bag, all you have to do is change the "Servings" BCON.

2


Sorry, that is a members only option