The Dink Network

Making a new Idle for dink?

January 22nd 2014, 03:29 PM
milder.gif
truthghost
Peasant He/Him United States
i am Ancient 
I made a bunch of new idle frames for dink, but, setting a "sp_base_idle(1, #);" doesn't let the sequence reverse like the original dink idle. Is there a like I should add that makes the sequence reverse?
January 22nd 2014, 03:49 PM
wizardg.gif
leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
You need to add in
preload_seq(#);
for each idle sequence before setting sp_base_idle().

January 22nd 2014, 04:02 PM
milder.gif
truthghost
Peasant He/Him United States
i am Ancient 
Should I add it into Dink.ini or Start1.c?

Here's the .C lines I have

    //Change dink from a mouse pointer into a human being.  
    
    preload_seq(850);

    preload_seq(852);

    preload_seq(854);

    preload_seq(856);               

    sp_base_idle(1, 848);


The idle sequence works fine, but it doesnt reverse like the original Dink, so it jumps back to the first frame at the end of the sequence.

Thanks.
January 22nd 2014, 04:18 PM
eye.gif
synbi
Peasant He/Him Finland
 
You have to modify Dink.ini to set the animation sequence reverse. I'm not exactly sure about the details, but right near the beginning of the file it reads:

//special moves to make the idle play backwards

set_frame_frame 12 5 12 3
set_frame_frame 12 6 12 2
set_frame_delay 12 5 250
set_frame_delay 12 6 250

etc...

Somebody more knowledgeable might actually know what all those numbers stand for

January 22nd 2014, 04:30 PM
milder.gif
truthghost
Peasant He/Him United States
i am Ancient 
I actually really thank you Synbi, editing those from 12 (the Dink sequence) to 850 (the new character sequence) and all the ones after that solved my problem!

Thanks@
January 22nd 2014, 06:49 PM
peasantm.gif
shevek
Peasant They/Them Netherlands
Never be afraid to ask, but don't demand an answer 
set_frame_frame 12 5 12 3
set_frame_frame 12 6 12 2
set_frame_delay 12 5 250
set_frame_delay 12 6 250

etc...

Somebody more knowledgeable might actually know what all those numbers stand for


12 is the sequence number; 5 and 6 are the frame numbers. set_frame_frame will use a copy of an existing frame as the value for the target frame; the first two lines tell it to use sequence 12 frame 3 and 2 for sequence 12 frame 5 and 6 respectively. The second two lines declare a delay of 250 ms before moving the animation to the next frame.

Those instructions must be given before the sequence is loaded, because the engine reserves slots for the frames, and it cannot grow that storage (so the backward frames wouldn't fit if they were loaded first).
January 22nd 2014, 07:16 PM
milder.gif
truthghost
Peasant He/Him United States
i am Ancient 
Thanks for more info, Shevek.

I've ran into another problem.

When PROTAG (that's the name for my new character) punches, the animation happens, but he doesn't actually punch. Pillbugs are killin me!

Here's the script.

//item fists

void use( void )
{
//disallow diagonal punches

if (sp_dir(1, -1) == 1)
    sp_dir(1, 2);
if (sp_dir(1, -1) == 3)
    sp_dir(1, 2);
if (sp_dir(1, -1) == 7)
    sp_dir(1, 8);
if (sp_dir(1, -1) == 9)
    sp_dir(1, 8);

&basehit = sp_dir(1, -1);
&basehit += 867; //867 is the 'base' for the hit animations, we just add
//the direction
sp_seq(1, &basehit);
sp_frame(1, 1); //reset seq to 1st frame
sp_kill_wait(1); //make sure dink will punch right away
sp_nocontrol(1, 1); //dink can't move until anim is done!
wait(1);
playsound(8, 8000,0,0,0);

}

void disarm(void)
{
debug("Killed fists");

kill_this_task();
}

void arm(void)
{
sp_attack_hit_sound(1, 0);
init("load_sequence_now graphics\protag\walk\p-w1- 858 43 26 70 -10 -9 11 5");
init("load_sequence_now graphics\protag\walk\p-w2- 859 43 26 70 -10 -9 11 5");
init("load_sequence_now graphics\protag\walk\p-w3- 860 43 26 70 -10 -9 11 5");
init("load_sequence_now graphics\protag\walk\p-w4- 861 43 26 70 -10 -9 11 5");

init("load_sequence_now graphics\protag\walk\p-w6- 863 43 26 70 -10 -9 11 5");
init("load_sequence_now graphics\protag\walk\p-w7- 864 43 26 70 -10 -9 11 5");
init("load_sequence_now graphics\protag\walk\p-w8- 865 43 26 70 -10 -9 11 5");
init("load_sequence_now graphics\protag\walk\p-w9- 866 43 26 70 -10 -9 11 5");

init("load_sequence_now graphics\protag\idle\p-i2- 850 250 26 70 -10 -9 11 5");
init("load_sequence_now graphics\protag\idle\p-i4- 852 250 23 68 -9 -9 7 6");
init("load_sequence_now graphics\protag\idle\p-i6- 854 250 31 68 -8 -10 8 5");
init("load_sequence_now graphics\protag\idle\p-i8- 856 250 26 62 -8 -8 9 7");

init("load_sequence_now graphics\protag\hit\p-h2- 869 75 26 70 -10 -9 11 5");
init("load_sequence_now graphics\protag\hit\p-h4- 871 75 37 67 -10 -7 7 5");
init("load_sequence_now graphics\protag\hit\p-h6- 873 75 10 67 -8 -9 12 8 ");
init("load_sequence_now graphics\protag\hit\p-h8- 875 75 26 70 -10 -9 11 5");
debug("fists armed");

int &basehit;
}

void pickup(void)
{
Debug("Player now owns this item.");
kill_this_task();
}

void drop(void)
{
Debug("Item dropped.");
kill_this_task();
}



Got any ideas? Thanks.
January 22nd 2014, 07:25 PM
peasantmb.gif
yEoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
Have you used set_frame_special on the frame you want to punch?
January 23rd 2014, 04:32 AM
eye.gif
synbi
Peasant He/Him Finland
 
Yeoldetoast is right, take another look at Dink.ini.

There's this section a little further down from the start that should do the trick. Copy and modify to suit PROTAG's frames and those punches should finally start dealing some damage.

//set which frame can 'hit'

set_frame_special 102 3 1
set_frame_special 104 3 1
set_frame_special 106 3 1
set_frame_special 108 3 1
//make it delay on the third sprite for longer than 75

set_frame_delay 102 2 100
set_frame_delay 104 2 100
set_frame_delay 106 2 100
set_frame_delay 108 2 100


January 23rd 2014, 02:31 PM
milder.gif
truthghost
Peasant He/Him United States
i am Ancient 
You guys are super helpful, thanks.

Almost done with this new character, just gotta figure out why he's still turning into Dink when he dies, regardless of whether I set sp_base_death to his sequence or not.
January 23rd 2014, 02:45 PM
wizardg.gif
leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
Instead of setting base_walk(), base_attack(), base_idle(), and base_death() you could set the path of your new graphics to be in the same slot as dink's graphics. It'd be like how different swords are loaded.

That's what I'd do.
January 23rd 2014, 04:41 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
That would be because Dink's death is handled via the script dinfo.c. You just need to copy that script over and edit the sequence
sp_seq(1, 436);

to the new one.
January 23rd 2014, 09:27 PM
eye.gif
synbi
Peasant He/Him Finland
 
That would be because Dink's death is handled via the script dinfo.c. You just need to copy that script over and edit the sequence
sp_seq(1, 436);
to the new one.


I was wondering about this too, thanks. Another question: I need to disable pushing altogether for Dink, but push_active(0); doesn't seem to persist after loading the game. Or then again I'm not doing it right. At the very least changing Dink's push sequence number would be fine, but I can't seem to find where that's determined.
January 23rd 2014, 09:39 PM
wizardg.gif
leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
Perhaps you set push_active(0) in start1.c in which case pushing will only be disabled after starting a new game.

If you set push_active(0) in main.c it should disallow pushing regardless.
January 23rd 2014, 09:44 PM
eye.gif
synbi
Peasant He/Him Finland
 
Hahah, I knew it. Not only didn't I look into main.c or start1.c, but instead I set push_active(0); only at the intro script. No wonder things weren't working as they should have
January 23rd 2014, 09:45 PM
spike.gif
Yep, main.c runs every time a save game is loaded. That's also the place to do any other load game checks, rather than in the savebot scripts, like many dmods of old did.
January 23rd 2014, 09:47 PM
eye.gif
synbi
Peasant He/Him Finland
 
Yep, main.c runs every time a save game is loaded. That's also the place to do any other load game checks, rather than in the savebot scripts, like many dmods of old did.

<Hurries off to delete his heavily modified savebot script...>
January 24th 2014, 06:09 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
<Hurries off to delete his heavily modified savebot script...>