- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Title no longer displays in object mod
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Title no longer displays in object mod
Replies: 3 (Who?), Viewed: 1171 times.
#1
12th Nov 2010 at 2:38 AM
Posts: 622
Thanks: 1724 in 13 Posts
Title no longer displays in object mod
I was updating Select-a-Sim for Late Night and everything is working fine except the title no longer displays in the selection button when you click the object. I still get a lot of downloads for this even though Twallan and Pescado have up to 24 sims displaying now - so I kind of feel obligated to update. I think that must mean there are a lot of people playing houses with more than 24 sims in them, as scary as that sounds...This is the code I am using:
Code:
private static string LocalizeString(string name, params object[] parameters) { //return Localization.LocalizeString("Gameplay/Objects/Decorations/ActivateSim/ActSim:" + name, parameters); return Localization.LocalizeString("Select-A-Sim", parameters); }
The line commented out is what the object mod tutorial says to use, but I have been using code below that instead. Neither option is working at the moment anyway.
Any ideas? Is there a better way to do it?
This is the whole code in case it helps:
Code:
using System; using System.Collections.Generic; using System.Text; using Sims3.Gameplay.Objects; using Sims3.Gameplay.Objects.Miscellaneous; using Sims3.Gameplay.Utilities; using Sims3.Gameplay.Interactions; using Sims3.Gameplay.Actors; using Sims3.Gameplay.Autonomy; using Sims3.Gameplay.Core; using Sims3.Gameplay.CAS; using Sims3.SimIFace; using Sims3.Gameplay.Skills; using Sims3.UI; namespace Sims3.Gameplay.Objects.Nekocat.ActivateSim { public class ActivateSim : Sims3.Gameplay.Objects.Decorations.Mimics.SculptureAtriumFern { protected Sim mRevealingSim; public override void OnStartup() { base.OnStartup(); base.AddInteraction(ActSim.Singleton); } private sealed class ActSim : ImmediateInteraction<Sim,ActivateSim> { //Fields public static readonly InteractionDefinition Singleton = new Definition(); private const string sLocalizationKey = "Gameplay/Objects/Decorations/ActivateSim/ActSim"; //Methods private static string LocalizeString(string name, params object[] parameters) { //return Localization.LocalizeString("Gameplay/Objects/Decorations/ActivateSim/ActSim:" + name, parameters); return Localization.LocalizeString("Select-A-Sim", parameters); } //public override void Init(ref InteractionInstanceParameters parameters); protected override bool Run() { // do the interraction here Sim selectedObject = base.GetSelectedObject() as Sim; PlumbBob.ForceSelectActor(selectedObject); return true; } //Nested Types private sealed class Definition : ImmediateInteractionDefinition<Sim, ActivateSim, ActivateSim.ActSim> { //Methods protected override string GetInteractionName(Sim a, ActivateSim target, InteractionObjectPair interaction) { return ActivateSim.ActSim.LocalizeString("ActSim", new object[0]); } protected override bool Test(Sim a, ActivateSim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { return !isAutonomous; } public override void PopulatePieMenuPicker(ref InteractionInstanceParameters parameters, out List<ObjectPicker.TabInfo> listObjs, out List<ObjectPicker.HeaderInfo> headers, out int NumSelectableRows) { NumSelectableRows = 1; Sim actor = parameters.Actor as Sim; List<Sim> sims = new List<Sim>(); foreach (Sim sim in actor.Household.CurrentMembers.ActorList.ToArray()) { sims.Add(sim); } base.PopulateSimPicker(ref parameters, out listObjs, out headers, sims, true); } } // end private sealed class Definition : ImmediateInteractionDefinition<Sim, ActivateSim, ActivateSim.ActSim> } // end sealed class ActSim : ImmediateInteraction<Sim,ActivateSim> } //end public class ActivateSim : Sims3.Gameplay.Objects.Decorations.Mimics.SculptureAtriumFern } //end namespace NekoCat_ActivateSim
My cat taught me how to fetch. I throw the toy, she shows me where it landed, and I fetch it.
Advertisement
#2
12th Nov 2010 at 5:10 AM
Posts: 1,728
Quote: Originally posted by NekoCat
I was updating Select-a-Sim for Late Night and everything is working fine except the title no longer displays in the selection button when you click the object. |
Since the Ambitions Patch, Localization::LocalizeString() returns blank if no STBL translation is located for the key you provided.
The key you are passing in is "Select-A-Sim" which hashes to:
0x37570C2DB9106D05
However you STBL contains 0x610D2C5B5D577352 for that string.
Change your STBL to match your key, and your translation should start working again.
Cheers.
NRaas Industries: Sims 3 Mods for the Discerning Player, hosted by The Wikispaces.
#3
12th Nov 2010 at 7:50 AM
Posts: 223
Thanks: 9244 in 68 Posts
Either that, or just change it to:
Code:
if you're not using STBL localization resources, you don't really need the Localization.LocalizeString.
return "Select-A-Sim";
#4
13th Nov 2010 at 3:53 AM
Posts: 622
Thanks: 1724 in 13 Posts
That worked! Thank-you I really appreciate it
My cat taught me how to fetch. I throw the toy, she shows me where it landed, and I fetch it.
My cat taught me how to fetch. I throw the toy, she shows me where it landed, and I fetch it.
Who Posted
|