Re: [CODE] Max Title Length and fight.c

From: Patrick Dughi (
Date: 05/23/99

> Hmm...I had a mortal ask me to change the max title length, so i went to
> structs.h and lookat where it was and it could be me but the code seems
> pretty hell-bent on not changing that.  Is it ok to change? and the
> other thing is in fight.c where the dammessages are I was lookin at em
> so I just added like 3 using the same format and then changed the
> msgnum's but I gots a bunch of errors, there somthign else I need to
> change?

        Okay, first, you can go ahead and change structs.h to allow for a
longer max title length.  However, since you save to a binary player file,
and use fwrite to export a specific size structure, you'll either have to
write up a player file converter, OR, do a player file wipe.  Changing
anything that affects 'char_file_u' will cause you to do this.  However,
writing a converter is cake (usually).

        You can do it by hand and transfer each member of the structure
over, or just use memmove or memcopy to copy over the identical parts, and
do a 1-1 conversion for the altered parts (+new parts).

        It would be easiest for you to simply rename the 'title' character
array into someting else, and create a new correctly sized array at the
end of your new char_file_u struct.  That way you could do something like:

memcopy(new_file, old_file, sizeof(struct old_char_file_u));

(This assumes that new_file is your new char_file_u format, and old_file
is your old char_file_u format)

        and then just add the new one, and call it title.  You'll still be
left with dead/unused space in your player file, but the cavet is ease of
use.  Converters aren't really so hard to write huh?

        Now, about the fight.c with damage messages, We really need the
errors, and I have no clue what you're talking about when you say "I added
like 3 using the same format".  Did you add a new spell/damage type and
then added the messages to the fight_message array (which in mine is
loadedfrom a file.. may differ).  Or did you add to the fight structure,
and are trying to read the wrong number of arguments from your fight
message file?  are these compiler time or run time errors?  Maybe you're
talking about the 'dam_weapons[]' which is just a simple array of
dam_weapon_type ?
        More info needed for that one.


        I do not condone the writing of shoddy converters as the one I
have outlined above :)

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 12/15/00 PST