![]() |
Cant figure this formula out.
So I slept through this chapter in math class (Really I did, when I looked at this pattern I KNEW I remembered it somewhere)
I need to write a experience system formula but to find the exp of the next level. Something like clientr.nextlvl=7+((clientr.level*2)+1); Obviously thats wrong but its as close as I got... Heres how I wanted to have it progress as you level: NPC Code: |
clientr.nextlvl= 7 + clientr.level^2 - 1;
|
Thanks a TON. n_n
|
See what happens when you sleep during class? :asleep:
|
Most character level systems I've read use a predefined list. Usually there aren't going to be more than a hundred levels anyway, so constructing the list isn't particularly tedious.
|
Quote:
|
Quote:
|
Quote:
|
lol Dusty's was fine, works exactly like I wanted to. I even learned something (sorta).
|
They both do the same thing. ^^ One just does it with less operations (Zero's).
|
It makes more sense to use less operations when it comes to algorithms. You can always put the original, unsimplified algorithm in a comment on the side.
|
Im having more problems with formulas. Im trying to get the maxhp to be itself + a percentage of it per each point of vitality. The way I have it setup now adds on the percentage each time you add to vitality manually. At level 1 your maxhp is 100 so I guess the base is 100.
clientr.maxhp=int(clientr.maxhp+(clientr.maxhp*0.0 8)); What I'm aiming for a script to check it and adjust it automatically which if I used my formula it would increase nonstop... |
Quote:
For example clientr.maxhp=int(clientr.vitality*5*2+(clientr.vi tality*0.08)); If you start with 10 vitality, this'd equal 100hp (I forget if int rounds xD) Then with 11 vitality it'd be 110 Then with 12 vitality it'd be 120 Then with 13 vitality it'd be 131 etc. You can't have clientr.maxhp part of it because that's a loop. How much do you want the HP to go up by, though? That's the real issue. Edit: clientr.maxhp=int(100*player.level+(clientr.vitali ty*0.08)); Base = 100 so that should work. xD You'd need more than 8 percent for the vitality to take effect. Edit 2: You'd need to have an "onVitalityUp()" for each time vitality goes up so you can use clientr.maxhp as a percentage without looping. |
People who got C in elementary mathematics ITT.
|
Quote:
|
All times are GMT +2. The time now is 05:36 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.