Re: [CODE] Restring

From: Fafhrd (fafhrd@greyhawk.org)
Date: 02/03/99


Its not as tough as you think to save the strings, you simply need to give
them a maximum size. Code is not in front of me, but you just declare them
something like
char saved_item->short[80]
char saved_item->long[80]
int saved_item->vnum
etc.
Then in the actual saving (obj_to_store I think), you simply copy over the
string to the new holder, dumping any excess there may be (If your builders
even use 2+ line shorts/longs, which would look goofy anyways). Saving
descriptions is a bit tougher, in that those vary drastically in length.
However, you only need to save them if they are different from the original
prototype, so chances are you're only saving descriptions your code is
re-stringing. (describing the broken sword eg). Coders are much easier to
beat a set length into than your builders are :)

Erik Madison
ICQ #13940294
www.greyhawk.org
fafhrd@greyhawk.org
-----Original Message-----
From: Christoffer Lundberg <avatar@orion.boden.se>
To: CIRCLE@post.queensu.ca <CIRCLE@post.queensu.ca>
Date: Wednesday, February 03, 1999 9:41 AM
Subject:  [CODE] Restring


>Well, as I saw in older messages about Restringing Objects, it is
>not possible to make such a code due to that the string will not be
>saved. But, what all other things that are saved on objects.
>   For example, I cast 'enchant weapon' on my staff, and it receives
>+damroll/+hitroll and becomes "Magical". These things are saved, so
>shouldn't a changed obj->short_desc/long_desc/name be saved as well?
>
>Just a thought.....
>
> _______________
>() Christoffer  )
> | ~~~~~~~~~~~ |
> | Implementor |
> |     o f     |
> |   Legends   |
> |             |
> |  stargate.  |
> |   orion.    |
> |   boden.    |
> |  se  5007   |
> | ___________ |
>()______________)
>
>
>     +------------------------------------------------------------+
>     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
>     +------------------------------------------------------------+


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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