Reply to Re: SeconDink Life: tweak dink code to play on real world map?
If you don't have an account, just leave the password field blank.
I've now tweaked dinkvar.c and freedink.c in the freedink source code
to pull data from a remote source, and written a trivial D-MOD to test
it. The results are at:
https://github.com/barrycarter/bcapps/tree/master/DINK/bctest
https://github.com/barrycarter/bcapps/blob/master/DINK/bc-make-screen.pl
but you unfortunately can't just download this and play it.
I made source code changes to "freedink-1.08.20090120" (the only
version that compiles for me), so you may need to make different
changes (I believe a lot of the functionality of freedink.c and
dinkvar.c has moved to other C files).
The main change I made is adding these lines to dinkvar.c:
< save_game(0);
< char cmd[200];
< sprintf(cmd,"/home/barrycarter/BCGIT/DINK/bc-make-screen.pl %d %s",num,path\
s_dmodfile(path));
< system(cmd);
[as the comments (which I don't quote above) point out, hardcoding my
home directory is not very portable]
bc-make-screen.pl is the external program that does most of the work
by reading the current state of the game (from save0.dat), creating a
single screen map.dat file, and writing story/DYNAMIC.c (which is
called per the created map.dat file).
Because the created map.dat file is only one screen, I changed:
> fseek(f, holdme, SEEK_SET);
to
< fseek(f, 0, SEEK_SET);
The changes I made to freedink.c are adding:
*pmap=34;
after every instance of:
draw_map_game();
This keeps Dink on the "same" screen, but the global variables &x, &y,
and &z (initialized in story/MAIN.C) keep track of where Dink "really"
is. This allows for an infinite number of screens.
Currently, the D-MOD just has Dink announcing his x, y, and z
coordinates as he walks around a perfectly barren world. You currently
can't change the &z coordinate, but i plan to bind the Z key for this
later.
I would appreciate thoughts, suggestions, etc.
to pull data from a remote source, and written a trivial D-MOD to test
it. The results are at:
https://github.com/barrycarter/bcapps/tree/master/DINK/bctest
https://github.com/barrycarter/bcapps/blob/master/DINK/bc-make-screen.pl
but you unfortunately can't just download this and play it.
I made source code changes to "freedink-1.08.20090120" (the only
version that compiles for me), so you may need to make different
changes (I believe a lot of the functionality of freedink.c and
dinkvar.c has moved to other C files).
The main change I made is adding these lines to dinkvar.c:
< save_game(0);
< char cmd[200];
< sprintf(cmd,"/home/barrycarter/BCGIT/DINK/bc-make-screen.pl %d %s",num,path\
s_dmodfile(path));
< system(cmd);
[as the comments (which I don't quote above) point out, hardcoding my
home directory is not very portable]
bc-make-screen.pl is the external program that does most of the work
by reading the current state of the game (from save0.dat), creating a
single screen map.dat file, and writing story/DYNAMIC.c (which is
called per the created map.dat file).
Because the created map.dat file is only one screen, I changed:
> fseek(f, holdme, SEEK_SET);
to
< fseek(f, 0, SEEK_SET);
The changes I made to freedink.c are adding:
*pmap=34;
after every instance of:
draw_map_game();
This keeps Dink on the "same" screen, but the global variables &x, &y,
and &z (initialized in story/MAIN.C) keep track of where Dink "really"
is. This allows for an infinite number of screens.
Currently, the D-MOD just has Dink announcing his x, y, and z
coordinates as he walks around a perfectly barren world. You currently
can't change the &z coordinate, but i plan to bind the Z key for this
later.
I would appreciate thoughts, suggestions, etc.