TheDoodlerDude Posted February 15, 2020 Share Posted February 15, 2020 Gonna copy and paste my reddit post: Don't know where to ask this but I've been trying to figure out a way to reset my legendary skills back to zero, so that it doesn't show the legendary symbol below the skill. I came across a forum that said SKSE had a function that can do this and even gave an example: ActorValueInfo.GetActorValueInfo("Marksman").SetSkillLegendaryLevel(0) I decided to make a button that will reset all the skill legendaries back to zero at the press of a button, but I'm not fluent in the creation kit let alone scripting. So I'm asking how do I make a script that will reset the legendary skills upon pressing the button? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 15, 2020 Share Posted February 15, 2020 You will need a script obviously. You need to decide if you will use an object that the player interacts with, a spell that they cast or simply a key to be pressed on the keyboard.This decision will determine how your script needs to be written. While the end result will be the same, i.e. the calling of the SetSkillLegendaryLevel function for each skill, the way to get there will be different. Let us assume that you will make some custom location where the player can approach a shrine. Upon praying at the shrine (i.e. using the activator that has been placed there) their legendary skills will be reset.You would have a script on the activator utilizing the following:OnActivate eventCheck that the akActionRef parameter equals the player by using GetPlayerCheck each skill for legendary level with: ActorValueInfo.GetSkillLegendaryLevelAdjust the level as needed with: ActorValueInfo.SetSkillLegendaryLevel An untested example: Scriptname ResetLegendarySkillsShrineScript Extends ObjectReference String[] Property SkillArray Auto ;to be filled in the Creation Kit property window with the text value associated with each skill. See: https://www.creationkit.com/index.php?title=ActorValueInfo_Script#Actor_Value_IDs Event OnActivate(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() Int index = SkillArray.Length While index >= 0 If akActionRef.GetSkillLegendaryLevel(SkillArray[index]) > 0 akActionRef.SetSkillLegendaryLevel(SkillArray[index],0) EndIf index -= 1 EndWhile EndIf EndEventPlease note that I have not used GetSkillLegendaryLevel or SetSkillLegendaryLevel. The syntax may or may not be correct. Creation Kit wiki does not have correct usage examples. I had to dig into the GitHub pages (see here: https://github.com/NightQuest/SKSE/blob/master/src/skse/skse/PapyrusActorValueInfo.cpp) to see the underlining code and take a guess at what is needed. The ActorValueInfo script which houses the two functions both extend Form. This means that some "Form" has to run the function. Thus we try it with the passed in akActionRef parameter from the OnActivate event provided it matches the player. Both need to know the skill to work with, we try passing in string values associated with each skill line. This is done via array so that we do not need to duplicate code multiple times. Link to comment Share on other sites More sharing options...
Ghaunadaur Posted February 16, 2020 Share Posted February 16, 2020 I decided to make a button that will reset all the skill legendaries back to zero at the press of a button [...] This can be done with a short script, added to the button. No properties needed. ActorValueInfo AVInfo Event OnActivate(ObjectReference akActionRef) if (akActionRef == Game.GetPlayer()) int i = 6 While (i < 24) AVInfo = ActorValueInfo.GetActorValueInfoByID(i) if (AVInfo.GetSkillLegendaryLevel() > 0) AVInfo.SetSkillLegendaryLevel(0) endif i += 1 EndWhile endif EndEvent Link to comment Share on other sites More sharing options...
Recommended Posts