Another simmer, Olomaya from MTS, was asking about adding a custom skill to a career, as it worked for Arsil's Programming skill, but not others. I thought the answer was needing to use an AddEnumValue function to add the skill to the SkillNames enum so if the game does TryParseEnum, it would get the skill guid rather than returning none. Arsil uses that function in his Mangaka career code, as well as the programming skill, and as it's also needed to get a skill dreamtree working for a custom skill, I thought that's the missing piece. But that's not the case :p
There doesn't seem to be an issue of the game loading the career with the custom skill, but when a sim tries to get the job, there's a script error and the metrics don't show up at all.
The script error says there was a null value found when an object instance was required, at Sims3.gameplay.Careers.MetricSkillX:MetricTitle.
The code is
Code: Select all
public override string MetricTitle(Career career)
{
string name = SkillManager.GetStaticSkill(SkillGuid).Name;
return Localization.LocalizeString("Gameplay/Careers/Metrics:TitleSkillX", name);
}
And I also can't see what Arsil does differently to make the skill compatible, though he has an awful lot of code :p
A possibly helpful note, is that if I use the NRaas Careers skill metric (that the mobster career uses for assassination skill), the metrics do show up, but with my skill metric as blank (so just an angry face with no info). I saw that the NRaas version does some extra checking so will return null if the skill can't be found, so I'm guessing that's why it shows up better than the EA one, but it's probably important that it fails in this specific code both times.
So I'm pretty confused about it all, any insight would be cool!