Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Content

I made a mod so you could buy nectar (wine) from a wine bucket object. It opens what's called a Purchase Picker where you can select what to buy. That all worked fine. I made a second one for special nectar for occult sims that only showed up if your sim was one of those occults. That also worked fine. But then, it turns out if you tried to "Serve" the nectar, which pours it into glasses for a group, the sim just t-posed and didn't do it.

We found out this is because it has to have a quality state assigned to it, and the method to create a custom purchase picker doesn't have a built-in way to assign quality states to food recipes, which normally isnt an issue as normally purchase-picker-purchased food isnt "served". Since serving generates new objects based on the original (the glasses based on the bottle) it needs that information to create the glasses, and without it, it fails.

So Lot51 has his own purchase picker snippet tuning that can assign quality states and I rewrote the entire thing in that format with that information so that the bought nectar had quality states. At first it didn't work, the menu opened up empty. Turns out that's because the Tdesc Builder exported the formatting and dropped the "Variant" tuning from the XML which means it didn't read what was actually buyable.

Lot told me how to manually fix that and it fixed the serving problem!

But the test to make special occult nectar appear or not appear for occults wasn't working. They never appeared even if they should, and the tuning was all written correctly and if it wasn't written correctly the entire thing wouldn't open- but it was opening, so it didn't make any sense that it wasn't also working, and he couldn't figure it out even though he's easily the most profoundly knowledgeable guy about all of everything.

So what was actually wrong?

Astonishingly, the issue was partly the game, partly Core Library updates, and partly me testing the mod too hard.

-I open the picker and it works.
-I give Waffle one of the special traits and it doesn't work.
-I switch to another household with an occult and see if it works if they already have the trait outright, and it doesn't work.

What the heck could be wrong?

Lot tries it in his game...and it works?

So I try it in mine again. Is it conflicting with Nectar Overhaul? No. Is it conflicting with any of the mods I use for the testing process? Also no. What the heck is happening?

We decide that maybe the method the other mods add traits might be skipping something important and I try to add the traits naturally.

So I try adding the traits naturally. Instead of using cheats or tools to give the traits, I have Waffle complete the Nectar Aspiration (using cheats to do so). This time, he gets the Nectar Know-it-All trait...and the picker DOES work properly. He can see the special nectar!

But there's no reason that should make any difference. So what. The heck. Is wrong????

On one test, I randomly happen to assign a special trait to Waffle BEFORE I open the picker...and it works. Turns out, this whole time, the game doesn't properly cache the way these tests work. If I fail the test- such as by not being an occult- and then I try again after becoming an occult, the game still treats it as if I failed the test.

So when I switched to another household to see if it worked for them, it SHOULD have...but the game was still thinking "No, you've already failed" and not checking again, even across households!

But wait, there's more! If I buy a bottle and then go to the main menu and reload my save... that bottle is...still out of stock??? That makes no sense!!! Turns out the library was mistakenly caching the picker info across saves instead of households, meaning that when I reloaded the ENTIRE SAVE back to an earlier state, it still acted like I had already bought stuff. I didn't know the game could even do things like that! It's like I was buying things across dimensions!

We finally get all this sorted, and now I've got another problem.

See, my goal is thus: You can buy special nectar. But the cost is wildly inflated. But you can also age it to get a profit back on it if you want.

Except with Lot's picker, the item is the same value once purchased as it was when you paid for it. So the Vitality Nectar cost 30k, and then when you put it down, was still worth 30k. Aging it made it worth...2.7 million simoleons. Which is not balanced at all.

So Lot also had to update his picker to have a way to set how much an item depreciates, and a way to tell it to use the default value once you buy the item. After that, you could buy it at inflated cost, place it down, see that it was worth significantly less, then age it for a great but not exorbitant profit instead.

...And then my discount for being a Nectar Know-It-All wasn't working, but that was also a quick Core Library fix.

In all, this update to a relatively simple mod, to fix one feature, took something like 4 total hours on my end (granted, not every second of it was spent working), opening the game something like 30 times if not more, a good handful of incremental Core Library updates including brand new features, and so many headaches I threatened to stab the next person I saw in both kidneys.


And that is the story of why Purchase Nectar from Wine Buckets and Racks is somehow one of the most complicated mods in my library despite literally being one interaction to buy some stuff.

Files

Previews only

Comments

Danna McPheron

I'm glad you and Lot sorted the issues on a deeper level. It's better to know more about the inner workings than to create another mod to fix the mod and then use that mod to fix the said mod to support the original mod.