I changed the max stats for players and all from what it was upto a much higher number, but when you get a certian amount you can no longer even touch a mob... I want to know how i can fix this but still maintain the higher level for stats.
Hitroll
Posted by Metsuro on Wed 19 Jul 2006 12:47 AM — 12 posts, 39,744 views.
Changing max stats isn't exactly easy. There is a lot you have to change, including stat tables. Did you make sure to change those?
probably not... could you help fill me in a bit more maybe?
Here are some you have to change:
They can be found in const.c, example of what str_app looks like:
Each line is a stat. As you can see, they're labeled. So the comment with the "1" means that's a Strength of 1. You either need to expand the table to meet your new stat max, or get rid of it and redo how stats work.
extern const struct str_app_type str_app[26];
extern const struct int_app_type int_app[26];
extern const struct wis_app_type wis_app[26];
extern const struct dex_app_type dex_app[26];
extern const struct con_app_type con_app[26];
extern const struct cha_app_type cha_app[26];
extern const struct lck_app_type lck_app[26];They can be found in const.c, example of what str_app looks like:
/*
* Attribute bonus tables.
*/
const struct str_app_type str_app[26] = {
{-5, -4, 0, 0}, /* 0 */
{-5, -4, 3, 1}, /* 1 */
{-3, -2, 3, 2},Each line is a stat. As you can see, they're labeled. So the comment with the "1" means that's a Strength of 1. You either need to expand the table to meet your new stat max, or get rid of it and redo how stats work.
well seeing as my stats now go up to 1000... I'd have to redo it, but not exactly sure how to do that...
Increasing the max stats is easy. You don't have to do anything with the tables to do that. BUT in order for the stats to work correctly you need to "fix" the tables.
Or change it to an algorithm
This is a very dangerous thing to do because all kinds of places all over the code make all kinds of assumptions about what the max stats are and how they work.
But, your safest bet is to do what Dace K suggested, or even something a little simpler. Basically instead of using tables, you make it a function call. That way, if you go outside the valid range, you can print some kind of error message and take care of it in some intelligent way.
But again, I would think about why you're doing this and do some research before running in and changing stuff. SMAUG is not happy when you change things without doing your homework first.
But, your safest bet is to do what Dace K suggested, or even something a little simpler. Basically instead of using tables, you make it a function call. That way, if you go outside the valid range, you can print some kind of error message and take care of it in some intelligent way.
But again, I would think about why you're doing this and do some research before running in and changing stuff. SMAUG is not happy when you change things without doing your homework first.
well I actually dont really know what an algorithm so mind explaining that to me?
That just means to have a formula for calculating the value. For example, You would never access the tables directly and would only use the function. (This is just like you should never, ever access ch->str directly, and instead should use get_str.)
can_carry_weight=strength*1234. Then, you would have a function like this:int get_can_carry_weight(CHAR_DATA * ch)
{
return get_str(ch) * 1234;
}
*get_curr_str
Yes, my bad, it's get_curr_str. (I've rewritten all these as C++ methods and haven't seen the C versions for a while.)