Adrianek777 Posted May 13, 2018 Share Posted May 13, 2018 Hi people, i want make script that when i read selected book i got exp. But i cant make it work, i can do onlny "SetPlayerExperience" but i want add experience not set. Scriptname dostanieekspa extends objectreferenceEvent onread()ble()endevent function ble()Game.SetPlayerExperience(Exp)endfunctionInt Property exp Auto I hope someone will help me :) Link to comment Share on other sites More sharing options...
RichWebster Posted May 13, 2018 Share Posted May 13, 2018 You want Game.AdvanceSkill() https://www.creationkit.com/index.php?title=AdvanceSkill_-_Game Link to comment Share on other sites More sharing options...
Adrianek777 Posted May 13, 2018 Author Share Posted May 13, 2018 (edited) No i dont want. I want got exp not skill. This will be exp book, not skill book Edited May 13, 2018 by Adrianek777 Link to comment Share on other sites More sharing options...
RichWebster Posted May 13, 2018 Share Posted May 13, 2018 No i dont want. I want got exp not skill. This will be exp book, not skill bookYes you do. This gives the player XP towards whatever skill you choose. Link to comment Share on other sites More sharing options...
Evangela Posted May 13, 2018 Share Posted May 13, 2018 There's no problem with that function, it's just that it doesn't invoke the level up screen and further more it doesn't invoke the level progress screen either. With that being said, it will appear that it is not working. You'd have to form your own notification system around this function. If you want to have the player gain whole levels by reading a book, here's how I'd go about it: Function SetNewPlayerLevel() Int level = Game.GetPlayer().GetLevel() ; How far the player is into the current level. Float currentEXPForLevel = Game.GetPlayerExperience() ; Get the experience required to level up to the next level from ; the current amount of exp gained from the current level. Float expForNextLevel = (Game.GetExperienceForLevel(level + 1) - currentEXPForLevel) + currentEXPForLevel + 1 ; Level up player Game.SetPlayerExperience(expForNextLevel) EndFunction To reiterate the thing about it "seemingly not working" - this will trigger a "silent" level up. The player wont know they gained a level, until they go to the menu with skills, magic, items (skills will be replaced with LEVEL UP). Link to comment Share on other sites More sharing options...
Adrianek777 Posted May 13, 2018 Author Share Posted May 13, 2018 It was not exactly what I wanted but it was enough, thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts