button
November 16th 2005, 07:13 PM

RANKN67


i cant find the script in the source folder of the button to press to make the map come up, does any one no wat its called
First, you'll need Button6 ...
void main ( void )
{
//player map
show_bmp("tiles\map1.bmp", 1, 0);
kill_this_task();
}
Then you'll need s2-map...
//map stuff
void main( void )
{
//lets kill the rest by loading a blank screen.
&player_map = 11;
sp_nodraw(1, 1);
load_screen(2);
draw_screen();
//screen is blank, now what
copy_bmp_to_screen("tiles\map1.bmp");
playsound(46, 11010, 0,0,1);
int &math = 24;
&math *= &location;
&math += 200;
freeze(1);
//int &crap = say_xy("`%You are currently at location &location.", 0,385);
//make letters perm
//sp_kill(&crap, 0);
wait_for_button();
unfreeze(1);
kill_this_task();
}
Remember to put your map(called map1.bmp)in
your tiles folder.
void main ( void )
{
//player map
show_bmp("tiles\map1.bmp", 1, 0);
kill_this_task();
}
Then you'll need s2-map...
//map stuff
void main( void )
{
//lets kill the rest by loading a blank screen.
&player_map = 11;
sp_nodraw(1, 1);
load_screen(2);
draw_screen();
//screen is blank, now what
copy_bmp_to_screen("tiles\map1.bmp");
playsound(46, 11010, 0,0,1);
int &math = 24;
&math *= &location;
&math += 200;
freeze(1);
//int &crap = say_xy("`%You are currently at location &location.", 0,385);
//make letters perm
//sp_kill(&crap, 0);
wait_for_button();
unfreeze(1);
kill_this_task();
}
Remember to put your map(called map1.bmp)in
your tiles folder.
Using the button6 script works fine, it displays the map on screen (map1.bmp in the tiles folder) and kills the task afterwards.
In its current stand alone form, carrie's s2-map script could be used but you'll probably need to adjust several things because for example, this part:
//lets kill the rest by loading a blank screen.
&player_map = 11;
sp_nodraw(1, 1);
load_screen(2);
draw_screen();
serves no purpose to show the map onscreen when you can just use show_bmp() (just to simplify the solution; if you only want a map onscreen, show_bmp() suffices). Apart from the fact that it loads screen 11 and not 2 (load_screen has no parameters so it uses the &player_map screen), there's no need to do this as you can copy a bitmap on the screen without doing all this.
Changing the value of &player_map requires more work afterwards because the engine assumes the player is on map screen 11 (while he might be standing elsewhere) and it will screenscroll accordingly (so to 10 if the player goes to the left, which is not the screen you expected, unless you were at screen 11 already, of course
). The screenscroll problem doesn't occur when you can guarantee that the player can use the script only at screens that have four borders so screenscrolling can't occur, but that should be obvious (i.e., only at screens that can be visited through stairs / doors / cave-entries / etc or a cutscene).
Also, &location should be added as global for the text to work properly. The only requirement for the button6 script is that you actually need to have a file called map1.bmp in the Tiles folder but that's all - no offense to Carrie of course, it's just to explain it to someone who's new to it all and might get confused with new problems (like &location missing and the tricky screenscroll)
In its current stand alone form, carrie's s2-map script could be used but you'll probably need to adjust several things because for example, this part:
//lets kill the rest by loading a blank screen.
&player_map = 11;
sp_nodraw(1, 1);
load_screen(2);
draw_screen();
serves no purpose to show the map onscreen when you can just use show_bmp() (just to simplify the solution; if you only want a map onscreen, show_bmp() suffices). Apart from the fact that it loads screen 11 and not 2 (load_screen has no parameters so it uses the &player_map screen), there's no need to do this as you can copy a bitmap on the screen without doing all this.
Changing the value of &player_map requires more work afterwards because the engine assumes the player is on map screen 11 (while he might be standing elsewhere) and it will screenscroll accordingly (so to 10 if the player goes to the left, which is not the screen you expected, unless you were at screen 11 already, of course

Also, &location should be added as global for the text to work properly. The only requirement for the button6 script is that you actually need to have a file called map1.bmp in the Tiles folder but that's all - no offense to Carrie of course, it's just to explain it to someone who's new to it all and might get confused with new problems (like &location missing and the tricky screenscroll)

Oh! I'm offended.*rawr rawr*
But seriously, are you saying that 's2-map' is not needed but only 'button6'?
And what about attatching it to the sprite.
I mean, you need a script that will tell you that
map=1 now, right?You wouldn't just attatch
button6.c to the sprite?
Am I making things more confusing or what?
EDIT:
Okay, how about...
You take a scroll sprite and attatch 'map.c'
map.c would say...
void main ( void )
{
//player map
if (&map == 0)
{
say("Aha.A map!",1);
kill_this_task();
return;
&map = 1;
}
}
and then you would have 'button6.c'
button6.c qould say
void main ( void )
{
//player map
if (&map == 0)
{
say("I don't own a map yet.",1);
kill_this_task();
return;
}
if (&map == 1)
show_bmp("tiles\map1.bmp", 1, 0);
kill_this_task();
}
But you would still want the scroll to disappear after you have acknowledged
that you have the map.I did a vision change for the screen the map was on.
I think I also did a 'shrink' for the sprite but I don't recall the scripting for that.
So, can the above scripts be simplified even
moreso?

But seriously, are you saying that 's2-map' is not needed but only 'button6'?
And what about attatching it to the sprite.
I mean, you need a script that will tell you that
map=1 now, right?You wouldn't just attatch
button6.c to the sprite?
Am I making things more confusing or what?
EDIT:
Okay, how about...
You take a scroll sprite and attatch 'map.c'
map.c would say...
void main ( void )
{
//player map
if (&map == 0)
{
say("Aha.A map!",1);
kill_this_task();
return;
&map = 1;
}
}
and then you would have 'button6.c'
button6.c qould say
void main ( void )
{
//player map
if (&map == 0)
{
say("I don't own a map yet.",1);
kill_this_task();
return;
}
if (&map == 1)
show_bmp("tiles\map1.bmp", 1, 0);
kill_this_task();
}
But you would still want the scroll to disappear after you have acknowledged
that you have the map.I did a vision change for the screen the map was on.
I think I also did a 'shrink' for the sprite but I don't recall the scripting for that.
So, can the above scripts be simplified even
moreso?
Well yeah, you'd need to store somewhere if the player has the map or not (unless he has it from the beginning of the game), so you could use a global variable for that, or just let it coincide with the &story variable.
You'd need the button6.c script for the button and somewhere else you'd need to change a variable to the the game know that Dink has a map. If a character in the game gives it to Dink, then you can do it there or, in case you want it to be an item Dink can pickup, you'll need to make it similar to a potion/heart.
So in your scripts carrie, you'd indeed need button6 where a variable checks if the player has the map; it can be simplified to this though:
////////// button6.c
void main(void)
{
if (&map == 0)
{
say("I don't own a map yet", 1);
kill_this_task();
return;
}
show_bmp("tiles\map1.bmp", 1, 0);
kill_this_task();
}
And if you want the scroll to be an item that you can pickup, then you could do (similar to rpotion.c):
////////// mapscr.c
void main(void)
{
sp_touch_damage(¤t_sprite, -1);
}
void touch(void)
{
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
{
&map = 1;
editor_type(&hold, 1);
}
playsound(10, 22050, 0, 0, 0);
sp_brain_parm(¤t_sprite, 5);
sp_brain(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_sprite, 0);
}
Or you could just set &map to 1 in some other script.
You'd need the button6.c script for the button and somewhere else you'd need to change a variable to the the game know that Dink has a map. If a character in the game gives it to Dink, then you can do it there or, in case you want it to be an item Dink can pickup, you'll need to make it similar to a potion/heart.
So in your scripts carrie, you'd indeed need button6 where a variable checks if the player has the map; it can be simplified to this though:
////////// button6.c
void main(void)
{
if (&map == 0)
{
say("I don't own a map yet", 1);
kill_this_task();
return;
}
show_bmp("tiles\map1.bmp", 1, 0);
kill_this_task();
}
And if you want the scroll to be an item that you can pickup, then you could do (similar to rpotion.c):
////////// mapscr.c
void main(void)
{
sp_touch_damage(¤t_sprite, -1);
}
void touch(void)
{
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
{
&map = 1;
editor_type(&hold, 1);
}
playsound(10, 22050, 0, 0, 0);
sp_brain_parm(¤t_sprite, 5);
sp_brain(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_sprite, 0);
}
Or you could just set &map to 1 in some other script.
November 18th 2005, 05:24 PM

RANKN67


ok wait, which script is the better one and wat does the script that i need to use should look exactly like
You could, of course, read the posts.
November 19th 2005, 09:39 AM

RANKN67


why do u think u have to be so mean, i just want to no wich one is the better one, jees!!
Well, you asked for a buttonscript to show the map on the screen. And in the first line of my reply to carrie's post, it says that the button6.c works fine. Therefore:
button6.c:
void main(void)
{
if (&map == 0)
{
say("I don't own a map yet", 1);
kill_this_task();
return;
}
show_bmp("tiles\map1.bmp", 1, 0);
kill_this_task();
}
is what you need. You could of course change the &map variable and the map would need to be a 640*480 bmp in the Tiles directory. That's all
Strictly, the other script isn't needed so you can just use button6.c for the M-button
button6.c:
void main(void)
{
if (&map == 0)
{
say("I don't own a map yet", 1);
kill_this_task();
return;
}
show_bmp("tiles\map1.bmp", 1, 0);
kill_this_task();
}
is what you need. You could of course change the &map variable and the map would need to be a 640*480 bmp in the Tiles directory. That's all


Simeon telling you to read the very detailed and insightful posts he wrote is hardly mean.
I'm new to this forum, but have been playing dink for a few years.
uhmm, OP asked for "the name of the script in the original source", which is button6.
The discussion of changing location does sound interesting just the same.
hth adno,
mm.
uhmm, OP asked for "the name of the script in the original source", which is button6.
The discussion of changing location does sound interesting just the same.
hth adno,
mm.
November 20th 2005, 04:56 PM

RANKN67


hey millimeter, wat did u say at the end of ur post, i didnt exactly catch it
http://www.cygwin.com/acronyms/
hth = hope this helps
mm adds,
adno = and does not offend.
hth = hope this helps
mm adds,
adno = and does not offend.