The Dink Network

Reply to Re: Why Can't I Quit You, DinkC?

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:
 
 
November 5th 2013, 10:21 PM
peasantm.gif
shevek
Peasant They/Them Netherlands
Never be afraid to ask, but don't demand an answer 
I'd like to see that code, actually

I was talking about your example, so I think you have the code.

Anyway, I just checked, and it is correct that returning from a function will make the script resume, no matter what it was waiting for (I tested wait, move_stop and say_stop; are there any others?) Here's the script:

void main ()
{
        wait (1); // This is required.
        run ();
        // This is not reached if you talk to the sprite in time.
        freeze (1);
        say_stop ("Too late!", &current_sprite);
        unfreeze (1);
}

void run ()
{
        wait (5000); // 5 seconds after the script starts, resume something.
}

void talk ()
{
        freeze (1);
        move_stop (&current_sprite, 6, 600, 1);
        // Execution can resumed from here before  the move is completed.
        say_stop ("Somebody stop me!", &current_sprite);
        unfreeze (1);
}


If you talk to the sprite within 5 seconds of entering the screen (or in my case, with a single-screen test dmod, starting the dmod), it will talk when those 5 seconds are up, and then dink unfreezes. Effectively, this turns the move_stop into a move (the move does continue, and it does stop when it reaches 600).

In Freedink it doesn't underline, it just prints the & sign. The underlining sounds like a failed attempt to provide this as a "color". After all, underlining was treated as a color code on ancient (text only) video cards. You can check if it also underlines if you put the & in a different position than the first character. Another option is that the text renderer that Dink uses (directX, I think?) supports this as a way to mark hotkeys. Freedink uses a different renderer (SDL), so that would explain the difference.