Skip to content

Conversation

DestroyedClone
Copy link
Contributor

Cause:
Enforcer's Skills and SkillFamilies are not named, causing them to not save in the UserProfile correctly. They're recorded as having the SkillFamily name "" and skillname "" (both blank).

(The XML file is all one line, I indented it in this comparison so it's not difficult to understand).
Normal Families are saved as (For Example, Artificer):

<BodyLoadouts>
	<BodyLoadout bodyName="MageBody">
	<Skin>0</Skin>
	<SkillPreference skillFamily="MageBodyPrimaryFamily">MageBodyFireLightningBolt</SkillPreference>
	<SkillPreference skillFamily="MageBodySecondaryFamily">MageBodyNovaBomb</SkillPreference>
	<SkillPreference skillFamily="MageBodyUtilityFamily">MageBodyWall</SkillPreference>
	<SkillPreference skillFamily="MageBodySpecialFamily">MageBodyFlamethrower</SkillPreference>
</BodyLoadout>

THUNDERSTORE VERSION:

<BodyLoadout bodyName="EnforcerBody">
	<Skin>1</Skin>
	<SkillPreference skillFamily=""></SkillPreference>
	<SkillPreference skillFamily=""></SkillPreference>
	<SkillPreference skillFamily=""></SkillPreference>
	<SkillPreference skillFamily=""></SkillPreference>
</BodyLoadout>

MY FIX:

<BodyLoadout bodyName="EnforcerBody">
	<Skin>2</Skin>
	<SkillPreference skillFamily="EnforcerFamily0">ENFORCER_PRIMARY_RIFLE_NAME</SkillPreference>
	<SkillPreference skillFamily="EnforcerFamily1">ENFORCER_SECONDARY_BASH_NAME</SkillPreference>
	<SkillPreference skillFamily="EnforcerFamily2">ENFORCER_UTILITY_STUNGRENADE_NAME</SkillPreference>
	<SkillPreference skillFamily="EnforcerFamily3">ENFORCER_SPECIAL_SHIELDUP_NAME</SkillPreference>
</BodyLoadout>

Meanwhile, Manipulator by ValeX:

<BodyLoadout bodyName="ManipulatorBody">
	<Skin>2</Skin>
	<SkillPreference skillFamily="ManipulatorPrimaryFamily">CrossSkillDef</SkillPreference>
	<SkillPreference skillFamily="ManipulatorSecondaryFamily">SpellSkillDef</SkillPreference>
	<SkillPreference skillFamily="ManipulatorUtilityFamily">JumpSkillDef</SkillPreference>
	<SkillPreference skillFamily="ManipulatorSpecialFamily">SwitchSkillDef</SkillPreference>
	<SkillPreference skillFamily="ManipulatorElementFamily">StartSkillDefIce</SkillPreference>
</BodyLoadout>

The game is actually saving it correctly. SkillFamily "" and SkillName "" are getting stored.
The issue is that their names aren't changed. Turns out that for a SkillDef, the skillName and the name are pretty much seperate.
So I added

(skillDef as ScriptableObject).name = skillDef.skillName;

to RegisterSkillDef so that it auto names the skills (simply skillDef.name is obsoleted due to allocations).
For the SkillFamilies, I did basically the same thing as a simple adjustment due to me being unfamiliar with the codebase (as in preventing me from naming each skillFamily as like EnforcerPrimary EnforcerSecondary, you can do this simple too by using a switch case and a modulus; I didn't because it felt unneeded for this quick fix)

@DestroyedClone
Copy link
Contributor Author

Ignore changes to everything except: EnforcerMod_VS/Skills.cs

@TheTimeSweeper
Copy link
Owner

thanks again, could you revert the pushed changes that weren't involved so I can merge it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants