The Dink Network

Player map not changing

August 27th 2011, 03:19 AM
duckdie.gif
I want to make a script make Dink go to another screen, but it ain't workin'. The screen fades down and up and he's still on the same screen. Here's the script, with dialogue taken out
void main(void)
{
fade_down();
freeze(1);
sp_dir(1, 8);
wait(1000);
say_stop_xy("`%", 0, 200);
say_stop_xy("`%", 0, 200);
fade_up();
say_stop("?!", 1);
wait(400);
say_stop("`5!", &current_sprite);
wait(250);
say_stop("!", 1);
sp_seq (1, 108);
sp_frame(1, 2);
sp_kill_wait(1);
sp_nocontrol(1, 1)
wait(25);
playsound(9, 22050, 0, 0, 0);
say_stop("`5", &current_sprite);
wait(250);
say_stop("!", 1);
sp_seq(1, 108);
sp_frame(1, 1);
sp_kill_wait(1);
sp_nocontrol(1, 1)l
wait(25)
playsound(9, 22050, 0, 0, 0);
wait(40);
sp_seq(1, 108);
sp_frame(1, 1);
sp_kill_wait(1);
sp_nocontrol(1,1);
wait(25)
playsound(9, 22050, 0, 0, 0);
sp_seq(&current_sprite, 765);
sp_frame(&current_sprite,1);
wait(500);
say_stop(".", 1);
wait(250);
say_stop("?", 1);
wait(200);
sp_dir(1, 6);
wait(600);
sp_dir(1, 2);
wait(900);
sp_dir(1, 8);
say_stop("!", 1);
wait(200);
move_stop(1, 4, 139, 1);
say_stop("`5.", 1);
wait(500);
sp_dir(1, 6);
say_stop("?", 1);
wait(250);
say_stop("`5.", 1);
wait(250);
sp_dir(1, 2);
say_stop("?", 1);
say_stop("`5.", 1);
wait(250);
sp_dir(1, 6);
wait(500);
say_stop("`5.", 1);
say_stop("`5.", 1);
say_stop("`5.", 1);
wait(500);
say_stop("?", 1);
wait(280);
sp_dir(1, 2);
wait(500);
say_stop(".", 1);
say_stop(".", 1);
&story == 0;
fade_down();
&player_map = 582;
fade_up();
&update_status = 1;
draw_status();
unfreeze(1);
}

August 27th 2011, 04:21 AM
duckdie.gif
It works now (copied some lines from Smallwood-man, thanks Skorny), but there are two scripts for barriers that are not.
void touch(void)
{
if(&story == 1);
{
freeze(1);
move_stop(1, 2, 200, 1);
say("I don't wanna go there", 1);
unfreeze(1);
return;
}
}

Dink acts like those barriers aren't there.

void touch(void)
{
freeze(1);
move_stop(1, 8, 200, 1);
say("Don't wander!", 1);
unfreeze(1);
return;
}
August 27th 2011, 04:30 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
nsgate script - attatch to a barrier you dont want him to pass


void main(void)

{
if (&story < 1)
{
 sp_nodraw(¤t_sprite, 0);
 sp_touch_damage(¤t_sprite, -1);
}

if (&story >= 2)
{
sp_nodraw(¤t_sprite, 1);
sp_hard(¤t_sprite, 1);
draw_hard_sprite(¤t_sprite);
}
}

void touch(void)
{
if(&story < 2)
{
say("I can't get past.", 1);
move_stop(1, 8, 64, 1);
freeze(1);
unfreeze(1);
}


Change this - ¤t_sprite- to &current_sprite it messes up when i past stuff in there grrrrr
August 27th 2011, 04:38 AM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
This is probably due to the engine not checking for touch with this sprite.
To solve it give the sprite a touch damage of -1 in the main procedure.

sample code (not tested, and haven't programmed in dinkC for ages)

void main(void)
{
sp_touch_damage(&current_sprite, -1);
}
void touch(void)
{
sp_touch_damage(&current_sprite, 0);
//we don't want it to run this again
freeze(1);
int &xchange = sp_x(1, -1);
//checking for dinks location
&xchange += 50;
//increesing the x value by 50, foir moving right later
move_stop(1, 8, &xchange, 1);
//moving right to xchange. 50 pixels right of dink
unfreeze(1);

sp_touch_damage(¤t_sprite, -1);
//Now we enable touch again
}


Msdink was faster, but she forgot something important, always disable touch in the beginning of touch procedure. Or bad things can happen!
August 27th 2011, 04:40 AM
duckdie.gif
No dice D:
changed a line to this:
if (&story < 2)

but still nothin
Gonna test ipd's method
August 27th 2011, 04:53 AM
duckdie.gif
IPD's method doesn't work either! NOOOOO! I'm doomed!
August 27th 2011, 05:36 AM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
Have you asigned the script to a sprite?

Oh and also it can't be invisible, then it doesn't work.
Instead make it a normal sprite in the editor and put this in the main procedure instead, as msdink suggested (But I forgot, sorry).

void main(void)
{
sp_touch_damage(&current_sprite, -1);

sp_nodraw(&current_sprite, 1);
}


And if you want him to pass later just give him a touch damgage of 0 when a global has a certain value.
August 27th 2011, 05:54 AM
duckdie.gif
Yes. It was invisible OK, I'll check the nodraw method.
Also:
Do Story variables need to be inted? Just a suspicion. Or are they already inted?
like int &story;
Kill_this_task isn't working. When I come back in the screen the script will repeat
void main(void);
{
if(&story == 0)
{
freeze(1);
fade_up();
wait(500);
say_stop("bla bla bla!.", 1);
say_stop("bla", 1);
wait(250);
say_stop("`5bla bla bla!?", 1);
wait(250);
say_stop("bla bla.... bla bla, bla bla bla", 1);
&story == 1;

&update_status = 1;
draw_status();
unfreeze(1);
kill_this_task();
}
}

WIsh me luck with this DMOD
August 27th 2011, 06:26 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
&story == 1

This does not work, it needs to be a single "=".

And good luck! I love seeing you work on this. We'll always be here to help.
August 27th 2011, 06:28 AM
duckdie.gif
Oh. OK. Tank you.
August 27th 2011, 06:29 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
The single "=" stand for assigning a value to a variable. The double "==" is used to check its value in conditional statements. That's why you do need double "=" in if statements
August 27th 2011, 06:30 AM
duckdie.gif
Ah, I see. Thanks for that.
August 27th 2011, 06:36 AM
duckdie.gif
Get in here! Finally both the barrier and the story variables are working properly! Thanks!
Did 2 screens in 2 days.... Hmmm...
A screen a day keeps the bad scores at bay. Yes, that's my new DMODing motto!
August 27th 2011, 06:46 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
I rather like your approach to making dmods DD - doing the mapping and scripting per screen - thats a great way to do it so when you are really done - its actually totally finished - wow thats so cool
August 27th 2011, 06:47 AM
duckdie.gif
And harding. And tiling. And spriting.