[Ohrrpgce] slice lookup codes

Ralph Versteegen teeemcee at gmail.com
Wed Feb 22 00:01:43 PST 2012


On 22 February 2012 07:31, James Paige <Bob at hamsterrepublic.com> wrote:
> I was thinking about slice lookup codes. They do pretty much just what I
> want them to do in an individual game, but they are pretty useless when
> you export a collection of slices from one game and import it into
> another game.
>
> Slice names are stored in the slicelookup.txt lump, so they are
> game-specific.
>
> When a slice collection is exported, I would like to save the name of
> the lookup code instead of the number. When a slice collection is imported,
> I could look for matching names, use the existing code if possible, or
> add new codes automatically if they don't exist.
>
> Right now, saving and export are the same, and loading and
> importing are the same. If I make saving lookup codes as text a thing
> that only happens in export, it means a split code path. If I make all
> lookup codes saved as strings I am worried about possible undesired
> side-effects.
>
> I suppose that saving could save BOTH the lookup code number and the
> lookup code name, and then only the loading/importing code would need to
> diverge... I also suppose that the divergence would actually be
> relatively clean and simple, so it might not be a problem at all.
>
> I am just thinking out loud here, but if anybody has any thoughts on the
> subject, feel free to speak up :)
>
> ---
> James

I think that both the code number and name should be saved, always
(for non-special lookup codes). There would not need to be separate
import/load code paths either: just verify that the lookup code is the
same as the name in slicelookup.txt when loading. If the entry in
slicelookup.txt doesn't actually blank, then reuse the same lookup
number (since this might be important), otherwise assign a new number.



More information about the Ohrrpgce mailing list