Super_Xayah Posted July 19, 2020 Share Posted July 19, 2020 Hi So, i'm new to the modding community, and i don't know much about modding or programming overall but i wanted to create a level up system for the character that is either a: A) Get exp by killing mobs (and if possible get different values of exp for different types of creature). or B) Level up every X number of days, for example, each 5 days he gets stronger. And i wanted to do him as a mage/fighter type of character, but as he gets higher levels he can use diferent skills and he gets a higher damage output. Well, that's it, i'd really appreciate some help and sorry if i've got anything wrong, english isn't my native language. Link to comment https://forums.kleientertainment.com/forums/topic/120233-i-need-help-modding-a-level-up-system/ Share on other sites More sharing options...
-LukaS- Posted July 20, 2020 Share Posted July 20, 2020 I think what you're trying to implement might be a bit too complicated for you for now, since you're new to modding in Don't Starve. I suggest you start with something smaller. Of course, I'm not stopping you from going in deep. For some tips I suggest you check some mods that might be similar to what you're trying to do. Also check this thread, it has a lot of useful information: And if you haven't already, watch some lua introducing videos or go through the basics of lua here: https://www.lua.org/pil/contents.html 1 1 Link to comment https://forums.kleientertainment.com/forums/topic/120233-i-need-help-modding-a-level-up-system/#findComment-1355896 Share on other sites More sharing options...
Super_Xayah Posted July 21, 2020 Author Share Posted July 21, 2020 Wow, this does indeed help a lot. Yeah the character is a really big project, as it's a mage type of anime character, and he does indeed has a lot of skills. I may be out of my reach, well, thanks dude, helped a lot Link to comment https://forums.kleientertainment.com/forums/topic/120233-i-need-help-modding-a-level-up-system/#findComment-1356254 Share on other sites More sharing options...
Ultroman Posted July 21, 2020 Share Posted July 21, 2020 On that list of tutorials is this link, in case you missed it 1 Link to comment https://forums.kleientertainment.com/forums/topic/120233-i-need-help-modding-a-level-up-system/#findComment-1356267 Share on other sites More sharing options...
AkaiNight Posted August 26, 2020 Share Posted August 26, 2020 Finally i can help someone i hope its not too late... Let me know if there is any error first of all here is the level up system local function LevelSystem(inst, data) local max_exp = the number you want local min_exp = the number you want local experience = math.min (inst.experience, max_exp, min_exp) local max_level = the number you want local min_level = the number you want local level = math.min (inst.level, max_level, min_level) if inst level == 0 then inst.expneededforlevel = 10 elseif inst.level = 1 then inst.expneededforlevel = 20 end if inst.experience >= inst.expneededforlevel then inst.level = inst.level + 1 end end and here is experience part you must add every creature local function onkill (inst, data) local victim = data.victim if ( victim:HasTag("rabbit") ) then inst.experience = inst.experience + amount of exp that creature gives end end and for save local function onsave(inst, data) data.level = inst.level data.experience = inst.experience end put those in common_postinit inst.level = 0 inst.experience = 0 put those in master_postinit inst.level = 0 inst.experience = 0 inst:ListenForEvent("killed", onkill) inst:ListenForEvent("levelup", LevelSystem) inst.OnSave = onsave inst.OnPreLoad = onpreload 3 Link to comment https://forums.kleientertainment.com/forums/topic/120233-i-need-help-modding-a-level-up-system/#findComment-1366491 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now