The Dink Network

Dink's Map - How does it work?

February 6th, 01:12 PM
Peasant Male New Zealand xbox steam
Don't look at me, I'm a ghost 
You've all played Dink Smallwood. You've gotten out of the house, met the wizard, and made your way to Terris. But more importantly, Dink is given a map to look at from ingame, showing landmarks and where he is in relation to it all.


I looked at the original Dink, and all I can see so far from "s1-ltr.c" is this:
 say_stop("Hey!  A map was enclosed!", 1);
 &s2-map = 1;
 say_stop_xy("`%(Press M or button 6 for map toggle)", 20,380);

&s2-map also being listed as a global variable in Main.c.
Results of this investigation? Nothing useful.

As a test, I created a key-77.c script. By default, there isn't one. Nor a script named "Map".
Key 76 (L) and Key 78(N) are both listed in the DinkC reference book in alphabetical order so this should mean Key 77 is the letter M - Also known as the Map key. (A quick google search confirms this)

//Key script mapped to 'M' to test map replacement

void main(void)
  say_stop("Maps? MEN DON'T USE MAPS!", 1);
  debug("M key pressed! Did this get detected?");

First of all, the script didn't run. At all. Dink just says as he normally does "I don't have a map yet." as his default when he doesn't 'have one'.
Secondly it never even appeared in the debug.txt anywhere that I could see.

So... is it possible to do anything to the ingame map function of Dink besides adding or removing a map? Can the M key be free to access with a key-77.c script at all?
February 6th, 02:30 PM
Peasant Male United Kingdom steam
I was working on an unreleased DMOD a while ago and remember coming across this same problem. Can't remember exactly where I found the answer, but from reopening it and taking a look it seems everything needs to be placed into button6.c rather than key-77.c. I used this to create a sort of single player co-op game a bit like Resident Evil 0, as I think button6 meant it could also be accessed by App users on a phone instead of being exclusive to keyboard.
February 6th, 05:02 PM
King Male United States xbox steam bloop
A mother ducking wizard 
Yep, button6.c support has been in place since the beginning. Key-##.c support was added fairly late (with Mystery Island, around v1.05 I think?)
February 6th, 06:43 PM
Peasant Male Equatorial Guinea xbox steam duck bloop
can't flim flam the glim glam 
duckin magnets. how do they work
February 6th, 07:30 PM
Well that explains a lot; So the button6.c script overwrites the key-77 script.
That's annoying. Thanks for the info.

Turns out it's just a normal script at least.

void main ( void )
//player map

if (&s2-map == 0)
   say("I don't own a map yet.",1);

show_bmp("tiles\map1.bmp", 1, 0);

February 7th, 04:04 AM
Peasant Male New Zealand bloop
Only paritally dead. 
But isn't it supposed to place a little star on the square that Dink's on if it's not listed as "inside" or whatever?
February 7th, 12:21 PM
Peasant Male United States bloop
2nd generation. No easy way to be free. 
(The following is from "DINKC Reference v3.1".)

# Category: Screen Drawing
# Prototype:
# void show_bmp( char string[200], bool over_position?, int unused );

["string" is a filename and directory, relative to the DMod's directory.]

show_bmp("tiles\crap.bmp", 0,0);

The first # parm [<over_position?>] tells [the dink engine] to show a cross
hair of their position on the map, used in Dink to show the location, only
works if you make the map from a screen shot from DinkEdit.