SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
85 stars 18 forks source link

SleekSkill on client renders constant values instead of server-side info #4371

Closed sunnamed434 closed 2 months ago

sunnamed434 commented 2 months ago

The problem is client uses info about the max level that the player can get while clicking, however, in UI it renders constant values, i.e the default PlayerSkills.SKILLSETS, when actually must render the info that the server provided, in this case: skill.GetClampedMaxUnlockableLevel() or skill.max.

https://github.com/SmartlyDressedGames/Unturned-3.x-Community/assets/65300126/10173914-5a59-4115-b6e1-9e94c0dc6e10

Repro:


PlayerSkills.onApplyingDefaultSkills += OnApplyingDefaultSkills;

private void OnApplyingDefaultSkills(Player player, Skill[][] newSkills)
{
     // iterate through the skills and get skill and set it to player max skill level (in my case from rocket plugin configuration)
     var skill = player.skills.skills[restrictedSkill.SpecialitySection][restrictedSkill.SpecialityIndex];
     var maxLevel = restrictedSkill.MaxLevel;
     skill.max = maxLevel;
}

So this is what it must look like: image

Currently, the only solutions are edit map or patch Upgrade methods to notify the player that this skill is no longer upgradable, and to give a least any feedback to the player

SDGNelson commented 2 months ago

maxUnlockableLevel is set by the level config which the client would ordinarily be able to show in the UI. The game doesn't currently support setting it by plugin, sorry.