Code:
How would you let the compiler distribute the points for you if at level 99 the strength should be at 569 and so on? How would you let that happen? If I need to make a proc how would i do it?
Jan 3 2014, 9:55 am
Best response
|
|
You'd start out by reading this. It'll answer all of your current questions and more.
|
You need to have a formula. Every game uses a different formula for stats.
It's simple algebra at its most basic forms, but the formulas can get into calculus difficulty at times. All it is is math, this isn't something we can really give you. It all depends on your stats, EXP gains and how you want your stat growth to work. In other words, it is all reliant on your game. If you come back with a formula you are trying to get and a detailed explanation of how you want your stats to grow, we may be able to help you with some of the math. |
Well I am assuming you would have a StatPanel this is how I would go about doing this. But since you want 569 strength if the level is 99 that will go into recurring decimals. 569 / 99 = 5.747474... So 1 level would give you 5.747474... strength. So I will give you an example. For my example lets say for level 50 I would you 500 strength. So that means 1 level would give me 10 strength(500/50=10).
/* I do believe that that code should match the purpose you are seeking if edited in the correct way. My apologize if this code doesn't work, as I have been unable to test it as my Dream Maker has been playing up. Hope this helps, King_Ed. |
If you want control over the exact stats a player will have at level X, you have a couple of options.
The best and probably most intuitive method I can think of is to use a getter to determine a player's strength at any given time. Here's an example: mob This would potentially lead to you just getting rid of the "strength" variable all together, since the point of a strength variable is just to be there so you can modify their base strength, and we no longer have a reason to do that. Obviously every time you want to do a strength check, you have to use getStrength(). Assuming this is an RPG, you'd probably have modifiers for equipment or possibly spell effects that you want to change your strength value. You'd have to check for those during getStrength() and plug the modifiers into the final value. |
In response to King_ed
|
|
King_ed wrote:
using Stat() to demonstrate something Please don't use Stat() to demonstrate something. It isn't applicable in all scenarios and can just lead to confusion. Like your code does for me. Makes me very confused. |
In response to Keeth
|
|
Keeth wrote:
If you want control over the exact stats a player will have at level X, you have a couple of options. Thanks, Meanwhile I didn't mean to vote. It was a misclick. |