[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Hitroll

Hitroll

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Wed 19 Jul 2006 12:47 AM (UTC)
Message
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.

Everything turns around in the end
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #1 on Wed 19 Jul 2006 12:50 AM (UTC)
Message
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?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Reply #2 on Wed 19 Jul 2006 12:56 AM (UTC)
Message
probably not... could you help fill me in a bit more maybe?

Everything turns around in the end
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #3 on Wed 19 Jul 2006 01:08 AM (UTC)
Message
Here are some you have to change:
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.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Reply #4 on Wed 19 Jul 2006 01:45 AM (UTC)
Message
well seeing as my stats now go up to 1000... I'd have to redo it, but not exactly sure how to do that...

Everything turns around in the end
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #5 on Wed 19 Jul 2006 02:23 AM (UTC)
Message
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.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Dace K   Canada  (169 posts)  [Biography] bio
Date Reply #6 on Wed 19 Jul 2006 06:30 AM (UTC)
Message
Or change it to an algorithm

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #7 on Wed 19 Jul 2006 01:38 PM (UTC)
Message
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.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Reply #8 on Wed 19 Jul 2006 04:14 PM (UTC)
Message
well I actually dont really know what an algorithm so mind explaining that to me?

Everything turns around in the end
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #9 on Wed 19 Jul 2006 05:01 PM (UTC)
Message
That just means to have a formula for calculating the value. For example, 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;
}
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.)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Kiasyn Kelle   (15 posts)  [Biography] bio
Date Reply #10 on Wed 19 Jul 2006 09:35 PM (UTC)
Message
*get_curr_str
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #11 on Wed 19 Jul 2006 09:37 PM (UTC)
Message
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.)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


25,005 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]