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!
Inventor
Original Poster
#1 Old 22nd Nov 2020 at 7:47 PM
Default [Testers Wanted] Script mod for Discuss Kelp Recipes
I wrote a little script mod as a companion to my kelp recipes (here) to make the Discuss Kelp Recipes interaction do something. This is my first script mod, so I'm biting off a small task.

This script gives a tunable 1-in-4 chance of learning a kelp recipe when you use the Discuss Kelp Recipes interaction IF:
  • You are the non-Mermaid in the interaction
  • You are a Mermaid who initiated the interaction with another Mermaid

So Mermaids can learn from each other, but BOTH Mermaids can't learn a recipe from the same interaction.

The script checks to make sure that each of my kelp recipes is pleasant, so it won't crash itself if only some are installed. "Discuss Kelp Recipes" is actually a different interaction on land and in the water, but both should work.

My big question so far is about internationalization. How do I use STBL strings in my notification messages? Right now, the notifications are just hard-coded English. In a perfect world, I'd be able to just access the string the game already uses ("Jane Doe just learned how to make Melon Pizza! Delish!")

This is a simple enough script that I could just post the source code in a comment. Is there a "Spoiler" tag in MTS markup?
Attached files:
File Type: zip  Echoweaver_DiscussKelp.package.zip (3.6 KB, 7 downloads)

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Advertisement
Field Researcher
#2 Old 22nd Nov 2020 at 11:29 PM
I have some mermaids who could try this out! Will report back

Here's how I've been localizing notifications:
Code:
target.ShowTNSIfSelectable(target.FullName + LocalizeNotificationString("AddOpenMinded", null), StyledNotification.NotificationStyle.kSimTalking);
And then my LocalizeNotificationString method is this:
Code:
public static string LocalizeNotificationString(string name, params object[] parameters)
{
     return Localization.LocalizeString("lizcandor/Localization/Notification:" + name, parameters); // Using the Localization class from Sims3.Gameplay.Utilities
}
And "lizcandor/Localization/Notification:AddOpenMinded" is the key for the string " gained the Open-Minded trait." (It occurs to me looking at this now, I should probably be more organized with my localization keys, like specify what mod they're for or something.)
Inventor
Original Poster
#3 Old 23rd Nov 2020 at 2:30 AM
I see, and then the STBL will have a string for lizcandor/Localization/Notification:AddOpenMinded?

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Field Researcher
#4 Old 23rd Nov 2020 at 2:55 AM Last edited by lizcandor : 23rd Nov 2020 at 3:37 AM.
That's right!

[Edit] Also, a testing update - I had a mermaid spam their human housemate with "Discuss Kelp Recipes" for a few sim-hours; the notice I got when the human learned a recipe always said the one they learned was seaweed salad, I think like 3 times? I didn't think to confirm before quitting that they actually had only learned that recipe, though. I used MasterController to make the mermaid learn all the recipes, so they definitely were all in the game as recipes that could be learned.

If you haven't already, I think you could add something like this to check whether a sim knows the recipe that was chosen for them to learn:
Code:
Cooking cooking = sim.SkillManager.GetElement(SkillNames.Cooking) as Cooking;
bool knowsRecipe=cooking.KnownRecipes.Contains(recipe.Key);
I've never actually tried anything like that though.
Inventor
Original Poster
#5 Old 23rd Nov 2020 at 4:13 AM Last edited by echoweaver : 23rd Nov 2020 at 6:27 PM.
Quote: Originally posted by lizcandor
That's right!

If you haven't already, I think you could add something like this to check whether a sim knows the recipe that was chosen for them to learn:


Thanks so much for the testing!

It is supposed to be checking to be sure the recipe is not already known, but that sounds like it's not working. I shall investigate.

ETA: I think I see why the test is failing when it shouldn't. Thanks so much for the report.

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Inventor
Original Poster
#6 Old 24th Nov 2020 at 8:23 PM
OK, after a few false starts, I found what was causing the KnownRecipes test to fail. I also added localization. Woot!
Attached files:
File Type: zip  Echoweaver_DiscussKelp.package.zip (4.2 KB, 2 downloads)

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Back to top