Creating an NRaas project MC Additions

Talk nerdy to us here.
icarus_allsorts
Reactions:
Posts: 213
Joined: March 8th, 2012, 6:00 pm

MC Additions

Post by icarus_allsorts » May 7th, 2014, 3:44 pm

Are there any major MC updates planned in the near future? I just started looking into the current code to see if it was possible to implement a few features I personally would like in it and after playing about with it I THINK I've managed to make 2 new working (so far) interactions that could potentially go into the base mod:

1. "Change Stage Name" for Showtime performers (Under Intermediate/Careers)
2. "Lot Address" to set/change a lot's address (temporarily under the Household menu) (Was absolutely thrilled to find out that this one was actually DOABLE and surprisingly without that much code either. Am also thinking of tweaking the common popup menu display used for selecting multiple household/lots to also display lot addresses for households if that's ok)

I would love for these features to be on MC, so I was wondering if it's ok to release a new test version with these interactions (and perhaps anything else I find on The List that turns out to be within my capabilities) when I'm done? Or tag them on the next test version that comes out if there's one planned soon?

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7593
Joined: December 30th, 2011, 6:00 pm
Answers: 81
Contact:

Post by Chain_Reaction » May 7th, 2014, 4:08 pm

I don't have any changes to MC in the pipeline. Go for it :)

icarus_allsorts
Reactions:
Posts: 213
Joined: March 8th, 2012, 6:00 pm

Post by icarus_allsorts » May 7th, 2014, 4:15 pm

woot! Ok, I'll see to it this weekend. What was the protocol on strings again? Just include an English one for testing?

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7593
Joined: December 30th, 2011, 6:00 pm
Answers: 81
Contact:

Post by Chain_Reaction » May 7th, 2014, 4:17 pm

First add the UntranslatedKeys versions then add them to the English translation. They should automatically copy to the other languages. You don't have to edit any localization pages here till it goes stable. :)

icarus_allsorts
Reactions:
Posts: 213
Joined: March 8th, 2012, 6:00 pm

Post by icarus_allsorts » May 7th, 2014, 4:28 pm

Ok, thanks :)

icarus_allsorts
Reactions:
Posts: 213
Joined: March 8th, 2012, 6:00 pm

Post by icarus_allsorts » May 8th, 2014, 4:10 am

Hmm... Looks like I was getting excited a wee bit too quickly. The new addresses aren't persisted and it looks like what I though was just a purely cosmetic part of the game is actually used for things like opportunites and photographs so it might not be such a good idea to change lot addresses in game after all.

icarus_allsorts
Reactions:
Posts: 213
Joined: March 8th, 2012, 6:00 pm

Post by icarus_allsorts » May 8th, 2014, 10:13 am

Actually I just looked at the method where the game pulls addresses to display in Map View:

Sims3.Gameplay.Core.Lot
public string Address
{
get
{
string addressLocalizationKey = this.AddressLocalizationKey;
if (!string.IsNullOrEmpty(addressLocalizationKey))
{
if (Localization.HasLocalizationString(addressLocalizationKey))
{
this.mAddress = Localization.LocalizeString(addressLocalizationKey, new object[0]);
}
else
{
this.mAddress = addressLocalizationKey;
}
}
else
{
if (this.mAddress == null)
{
this.mAddress = string.Empty;
}
}
return this.mAddress;
}
}

where AddressLocalizationKey goes like:

Sims3.Gameplay.Core.Lot
public string AddressLocalizationKey
{
get
{
if (string.IsNullOrEmpty(this.mAddressLocalizationKey))
{
this.mAddressLocalizationKey = World.GetLotAddressKey(this.mLotId);
}
return this.mAddressLocalizationKey;
}
}

So it was easy enough to assign a new value (address) to a lot's mAddressLocalizationKey and the game will use the assigned address as expected. Sadly the new value isn't retained after saving and quiting so the game will pull the default lot addresses from wherever it is they are stored (which I had no clue of, until you mentioned that)

icarus_allsorts
Reactions:
Posts: 213
Joined: March 8th, 2012, 6:00 pm

Post by icarus_allsorts » May 12th, 2014, 1:18 pm

It's been a while since I've done it so I hope I haven't messed up anywhere, but I've submitted the code for the Change Stage Name interaction via GitHub so it can go on the next version of MC, since I felt it's too minor a change to warrant a new test version atm.

Didn't include the Lot Address one since I couldn't think of any other way to do it other than to store a Dictionary of lots and addresses that have been edited within the mod. Haven't actually tried it, but assuming that works it might be better as a separate mod rather than an MC feature.

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7593
Joined: December 30th, 2011, 6:00 pm
Answers: 81
Contact:

Post by Chain_Reaction » May 13th, 2014, 5:31 am

Yep you did it right. Cheers :)

How about the lot address feature in Retuner?

Post Reply