The Dink Network

Dink Won't Freeze During Intro

September 12th 2006, 12:24 AM
death.gif
He doesn't, and the wizard won't appear... what am I doing wrong?

void main (void);
{
freeze(1);
script_attach(1000);
wait(200);
say_stop("blahblah.", 1);
wait(200);
move_stop(1, 6, 477, 1);
wait(200);
sp_dir (1, 2);
wait(200)
say_stop("hehehehehe1);
wait(200);
move_stop(1, 8, 86, 1);
wait(200);
sp_dir (1, 2);
say_stop("blahblahblah...", 1);
wait(200);
say_stop("blah...", 1);
wait(500);
int &wizard = (create_sprite(620, 177, 0, 561, 1);
sp_base_walk (&wizard, 560);
sp_speed (&wizard, 5);
move_stop(&wizard, 4, 344, 1);
wait(100);
sp_dir (&wizard, 9);
say_stop("`2Dink!",&wizard);
wait(200);
say_stop("blah?!", 1);
wait(200);
say_stop("`king blahblahblah.", &wizard);
wait(200);
say_stop("blahblahblah quest.", 1);
wait(200);
say_Stop("blahblahblahblahblah-blah-balhblahblahblah...", 1);
int &1 = (create_sprite(466, 67, 7, 167, 1);
sp_sequence(&1, 167);
int &2 = (create_sprite(332, 166, 7, 167, 1);
sp_sequence(&2, 167);
wait(1000);


HELP
September 12th 2006, 01:27 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
I had a similar problem once when doing an intro for my dmod. Try putting wait(1); in the beginning of the script. That seemed to work, at least for me. Are you going to do a screenchange? If not, I think you won't need script_attach(1000);.

And replace this: int &wizard = (create_sprite(620, 177, 0, 561, 1); => int &wizard = create_sprite(620, 177, 0, 561, 1);

EDIT: And try preloading the wizard's sequences!
September 12th 2006, 01:30 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
Uh, maybe I'll just try to fix it for you. Try this:

void main (void);
{
preload_seq(561);
preload_seq(563);
preload_seq(567);
preload_seq(569);
wait(1);
freeze(1);
script_attach(1000);
wait(200);
say_stop("blahblah.", 1);
wait(200);
move_stop(1, 6, 477, 1);
wait(200);
sp_dir(1, 2);
wait(200)
say_stop("hehehehehe1);
wait(200);
move_stop(1, 8, 86, 1);
wait(200);
sp_dir(1, 2);
say_stop("blahblahblah...", 1);
wait(200);
say_stop("blah...", 1);
wait(500);
int &wizard = create_sprite(620, 177, 0, 561, 1);
sp_base_walk(&wizard, 560);
sp_speed(&wizard, 5);
move_stop(&wizard, 4, 344, 1);
wait(100);
sp_dir(&wizard, 9);
say_stop("`2Dink!",&wizard);
wait(200);
say_stop("blah?!", 1);
wait(200);
say_stop("`king blahblahblah.", &wizard);
wait(200);
say_stop("blahblahblah quest.", 1);
wait(200);
say_Stop("blahblahblahblahblah-blah-balhblahblahblah...", 1);
int &1 = create_sprite(466, 67, 7, 167, 1);
sp_sequence(&1, 167);
int &2 = create_sprite(332, 166, 7, 167, 1);
sp_sequence(&2, 167);
wait(1000);
}

EDIT: Hm. I'm not really sure is the wait(1); necessary...
September 12th 2006, 03:48 AM
death.gif
Alright... For unknown reasons, the wait(1); seems to work... good job.
September 12th 2006, 11:26 AM
pillbug.gif
Drink
Peasant He/Him Chile
Don't drink 
So much people repeat this error ( the "{" and "}").

If I could recommend a good practice, it would be to:

- After writing the usual "void main" or similar, to immediately put the "{" and "}", and THEN writing between them.

Example:
void main (void)
{
//write here
}

- Same for other situations, like "ifs", even if you have not write anything on them.

Example
...
{
if (&A==0)
{
if (&B==1)
{
if (&C==2)
{
}
}
}
}

This method really helps to avoid getting those unfindable problems caused by missing braces (very common to people that is learning to make a DMod, as I see).
September 12th 2006, 12:14 PM
wizardb.gif
Phoenix
Peasant He/Him Norway
Back from the ashes 
Also, use indentation! It helps you so much knowing which level of braces you're at.
September 12th 2006, 04:40 PM
death.gif
Yeah, thats helpful... but that is not the problem that I was having... If you look, you can see that there is only one set of braces... that is all that I really need for this script... Also, I tend to use cypry's editor if I cannot find a certain error... as to the wizard... I had put &wizard = create_sprite.... instead of int &wizard = create_sprite... I did not include the end brace because I missed that line when I copied and pasted...(sigh).
September 13th 2006, 01:12 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
void main (void);

Am I the only one to think that the semicolon shouldn't be there?

Oh, and if you use script_attach(1000); don't forget to put a kill_this_task(); command at the end.
September 13th 2006, 05:27 PM
death.gif
Hmmm, I always have put a semi-colon there, and I have never had any problems... actually, from what I understand, we actually do not even need any of the semi-colons... But I will place them anyway.
September 14th 2006, 02:14 PM
wizardb.gif
merlin
Peasant He/Him
 
No semicolon after void main().
September 14th 2006, 05:14 PM
death.gif
you forgot the void inbetween the ().
September 14th 2006, 05:31 PM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
you forgot the void inbetween the ().

It's not necessary.
September 14th 2006, 05:40 PM
death.gif
I'm a masochist, and I will continue to put voids in that void as long as I can script
September 15th 2006, 03:16 PM
knightg.gif
cypry
Peasant He/Him Romania
Chop your own wood, and it will warm you twice. 
My editor found a few errors:
Line#1 - Error: Only "{" accepted after void declaration
Line#10 - Error: "(" required after a function
Line#11 - Error: ";" required at the end of the line
Line#12 - Error: Too few parameters for "say_stop" function
Line#16 - Error: "(" required after a function
Line#21 - Error: "(" not allowed before a function
Line#22 - Error: "(" required after a function
Line#23 - Error: "(" required after a function
Line#26 - Error: "(" required after a function
Line#36 - Error: "(" not allowed before a function
Line#37 - Error: Unknow DinkC command : "sp_sequence"
Line#38 - Error: "(" not allowed before a function
Line#39 - Error: Unknow DinkC command : "sp_sequence"

The "(" required after a function -error, you may ignore it, because I think that my editor expects to find "(" just after the function call. Replace sp_sequence with sp_seq.