Key Scripts
I need to know how to make some key scripts. They are for: a feats menu, a help menu and a menu with the new stats for my dmod. Can anyone please help me?
Check out key-80.c in the dink story directory for an example. There's a list of which numbers are which keys, but I'm oblivious to where you might find it.
WHen ur in the game press CTRL + D to enable debug mode, it will show you what key you are pressing if you are for example pressing J.
Keycodes.
If you have a 1.08 RC, there's a list of them as well in dinkc.chm.
F key = key-70.c
H key = key-72.c
S key = key-83.c
If you wanted to use other keys, you can look them up in the file I linked to. The script should be in the main() proc:
key-70.c
void main( void )
{
say("Feats!",1);
kill_this_task();
//You'll regret leaving out the kill_this_task()
//Scripts eating up memory and such nasty things.
}
If you have a 1.08 RC, there's a list of them as well in dinkc.chm.
F key = key-70.c
H key = key-72.c
S key = key-83.c
If you wanted to use other keys, you can look them up in the file I linked to. The script should be in the main() proc:
key-70.c
void main( void )
{
say("Feats!",1);
kill_this_task();
//You'll regret leaving out the kill_this_task()
//Scripts eating up memory and such nasty things.
}
I know how to find the keycodes. That's not my problem. You did guess the keys I want to use correctly, though. Well done.
My problem is that I don't know how to write a key script.
My problem is that I don't know how to write a key script.
Eh, how do you mean? They're just normal scripts like any other. So "how to write a key script":
- Open editor of choice (Notepad, EasyDinkC, etc).
- Type your script in the main() proc.
- End with kill_this_task().
- Save as key-70.c (or whatever other key you wish to use).
- Run your D-Mod
- Press "F", or whatever other key you used.
- Watch the script execute
Though I'm pretty sure you didn't mean that
key-70.c:
void main( void )
{
stop_entire_game(1);
choice_start()
set_y 240
title_start();
Feats!
title_end();
"Option 1"
"Option 2"
"Option 3"
choice_end()
if (&result == 1)
{
say("Option 1!",1);
}
if (&result == 2)
{
say("Option 2!",1);
}
if (&result == 3)
{
say("Option 3!",1);
}
kill_this_task();
}
Of course, you'll have to change the menu options and what will happen when you've made a choice, but this is the general idea.
If this isn't what you meant, what part of writing key scripts do you not get? If you've ever spawn()-ed something, key-scripts work just the same. If you haven't, forget what I said, or remember it in case you ever want to spawn().
- Open editor of choice (Notepad, EasyDinkC, etc).
- Type your script in the main() proc.
- End with kill_this_task().
- Save as key-70.c (or whatever other key you wish to use).
- Run your D-Mod
- Press "F", or whatever other key you used.
- Watch the script execute
Though I'm pretty sure you didn't mean that

key-70.c:
void main( void )
{
stop_entire_game(1);
choice_start()
set_y 240
title_start();
Feats!
title_end();
"Option 1"
"Option 2"
"Option 3"
choice_end()
if (&result == 1)
{
say("Option 1!",1);
}
if (&result == 2)
{
say("Option 2!",1);
}
if (&result == 3)
{
say("Option 3!",1);
}
kill_this_task();
}
Of course, you'll have to change the menu options and what will happen when you've made a choice, but this is the general idea.
If this isn't what you meant, what part of writing key scripts do you not get? If you've ever spawn()-ed something, key-scripts work just the same. If you haven't, forget what I said, or remember it in case you ever want to spawn().
I know about writing scripts (to some extent). But there's still a lot of DinkC I don't know and a lot about using it. I wasn't sure if there was anything special needed for doing it.