The Dink Network

what is wrong with this script

July 13th 2006, 03:36 PM
milder.gif
Can anyone tell me what is wrong with this script?
The script is attached to the first screen dink starts.
The phoenix has to come up in the west then fly to the screen to the east. Then dink must be warped to screen 2. PLEASE HELP??? THis is the first script I make and I am already stuck that sucks.

//phoenix

void main( void )
{

int &phoenix;

&phoenix = create_sprite( -500, 150, 9, 996, 1)
sp_sound(&phoenix, 50);
sp_brain(&phoenix, 9);
sp_speed(&phoenix, 2);
sp_base_walk(&phoenix, 980);
sp_timing(&phoenix, 0);
sp_pseq(&phoenix, 980);
sp_pframe(&phoenix, 1);
freeze(1);
&story = 1;
move_stop(&phoenix, 1150, 6, 1)
wait(100);
say_npc("What was that, Where am I ?????",1)
wait(100);

//move dink
script_attach(1000);
fade_down();
fill_screen(0);
&player_map=2;
sp_x(1, 325);
sp_y(1, 385);
load_screen();
draw_screen();
draw_status();
fade_up();
kill_this-task();
return;
}


I have also another question. I know and I used a script that has the spawn line in it.
It has 3 or 4 lines and the script starts with if &story=1 spawn en-phoenix.
Does anyone has that script for me I can't find it.

July 13th 2006, 04:08 PM
pq_rabbit.gif
You forgot a semicolon after the line where you created the phoenix. Add that in and see if it works.
July 13th 2006, 04:18 PM
milder.gif
Nope that wasn't the problem it still doesn't work.

Here are the INI lines for the phoenix to help to get the answer

//phoenix

load_sequence GRAPHICS\phoenix\pnix1- 981 50 168 274 -37 -126 18 -84
load_sequence GRAPHICS\phoenix\pnix3- 983 50 159 277 -33 -128 31 -85
load_sequence GRAPHICS\phoenix\pnix7- 987 50 147 251 -29 -132 25 -93
load_sequence GRAPHICS\phoenix\pnix9- 989 50 181 266 -29 -135 25 -95

load_sequence GRAPHICS\phoenix\attack\pn_m2- 992 90 168 234 -37 -34 18 34
load_sequence GRAPHICS\phoenix\attack\pn_m4- 994 90 105 277 -33 -41 31 41
load_sequence GRAPHICS\phoenix\attack\pn_m6- 996 90 168 286 -29 -43 25 43
load_sequence GRAPHICS\phoenix\attack\pn_m8- 998 90 180 180 -29 -35 25 35

set_frame_delay 992 6 120
set_frame_delay 994 6 120
set_frame_delay 996 6 120
set_frame_delay 998 6 120

July 13th 2006, 04:20 PM
burntree.gif
Striker
Noble She/Her United States
Daniel, there are clowns. 
Okay, after a quick glance, I have spotted a few things.

Firstly, since you assigned &phoenix with brain 9, you should probably use freeze(&phoenix); so it doesn't move around. The second thing is that before you kill_this_task(); (which is misspelled in your version), you should unfreeze(1);.

Also, in the future, it would be helpful if you posted what exactly happens in the game when you run your script is run. I don't see any reason why you need a spawn command for any of this, either.
July 13th 2006, 04:41 PM
milder.gif
I use the spawn script not for this script but later in the game.

I changed the script into this one and it still doesn't work.
I hear the sound of the phoenix but he doesn't show up in the screen and dink can't warp to screen 2 because he is freezed.

//phoenix

void main( void )
{
int &phoenix;

&phoenix = create_sprite( -500, 150, 9, 996, 1);
sp_sound(&phoenix, 50);
sp_brain(&phoenix, 9);
sp_speed(&phoenix, 2);
sp_base_walk(&phoenix, 980);
sp_timing(&phoenix, 0);
sp_pseq(&phoenix, 980);
sp_pframe(&phoenix, 1);
freeze(1);
freeze(&phoenix);
&story = 1;
move_stop(&phoenix, 1150, 6, 1);
wait(100);
say_npc(''What was that, Where am I ?????", 1);
wait(100);

//move dink
script_attach(1000);
fade_down();
fill_screen(0);
&player_map=2;
sp_x(1, 325);
sp_y(1, 385);
load_screen();
draw_screen();
draw_status();
fade_up();
unfreeze(1);
kill_this_task();
return;
}
July 13th 2006, 09:41 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
First, try creating the phoenix so he's on the screen. Then you can see if the sprite is being created. If you don't see it, check the editor to see if the dink.ini lines are correct.
July 14th 2006, 02:39 AM
milder.gif
Yes, I have it working. My phoenix fly's through the screen and dink says something then he is moving to the next screen. I am so happy that it is working.

But does noone has the spawn script for me?
July 14th 2006, 06:05 PM
burntree.gif
Striker
Noble She/Her United States
Daniel, there are clowns. 
I'm not sure anyone knows what you're talking about in regards to the spawn script.
July 14th 2006, 06:11 PM
milder.gif
It is a script with the first line if &story == 1
the second line will be spawn example.c

That are the only two lines I can remember of that script. But I also know that the script contains three or four lines.

Maybe now I have explained it more people might know where I am talking about.
July 14th 2006, 07:04 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Erm... I might help, but what should the script do? And what does en-phoenix do (from original post)>
July 15th 2006, 03:24 AM
milder.gif
I use the spawn script for screens when &story = ??? that I can let a script for a cutscene running.

About the phoenix that is my dmod dink is seeing him.
July 15th 2006, 08:03 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
You can just attach a script to the map with:

void main( void )
{
if (&story == cutscene_worty)
{
//cutscene stuff here
}
}

If en-phoenix is the cutscene then I would advise not using this name. Otherwise:

void main( void )
{
if (&story == cutscene_worthy)
{
spawn("cutscene");
//nothing here! spawn() won't stop this script!
}
}

Then in cutscene.c:

void main( void )
{
//cutscene stuff here
kill_this_task();
}

Alternatively, this should also work:

void main( void )
{
if (&story == cutscene_worthy)
{
external("cutscene","phoenix");
//maybe something here, external() stops this script.
}
}

Then in cutscene.c:

void phoenix( void )
{
//cutscene stuff here
}