The Dink Network

Escape

August 2nd 2003, 11:09 AM
anon.gif
Crazy Cross
Ghost
 
Does anyone know how I can edit the escape bar script?
August 2nd 2003, 11:30 AM
peasantmb.gif
Search at the script source of original Dink game the script called "Escape.c".
August 2nd 2003, 11:53 AM
spike.gif
Weirdo
Peasant
 
But, all the scripts are compiled in .d format.

You could check for the escape source code in FIAT source code or any other d-mod that utilises the escape menu.
August 2nd 2003, 11:57 AM
wizardb.gif
merlin
Peasant Male
 
That's what the source.zip (or similar name) in the development directory is for.
August 2nd 2003, 12:06 PM
anon.gif
Crazy Cross
Ghost
 
But aren't there many source releases?
August 2nd 2003, 02:01 PM
fish.gif
Binirit
Peasant Female
 
The original Dink has one on the CD-rom. Don't know if the download file on DN has one. And a lot of D-mods are released with .c files.
August 2nd 2003, 02:11 PM
peasantmb.gif
Don't know if the download file on DN has one.

It does. Where? At the develop dir at the main Dink Smallwood folder.

C:\Program Files\Dink Smallwood\develop\source.zip
August 2nd 2003, 05:15 PM
anon.gif
Crazy Cross
Ghost
 
Thank you!
August 2nd 2003, 07:13 PM
anon.gif
Crazy Cross
Ghost
 
I modified one small thing in the script and next thing ya know, it freezes anytime you press escape. Does anyone know what's wrong with it?

//this is run when the escape key is pressed

void main(void)
{
int &old_result;
Playsound(18, 22050, 0,0,0);
freeze(1);
help:

choice_start();
"Load a previously saved game"
"Restart"
"Quit to Windows"
"Help"
"Continue"
"View/change gamepad buttons"
if (&game == 1) "Greed Speed (save before playing)"
choice_end();

if (&result == 7)
{
title_start()
"You must save your game before continuing!"
title_end()

choice_start()
"Yes, I saved"
"No, I didn't save"
choice_end()

if (&result == 1)
{
fade_down();
fill_screen(0);
&player_map = 1;
sp_x(1, 307);
sp_y(1, 341);
script_attach(1000);
load_screen();
draw_screen();
draw_status();
fade_up();
kill_this_task();

}

if (&result == 2)
{
goto HELLO
}

HELLO:

if (&result == 1)
{
choice_start();
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"Nevermind"
choice_end();
if (&result == 11) goto help;

if (game_exist(&result) == 0)
{

unfreeze(1);
wait(2000);
Say("Wow, this loaded game looks so familiar.", 1);
kill_this_task();
return;
}

init("load_sequence_now graphics\dink\walk\ds-w1- 71 43 38 72 -14 -9 14 9");
init("load_sequence_now graphics\dink\walk\ds-w2- 72 43 37 69 -13 -9 13 9");
init("load_sequence_now graphics\dink\walk\ds-w3- 73 43 38 72 -14 -9 14 9");
init("load_sequence_now graphics\dink\walk\ds-w4- 74 43 38 72 -12 -9 12 9");

init("load_sequence_now graphics\dink\walk\ds-w6- 76 43 38 72 -13 -9 13 9");
init("load_sequence_now graphics\dink\walk\ds-w7- 77 43 38 72 -12 -10 12 10");
init("load_sequence_now graphics\dink\walk\ds-w8- 78 43 37 69 -13 -9 13 9");
init("load_sequence_now graphics\dink\walk\ds-w9- 79 43 38 72 -14 -9 14 9");

init("load_sequence_now graphics\dink\idle\ds-i2- 12 250 33 70 -12 -9 12 9");
init("load_sequence_now graphics\dink\idle\ds-i4- 14 250 30 71 -11 -9 11 9");
init("load_sequence_now graphics\dink\idle\ds-i6- 16 250 36 70 -11 -9 11 9");
init("load_sequence_now graphics\dink\idle\ds-i8- 18 250 32 68 -12 -9 12 9");

init("load_sequence_now graphics\dink\hit\normal\ds-h2- 102 75 60 72 -19 -9 19 9");
init("load_sequence_now graphics\dink\hit\normal\ds-h4- 104 75 61 73 -19 -10 19 10");
init("load_sequence_now graphics\dink\hit\normal\ds-h6- 106 75 58 71 -18 -10 18 10");
init("load_sequence_now graphics\dink\hit\normal\ds-h8- 108 75 61 71 -19 -10 19 10");

unfreeze(1);
load_game(&result);
&update_status = 1;
draw_status();

kill_this_task();
}

if (&result == 3)
{
choice_start();
"Yes, I really want to quit the game"
"I was just kidding, back to the action, please"
choice_end();
if (&result == 2)
{
wait(300);
say("Phew, that was a close one!",1);
}
if (&result == 1)
{
kill_game();
}
unfreeze(1);
kill_this_task();
}

if (&result == 4)
{
helpstart:
choice_start();
set_y 240
title_start();

What would you like help on?
title_end();
"Keyboard commands"
"How to save the game"
"Done"
choice_end();
Debug("Ok, result is &result");

if (&result == 1)
{
choice_start();
set_y 240
title_start();
Ctrl = Attack/choose
Space = Talk/examine/skip text
Shift = Magic
Enter = Item/magic equip screen

Use the arrow keys to move. Joystick and control pad are also supported.
title_end();
"Ok"
choice_end();
goto helpstart;
}

if (&result == 2)
{
choice_start();
set_y 240
title_start();
In this quest, saving your game can
only be done at the special 'Save
Machine'. (it hums strangely)

title_end();
"Ok"
choice_end();
goto helpstart;
}

if (&result == 3)
{
goto help;
}

}

if (&result == 2)
{
choice_start();
"Yes, I really want to restart from scratch"
"No, go back!"
choice_end();
if (&result == 2)
{
goto help;
}
if (&result == 1)
{
unfreeze(1);
restart_game();
kill_this_task();
}
unfreeze(1);
kill_this_task();
}

if (&result == 6)
{
buttonstart:
choice_start();
"Button 1 - &buttoninfo"
"Button 2 - &buttoninfo"
"Button 3 - &buttoninfo"
"Button 4 - &buttoninfo"
"Button 5 - &buttoninfo"
"Button 6 - &buttoninfo"
"Button 7 - &buttoninfo"
"Button 8 - &buttoninfo"
"Button 9 - &buttoninfo"
"Button 10 - &buttoninfo"
"Nevermind"
choice_end();

if (&result != 11)
{
&old_result = &result;
choice_start();
set_y 140
title_start();
What should button &old_result do?
title_end();
"Attack"
"Talk/look"
"Magic"
"Item screen"
"Main menu"
"View map (if you have one)"
"Nevermind"
choice_end();
if (&result < 7)
set_button(&old_result, &result);

goto buttonstart;
}

goto help;

}

if (&result == 7)
{
choice_start();
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"Nevermind"
choice_end();

save_game(&result);

}

unfreeze(1);

August 2nd 2003, 09:13 PM
custom_simon.gif
SimonK
Peasant Male Australia
 
You have an if statement before the condition in the first choice statement... that might be it... try removing it.
August 2nd 2003, 10:39 PM
wizardg.gif
Paul
Peasant Male United States
 
To expand on that, the (&game == 1) part should be okay, but you don't put "if" before it when you used it in a Choice.
August 3rd 2003, 12:26 AM
goblinh.gif
Xanthos
Peasant Male
 
In addition to what SimonK and Paul said. You also should probably fix the following.

title_start()
"You must save your game before continuing!"
title_end()

choice_start()
"Yes, I saved"
"No, I didn't save"
choice_end()

First off the title_start()/end() block should be within the choice_start()/end() block as far as I know.

Second the title_start()/end() functions calls should end with semicolons, just to be safe (for some reason this is not required with choice_start()/end()).
August 3rd 2003, 11:37 AM
anon.gif
Crazy Cross
Ghost
 
Well, thanks for the reply, but for some reason, only the Continue and Greed Speed choices will work. Am I still doing something wrong?

//this is run when the escape key is pressed

void main(void)
{
int &old_result;
Playsound(18, 22050, 0,0,0);
freeze(1);
help:

choice_start();
"Load a previously saved game"
"Restart"
"Quit to Windows"
"Help"
"Continue"
"View/change gamepad buttons"
(&game == 1) "Greed Speed (save before playing)"
choice_end();

if (&result == 5)
{
unfreeze(1);
kill_this_task();
}

if (&result == 7)
{

choice_start()
title_start();
"You must save your game before continuing!"
title_end();
"Yes, I saved"
"No, I didn't save"
choice_end()

if (&result == 1)
{
fade_down();
fill_screen(0);
&player_map = 1;
sp_x(1, 307);
sp_y(1, 341);
script_attach(1000);
load_screen();
draw_screen();
draw_status();
fade_up();
kill_this_task();

}

if (&result == 2)
{
goto HELLO
}

if (&result == 1)
{
HELLO:
choice_start();
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"Nevermind"
choice_end();
if (&result == 11) goto help;

if (game_exist(&result) == 0)
{

unfreeze(1);
wait(2000);
Say("Wow, this loaded game looks so familiar.", 1);
kill_this_task();
return;
}

init("load_sequence_now graphics\dink\walk\ds-w1- 71 43 38 72 -14 -9 14 9");
init("load_sequence_now graphics\dink\walk\ds-w2- 72 43 37 69 -13 -9 13 9");
init("load_sequence_now graphics\dink\walk\ds-w3- 73 43 38 72 -14 -9 14 9");
init("load_sequence_now graphics\dink\walk\ds-w4- 74 43 38 72 -12 -9 12 9");

init("load_sequence_now graphics\dink\walk\ds-w6- 76 43 38 72 -13 -9 13 9");
init("load_sequence_now graphics\dink\walk\ds-w7- 77 43 38 72 -12 -10 12 10");
init("load_sequence_now graphics\dink\walk\ds-w8- 78 43 37 69 -13 -9 13 9");
init("load_sequence_now graphics\dink\walk\ds-w9- 79 43 38 72 -14 -9 14 9");

init("load_sequence_now graphics\dink\idle\ds-i2- 12 250 33 70 -12 -9 12 9");
init("load_sequence_now graphics\dink\idle\ds-i4- 14 250 30 71 -11 -9 11 9");
init("load_sequence_now graphics\dink\idle\ds-i6- 16 250 36 70 -11 -9 11 9");
init("load_sequence_now graphics\dink\idle\ds-i8- 18 250 32 68 -12 -9 12 9");

init("load_sequence_now graphics\dink\hit\normal\ds-h2- 102 75 60 72 -19 -9 19 9");
init("load_sequence_now graphics\dink\hit\normal\ds-h4- 104 75 61 73 -19 -10 19 10");
init("load_sequence_now graphics\dink\hit\normal\ds-h6- 106 75 58 71 -18 -10 18 10");
init("load_sequence_now graphics\dink\hit\normal\ds-h8- 108 75 61 71 -19 -10 19 10");

unfreeze(1);
load_game(&result);
&update_status = 1;
draw_status();

kill_this_task();
}

if (&result == 3)
{
choice_start();
"Yes, I really want to quit the game"
"I was just kidding, back to the action, please"
choice_end();
if (&result == 2)
{
wait(300);
say("Phew, that was a close one!",1);
}
if (&result == 1)
{
kill_game();
}
unfreeze(1);
kill_this_task();
}

if (&result == 4)
{
helpstart:
choice_start();
set_y 240
title_start();

What would you like help on?
title_end();
"Keyboard commands"
"How to save the game"
"Done"
choice_end();
Debug("Ok, result is &result");

if (&result == 1)
{
choice_start();
set_y 240
title_start();
Ctrl = Attack/choose
Space = Talk/examine/skip text
Shift = Magic
Enter = Item/magic equip screen

Use the arrow keys to move. Joystick and control pad are also supported.
title_end();
"Ok"
choice_end();
goto helpstart;
}

if (&result == 2)
{
choice_start();
set_y 240
title_start();
In this quest, saving your game can
only be done at the special 'Save
Machine'. (it hums strangely)

title_end();
"Ok"
choice_end();
goto helpstart;
}

if (&result == 3)
{
goto help;
}

}

if (&result == 2)
{
choice_start();
"Yes, I really want to restart from scratch"
"No, go back!"
choice_end();
if (&result == 2)
{
goto help;
}
if (&result == 1)
{
unfreeze(1);
restart_game();
kill_this_task();
}
unfreeze(1);
kill_this_task();
}

if (&result == 6)
{
buttonstart:
choice_start();
"Button 1 - &buttoninfo"
"Button 2 - &buttoninfo"
"Button 3 - &buttoninfo"
"Button 4 - &buttoninfo"
"Button 5 - &buttoninfo"
"Button 6 - &buttoninfo"
"Button 7 - &buttoninfo"
"Button 8 - &buttoninfo"
"Button 9 - &buttoninfo"
"Button 10 - &buttoninfo"
"Nevermind"
choice_end();

if (&result != 11)
{
&old_result = &result;
choice_start();
set_y 140
title_start();
What should button &old_result do?
title_end();
"Attack"
"Talk/look"
"Magic"
"Item screen"
"Main menu"
"View map (if you have one)"
"Nevermind"
choice_end();
if (&result < 7)
set_button(&old_result, &result);

goto buttonstart;
}

goto help;

}

if (&result == 7)
{
choice_start();
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"&savegameinfo"
"Nevermind"
choice_end();

save_game(&result);

}

unfreeze(1);

August 3rd 2003, 12:31 PM
custom_king.png
redink1
King Male United States xbox steam bloop
A mother ducking wizard 
You need to close if (&result == 7) like this:

if (&result == 7)
{

choice_start()
title_start();
"You must save your game before continuing!"
title_end();
"Yes, I saved"
"No, I didn't save"
choice_end()

if (&result == 1)
{
fade_down();
fill_screen(0);
&player_map = 1;
sp_x(1, 307);
sp_y(1, 341);
script_attach(1000);
load_screen();
draw_screen();
draw_status();
fade_up();
kill_this_task();

}

if (&result == 2)
{
goto HELLO
}

//Closed!
}

if (&result == 1)
August 3rd 2003, 02:01 PM
anon.gif
Crazy Cross
Ghost
 
Thanks a lot