Adding a new player attribute(stat)

Posted by Zierk on Mon 04 Feb 2019 04:13 AM — 4 posts, 18,628 views.

#0
I'm working with ROM 2.4, trying to add a 6th attribute(stat) for the player characters. In this case I am looking to add the stat "CHA" or Charisma.

Was wondering if anyone knew where I need to make changes outside of the stat definitions in merc.h and the race tables in const.c. I added a new stat define, increased MAX_STAT by 1, then added a new value to the race tables and the MUD was giving me a bad format error in the logs.

Not really sure what to do, have been looking for some reference material online and in the ROM docs and am not finding the answer.

Thanks in advance!
USA Global Moderator #1
Quote:
the MUD was giving me a bad format error in the logs


If you encounter an error message, it's best to actually include the message when asking for help.
You should also post the exact set of changes you made.

I assume you saw this thread already? http://www.gammon.com.au/forum/?id=6090
Amended on Mon 04 Feb 2019 04:28 AM by Fiendish
#2
Thanks for the link. You assumed wrong, I had not seen that thread.

I did not include the exact error because I was not asking for help with the changes I made or the error specifically, just looking for a direction to some documentation.

I did search the forums before I posted but only searched for "stats" and "attributes". Guess I should have put "Charisma" in there!

Thanks again for the assist.

For reference, the error I received was in bug.txt after making the changes I annotated in my original post:

:: Fread_number: bad format.

That error is locally generated in db.c during load_char_obj when a digit is expected and a non-digit is received. The error was coming from the limbo.are file that had a mobile trying to load and did not have the correct stat array.

Everything seems to be in working order now.
Amended on Mon 04 Feb 2019 11:32 PM by Zierk
USA Global Moderator #3
Quote:
I did not include the exact error because I was not asking for help with the changes I made or the error specifically


You tried to make changes which then caused errors. If you had made the right changes, you wouldn't have gotten errors. That suggests to me that your mechanism for determining which information will be important isn't 100% developed yet.

I'm glad that I was able to stumble on a good link this time, but there will be a point in the future when the person you're asking for help is just a bit less lucky with their educated guesses. Do that person and yourself a favor and follow my advice. When you change something and it doesn't work or it causes an error, link to your exact code and include exactly what the error message said at the very beginning. I've been doing this for a long time. I promise it will make the person on the other end less frustrated and therefore more likely to want to help.