foot89790 Posted February 17, 2019 Share Posted February 17, 2019 Anyone know how I can set the player level to 1 in papyrus? I don't think the function is a part of the base game and can't find it in F4SE either. Anyone have a work around? Thanks. Link to comment Share on other sites More sharing options...
foot89790 Posted February 17, 2019 Author Share Posted February 17, 2019 (edited) I mean to include it into an activator, so right now I have?: Event OnActivate(ObjectReference akActionRef) Player.SetLevel(1)EndEvent and I'm getting: (4,1): variable Player is undefined(4, 8: none is not a known user-defined script type Edited February 17, 2019 by foot89790 Link to comment Share on other sites More sharing options...
DieFeM Posted February 17, 2019 Share Posted February 17, 2019 Use Game.GetPlayer().SetLevel(1) instead. Link to comment Share on other sites More sharing options...
foot89790 Posted February 17, 2019 Author Share Posted February 17, 2019 Use Game.GetPlayer().SetLevel(1) instead.I got (4,18): SetLevel is not a function or does not existI think it might be hardcoded in game that you can't lower your level. The console command for lowering your level that worked in skyrim doesn't work in f4 either. Dyou have any ideas on how I could get around that? Link to comment Share on other sites More sharing options...
DieFeM Posted February 17, 2019 Share Posted February 17, 2019 Actually there's no equivalent function in Papyrus, theres GetLevel but not SetLevel (Actor_Script). What a bummer. Link to comment Share on other sites More sharing options...
foot89790 Posted February 17, 2019 Author Share Posted February 17, 2019 Actually there's no equivalent function in Papyrus, theres GetLevel but not SetLevel (Actor_Script). What a bummer.ahh thx anyway Link to comment Share on other sites More sharing options...
Evangela Posted February 18, 2019 Share Posted February 18, 2019 You can make your own SetPlayerLevel without SKSE, or any hackish tricks. You just need a bit of math. Luckily, I had already done this before and found the function I made. I didn't think it was useful to anyone, even for me because of the one thing that makes it bothersome: The xp counter will count forever and ever until it reaches the total exp gained up to that level you set. For example, if you set your level to 50 from level 1, that XP counter is going to keep going until it reaches the exp for level 50. There's no way to stop it. Your level itself is instantly set though. Scriptname LevelUpScript extends Quest ActorValue property Experience auto Actor player Event OnQuestInit() player = Game.GetPlayer() Int currentLevel = player.GetLevel() SetPlayerLevel(currentLevel, currentLevel + 10) ; example purposes. If you're level 1, this will bump you to 10. EndEvent Function SetPlayerLevel(Int aiCurrentLevel, Int aiLevelToSet) ; Set the player's level. Float totalEXPGained = player.GetValue(Experience) as int ; xp gained since level 1 Float calculatedLvl = (aiLevelToSet - aiCurrentLevel) as Float ; level - desired level to get the level difference Float totalXPForDesiredLvl = 37.5 * aiLevelToSet * aiLevelToSet + 87.5 * aiLevelToSet - 124.0 ; total exp for the desired level ; Can't go back levels. if (aiLevelToSet < aiCurrentLevel) return endif player.ModValue(Experience, totalXPForDesiredLvl - totalEXPGained) EndFunction The formula in there actually has an exponent, but I changed it to avoid using math.pow(). Link to comment Share on other sites More sharing options...
foot89790 Posted February 20, 2019 Author Share Posted February 20, 2019 You can make your own SetPlayerLevel without SKSE, or any hackish tricks. You just need a bit of math. Luckily, I had already done this before and found the function I made. I didn't think it was useful to anyone, even for me because of the one thing that makes it bothersome: The xp counter will count forever and ever until it reaches the total exp gained up to that level you set. For example, if you set your level to 50 from level 1, that XP counter is going to keep going until it reaches the exp for level 50. There's no way to stop it. Your level itself is instantly set though. This is some serious scripting. Its annoying that going back levels is hardcoded into the game though Link to comment Share on other sites More sharing options...
Recommended Posts