How do you make Dink do things
How do you make Dink punch or throw seed via a script?
There are good tutorials in both the Dink develop folder and the development link on the left. Try them.
Check scripts where it's done... item-fst.c item-pig.c etc.
I've already checked that. But I actualy asked it to know exactly how it's done. But I could look better and find it someday.. I think... I guess.... maybe
Making Dink do things like throw a weapon etc can be tricky. When I end up frustrated because I can't get the sp_nocontrol() etc to do what I want then I usually end up:
1) turn the real Dink invisible with sp_nodraw and freeze him
2) at the same time create a sprite in his exact spot facing the same direction
3) move real Dink off screen (turn on the ability to do this without the screen scrolling)
4) get the fake Dink sprite to do what you want.
5) move real Dink back via the sp_x and sp_y commands
6) turn on real Dink dispaly via sp_nodraw()
7) kill the fake Dink.
God that seems complicated... but sometimes I do just that... for Dink in quicksand (SOB) and falling off the ice bridge (PQ) - although by memory I used the real Dink in SOB to throw a fireball inside Story 4 with the guy in the hut with the little ring of stones, and also with the hammer of truth in Story 1 when Dink returns with the flute (I think that's in the Queens script... not sure)
Ah... enough my head hurts!
1) turn the real Dink invisible with sp_nodraw and freeze him
2) at the same time create a sprite in his exact spot facing the same direction
3) move real Dink off screen (turn on the ability to do this without the screen scrolling)
4) get the fake Dink sprite to do what you want.
5) move real Dink back via the sp_x and sp_y commands
6) turn on real Dink dispaly via sp_nodraw()
7) kill the fake Dink.
God that seems complicated... but sometimes I do just that... for Dink in quicksand (SOB) and falling off the ice bridge (PQ) - although by memory I used the real Dink in SOB to throw a fireball inside Story 4 with the guy in the hut with the little ring of stones, and also with the hammer of truth in Story 1 when Dink returns with the flute (I think that's in the Queens script... not sure)
Ah... enough my head hurts!
Hmm... if Dink's frozen, why would you even need to use something like sp_nocontrol? Wouldn't you just be able to:
freeze Dink
play Dink's sequence (attack, sink, etc)
wait a bit
create projectile (if necessary)
wait a bit more
sp_dir Dink to his old direction so he plays his idle sequence (for the quicksand stuff, you'd probably just do a sp_nodraw, yeah)
Or if you really want to get funky, you could store the script number of the current weapon in a global variable (like in the arm sequence, do something like ¤t_weapon = ¤t_script; ) and try run_script_by_number(¤t_weapon, "use");
freeze Dink
play Dink's sequence (attack, sink, etc)
wait a bit
create projectile (if necessary)
wait a bit more
sp_dir Dink to his old direction so he plays his idle sequence (for the quicksand stuff, you'd probably just do a sp_nodraw, yeah)
Or if you really want to get funky, you could store the script number of the current weapon in a global variable (like in the arm sequence, do something like ¤t_weapon = ¤t_script; ) and try run_script_by_number(¤t_weapon, "use");
But there's no need to have Dink off-screen when he's invisible and frozen, or is there? I mean, the fake sprite does his job and it doesn't matter where the real Dink is at that moment.
Wouldn't it be simpler to just change Dink's brain to 0 or turn off his idle? :/ I haven't had any problems with sp_nocontrol(); but that's what I do when he's supposed to stop instead of going back to his idle.
Could someone show me how to let Dink throw seed because I can't figure it out.
But there's no need to have Dink off-screen when he's invisible and frozen, or is there? I mean, the fake sprite does his job and it doesn't matter where the real Dink is at that moment.
I agree, but I think the fake dink might hit the real dink, if he doesn't move.
I agree, but I think the fake dink might hit the real dink, if he doesn't move.
Just a question, if you had 50 sprites on a screen then moved them off screen, would they still be cycled through on each frame or would they be out of the que until they were brought back on screen?
On a different tack, if the "fake dink" needed to die then the game would proceed. If you used the real dink then would this not prompt the reload/restart sequence?
mm
On a different tack, if the "fake dink" needed to die then the game would proceed. If you used the real dink then would this not prompt the reload/restart sequence?
mm
On a different tack, if the "fake dink" needed to die then the game would proceed. If you used the real dink then would this not prompt the reload/restart sequence?
Ya, but to let Dink die and continue the cutscene in dinfo.c is really easier/simpler. To decrease his life to 1 point and fake his death is propably the simpelest/fastest way.
Ya, but to let Dink die and continue the cutscene in dinfo.c is really easier/simpler. To decrease his life to 1 point and fake his death is propably the simpelest/fastest way.
Actually, I mastered the fake-dink trick earlier than the dinfo.c modification. Though the dinfo.c is essential when you want Dink to not-really-die in real combat instead of cutscenes. I always do the more advanced cutscenes with a fake Dink. Just moving and talking can be done with the real one
I have the strange habit to create a fake Dink after a screenchange, though. Even when it's just moving and talking.
I have the strange habit to create a fake Dink after a screenchange, though. Even when it's just moving and talking.
Is there noboddy who could tell me how to let Dink throw seed. Or could someone give me the name of a tutorial where it's done
At the exact time I am writing this, I don't know how to make Dink throw seed. But, I'm going to explain how to find out how now. Ow.
Step 1: Look in the original script.
I know that all of Dink's item scripts start with item-, so I browse the source for those files. On first glance, I don't see the script, then I realize that "item-pig" might be a likely candidate. The script says "//item pig food" at the top, so we got our guy.
Step 2: Figure out what the heck it says.
When an item is used, it calls the 'use' function. I guess you're going to want to throw seed to the left. So, I pretend as if sp_dir(1, -1) is 4, and condense the use function to:
freeze(1);
sp_seq(1, 524);
sp_frame(1, 1);
wait(250);
playsound(13, 8000,0,0,0);
int &mholdx = sp_x(1, -1);
int &mholdy = sp_y(1, -1);
&mholdy -= 37;
&mholdx -= 50;
int &junk = create_sprite(&mholdx, &mholdy, 5, 430, 1);
sp_seq(&junk, 430);
unfreeze(1);
Inserting that into any other script should cause Dink to throw seed to the left.
Step 1: Look in the original script.
I know that all of Dink's item scripts start with item-, so I browse the source for those files. On first glance, I don't see the script, then I realize that "item-pig" might be a likely candidate. The script says "//item pig food" at the top, so we got our guy.
Step 2: Figure out what the heck it says.
When an item is used, it calls the 'use' function. I guess you're going to want to throw seed to the left. So, I pretend as if sp_dir(1, -1) is 4, and condense the use function to:
freeze(1);
sp_seq(1, 524);
sp_frame(1, 1);
wait(250);
playsound(13, 8000,0,0,0);
int &mholdx = sp_x(1, -1);
int &mholdy = sp_y(1, -1);
&mholdy -= 37;
&mholdx -= 50;
int &junk = create_sprite(&mholdx, &mholdy, 5, 430, 1);
sp_seq(&junk, 430);
unfreeze(1);
Inserting that into any other script should cause Dink to throw seed to the left.
Nope, the sp_nocontrol(1,1); is necessary when Dink's idle is on... Freeze and unfreeze aren't as sp_nocontrol(1,1); does the job.
Replacing freeze(1); with sp_nocontrol(1,1); should make it work right.
Replacing freeze(1); with sp_nocontrol(1,1); should make it work right.
Is there noboddy who could tell me how to let Dink throw seed
Check out Progeny for that.
Check out Progeny for that.
you press ctrl to make dink punch and use the weapon and to use map you press the #6
hope that answers your question
hope that answers your question
I dont really get what that mean about throwing his weapon how do u do that