The Dink Network

Reply to Re: Key Scripts

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
February 14th 2006, 05:45 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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().