The Dink Network

How do you make Dink do things

November 30th 2005, 02:59 PM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
How do you make Dink punch or throw seed via a script?
November 30th 2005, 03:13 PM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
There are good tutorials in both the Dink develop folder and the development link on the left. Try them.
November 30th 2005, 03:13 PM
spike.gif
Check scripts where it's done... item-fst.c item-pig.c etc.
November 30th 2005, 03:20 PM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
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
December 1st 2005, 03:24 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
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!
December 1st 2005, 06:33 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
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 &current_weapon = &current_script; ) and try run_script_by_number(&current_weapon, "use");
December 1st 2005, 08:32 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
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.
December 1st 2005, 08:50 AM
spike.gif
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.
December 1st 2005, 10:48 AM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
Could someone show me how to let Dink throw seed because I can't figure it out.
December 2nd 2005, 02:03 PM
knightg.gif
cypry
Peasant He/Him Romania
Chop your own wood, and it will warm you twice. 
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.
December 2nd 2005, 06:36 PM
dinkdead.gif
millimeter
Peasant He/Him Canada
Millimeter is Wee-Lamm, Recording Artist. :-) 
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
December 2nd 2005, 07:25 PM
spike.gif
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.
December 2nd 2005, 07:43 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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.
December 3rd 2005, 11:36 AM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
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
December 3rd 2005, 12:40 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
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.
December 3rd 2005, 01:02 PM
spike.gif
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.
December 3rd 2005, 01:16 PM
burntree.gif
Striker
Noble She/Her United States
Daniel, there are clowns. 
Is there noboddy who could tell me how to let Dink throw seed

Check out Progeny for that.
December 3rd 2005, 01:30 PM
duckdie.gif
you press ctrl to make dink punch and use the weapon and to use map you press the #6
hope that answers your question
December 3rd 2005, 01:31 PM
duckdie.gif
I dont really get what that mean about throwing his weapon how do u do that
December 3rd 2005, 06:03 PM
dinkdead.gif
millimeter
Peasant He/Him Canada
Millimeter is Wee-Lamm, Recording Artist. :-) 
ty
mm
December 4th 2005, 03:26 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
He he he