==================================
typedef char TPLAYFIELD [16][16]; // Matrix of G.O.
typedef struct tLevel // Level Data from File
{
TPLAYFIELD PF; // Object Grid
char LName[31]; // Level Name
char Hint[256]; // Hint for this level
char Author[31]; // the Author of the Level
WORD SDiff; // Score Difficulty
}TLEVEL;
typedef struct tHSRec // High Score Record
{
WORD moves, shots;
char name[6]; // Initials
}THSREC;
==================
Harvy, you are correct that the best way to compare the levels would
be to compare the playfield's. Here is how I would do the program.
1) scan Temp.hs for a score
2) if a score is found then load the level data from the Temp.lvl file
3) then compare all 256 chars with each level in the lasertank.lvl
file until a match is found.
4) when a match is found then load the LaserTank.hs file and check to
see which score is better.
5) if score from Temp.lvl is better then write over lasertank.lvl
6) Repeat for all of temp.lvl
If you make this program please upload it and maybe the source code
to this group when you are done.
Jim
P.S. if you need any code from me, Ask :)
--- In Lasertank@y..., hbsolom@s... wrote:
> Jim & Donald
> Unfortunately I didn't record any of the levels that I
completed.
> Donald's suggestion to manually enter the High Scores data is NOT
> practical for the 1000+ levels I want to copy (Donald - thanks for
> the idea anyway).
> I can write the program Jim suggested (to copy old "hs" data to
> another "hs" file), if someone can explain how data is stored
in .hs
> files. Specifically, given a level number, how do I;
> (1) Read its "hs" data from a .hs file, i.e., locate &
> unscramble the # of shots, # of moves & user ID, and
> (2) Write its "hs" data to a .hs file, i.e., ... scramble ...
> Since the level name is an unreliable guide, I would require a
> match of the two 16x16 byte level definitions (in the .lvl files)
> before copying the "hs" data. {Note, I think I understand the
> syntax of .lvl files, i.e., each level consists of a 16x16 byte
> definition followed by a 20x16 byte name/hint/... field, and the
> n-th level starts at byte no. 576*(n-1) + 1}.
> Harvey
>
>
> --- In Lasertank@y..., "Jim Kindley" <jkindley@p...> wrote:
> > If you recorded the levels you played, then you could import the
> > playbacks with the "Import" program. But that would be the only
way.
> > Maybe someone could write a small program to scan old "lvl"
& "HS"
> > files and import the data into another "HS" file if the level
name
> is
> > the same. It wouldn't be all that hard to write.
> > I think a few of the level names have changed which would cause
us
> > problems. The worst would be where I have found a name in the
temp
> > file that was the same in the Ltank.lvl file, I would of changed
> the
> > name to "name 2" and the import program would look for "name" and
> > overwrite the wrong high score. I don't know of a way around this
> > problem.
> >
> > Jim
> > --- In Lasertank@y..., hbsolom@s... wrote:
> > > First let me add my thanks to Mr. Kindley for inventing LT,
and
> > > Mr. Drouin for maintaining this group.
> > > Before upgrading to v.4, I completed approx. 90% of the 770
> > levels
> > > in v.3. I also completed approx. 90% of the 869 levels in the
> > > Temp.lvl file dated 15-Dec-00, and the levels in the .lvl files
> > > downloaded (on 14-Jun-01) from the "LEVELS DATA" page. As you
> know
> > > most of these levels were incorporated into the LaserTank.lvl
> file
> > > included with v.4. However, my High Scores for these levels
were
> > not
> > > copied to the LaserTank.hs file. So, even with "Skip Completed
> > > Levels" checked, I see more than 1000 levels that I've
completed.
> > > Is there any way to get 'credit' (in LaserTank.hs) for these
> > > completed levels? In other words, is there a way to copy the
> High
> > > Scores from one .hs file (e.g., Temp.hs) to another (e.g.,
> > > LaserTank.hs)?
> > > Harvey (DrWiseKing)