Making my mod compatible with SP's Skill module

Talk nerdy to us here.
Post Reply
User avatar
lyralei
Reactions:
Posts: 13
Joined: January 30th, 2021, 5:36 am

Making my mod compatible with SP's Skill module

Post by lyralei » September 8th, 2022, 9:11 am

Heya!

Recently I released a mod called the RPG manager: https://modthesims.info/d/670222/rpg-ma ... ehold.html

Now, I'm getting news that Nraas' Story progression's Skill module isn't quite working with this. The mod itself has a few 'managers' and one of them is a Skill Manager that gives the player the ability to easily level up townies without much work. This is a bit similar to Nraas' story progression skilling ability, except for a few extra methods.

Anyways, in the end, after it finally has chosen a skill to level up for a sim, it basically does this:

Code: Select all

simDescription.SkillManager.AddElement(skill);
simDescription.SkillManager.GetElement(skill).ForceSkillLevelUp(RandomUtil.GetInt(1, 5));
Now, to my question:
I tried looking at the source code of the module of what it could be, but I'm speculating that what's going on is that Nraas simply blocks the ability to skill up, as I'm seeing quite a bit of "queuing and allowing skill up" references in code.

I'm wondering therefore if there's a way to tell the Skill Module to ignore the mod entirely or the skilling up when the interaction runs? Or is it better to mention it to the downloaders to make sure not to play with the module?

Thanks!

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

Making my mod compatible with SP's Skill module

Post by Chain_Reaction » September 9th, 2022, 4:00 am

Yes, SP blocks all ForceSkillLevelUp to keep control over the skills. What is the complete namespace and function(s) calling ForceSkillLevelUp?

User avatar
lyralei
Reactions:
Posts: 13
Joined: January 30th, 2021, 5:36 am

Making my mod compatible with SP's Skill module

Post by lyralei » September 9th, 2022, 4:38 am

Thanks for your quick reply! :)

According to Visual Studio it's "Sims3.Gameplay.Skills.Skill.ForceSkillLevelUp()".

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

Making my mod compatible with SP's Skill module

Post by Chain_Reaction » September 9th, 2022, 4:54 am

Apologies, I should have been more clear. I meant the complete namespace and function(s) in your mod calling that EA code.

User avatar
lyralei
Reactions:
Posts: 13
Joined: January 30th, 2021, 5:36 am

Making my mod compatible with SP's Skill module

Post by lyralei » September 9th, 2022, 6:55 am

If it helps, I put the source code on GitHub (I always do that, just for the sake of sharing with the community how to do certain things, just forgot to do this for the RPG manager :p)

Here's one of the functions (there are 3 but that's more because one handles an array of skill names, the other simply one, etc.) But the link with the function I'm about to share is simply just like the other 2. Mentioning it, since it's not the greatest coding job I've done :p

https://github.com/Lyralei1/RPGManager/ ... PG.cs#L242

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

Making my mod compatible with SP's Skill module

Post by Chain_Reaction » September 11th, 2022, 1:48 am

Thanks, that was indeed helpful.

Give this build of SP Skill a try and see if it resolves the issue: download/CR_NRaas_StoryProgression_Skill_V269d.zip

If it does, feel free to link users to this post to fetch it. Please don't link directly to the file. :)

For anyone developing skill mods that call ForceSkillLevelUp, if you name your function "SKillingUpHelperFunction" it will be compatible with SP Skill pending 269d+ is installed.

User avatar
lyralei
Reactions:
Posts: 13
Joined: January 30th, 2021, 5:36 am

Making my mod compatible with SP's Skill module

Post by lyralei » September 13th, 2022, 8:28 am

Wow, thank you for doing this! I'll make sure to link to this post and credit you for the work you did!

Also side note, I think it's fine for now, though I noticed just now the function has a capital K in it, which is also the case with my code. I guess we can keep it as is, but I can also update the file with the proper spelling if necessary. Up to you!

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

Making my mod compatible with SP's Skill module

Post by Chain_Reaction » September 15th, 2022, 2:13 am

Ah it's no biggie, I'd just leave it if everything's working. :)

Post Reply