The Dink Network

sp_kill_wait()

February 7th 2013, 08:36 PM
goblins.gif
So, I removed sp_kill_wait(1) from the item-fst script. I can't tell any difference. With or without the line, it will wait until the next frame of animation to do the command, for any weapon and for any spell. This is especially obvious when Dink is in idle animation, since the idle animation moves slowly. To see the difference try throwing axes (or even punching) as fast as you can standing still, then try it moving. It's a lot easier when moving.

So, does sp_kill_wait(1) actually do anything? Is there another way to do what it was supposed to do? I've been messing around with sp_frame_delay but haven't been able remove the delay before Dink attacks yet. I'll post again if I figure it out.
February 7th 2013, 09:07 PM
goblins.gif
I DID IT!

All I had to do was set Dink's direction to what it already was at the beginning of the script.
Which properly resets the animation, in ways that sp_frame and sp_seq do not do, and for the purposes of the attacking script seems to do exactly what sp_kill_wait(1) was supposed to have done, but doesn't.

Modified item-fst void use( void ):
//disallow diagonal punches
&basehit = sp_dir(1, -1);
sp_dir(1, &basehit);
	
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);
	
//100 is the 'base' for the hit animations, we just add the direction
&basehit = sp_dir(1, -1);
&basehit += 100;
	
sp_seq(1, &basehit);
sp_frame(1, 1);
sp_nocontrol(1, 1); //dink can't move until anim is done!
wait(1);

playsound(8, 8000,0,0,0);


Sorry that I answered my own question. But at any rate, feel free to use this workaround in your DMODs. It's a small difference but it rocks anyways because it affects every single weapon and spell in the game where Dink uses an animation, with an exception to bows. Hopefully now there will be no more having Dink freeze for a moment when you are attacking a fast enemy getting you hit when you know it shouldn't have happened. Yay! What's that spell-check program, yay isn't a real word?

After some testing, I've discovered that it works well with any weapon that uses sp_nocontrol in it. It does not appear to make a difference with bows because it seems that they use a different system to prevent control anyways.

Weapons I've tested that work better now:
Fist, Sword, Claw Sword, Throwing Axe, Herb Boots, Fireball, Hellfire.

Based on that information I also deduce it should work without issue with:
Acid Rain, Light Sword.

Useless or bad with:
Bow of any kind, Bomb, etc, anything without sp_nocontrol in the void use( void ) function.

How to add to your DMOD:
//replace &var with any variable that already exists in the script
&var = sp_dir(1, -1);
sp_dir(1, &var);


Just place that in the beginning of void use( void ) of the item in question.
February 7th 2013, 09:16 PM
wizardg.gif
leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
Will it make a substantial difference?
February 7th 2013, 09:28 PM
goblins.gif
Against fighting enemies that move very fast and occasionally against attacking enemies like slayers, yes it will make a difference. I'm thinking a lot of people won't be able to notice it, though. For me however, it bugs me a ton when enemies get hits on me when I thought I knew what I was doing. It would also be a good implement on any DMOD that is going to be quite hard as it will make the challenge more fair and less random. But for an easier DMOD it is certainly not necessary. Even on an easier DMOD though, it is nice to be able to attack full speed while in the idle stance.

So I guess how useful it is to you is all down to how important being able to maximize your number of attacks and not having moments where you can't move is. I'm editing my previous post now to make better instructions with how to implement it into a DMOD.

edit: attacking enemies as in any enemy that attacks you from a distance (slayers, stone giants, boncas, etc)
February 8th 2013, 03:56 AM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
I love how you spend time fixing those little things that we've just learnt to live with.
You should release a new version of the dink with your fixes!
February 8th 2013, 04:25 AM
goblins.gif
I don't know if I'll release a new version of Dink because that would require messing with the source, and I'm not good with C or C++. However, I may just release a full blown script pack some time with details about everything that is fixed.

Who knows though, maybe I will try looking at the source again, and seeing if I can't spot, for example, where the text is not set to nohit and things like that. I would love to be able to have that fixed in the source and not have to work around it in the DinkC. Only problem is, I don't really know how to properly go about editing, testing, and packaging the source. If anyone can point me to some resources that will help me with that, I would be thankful, although I can't promise that I'll ever actually be able to fix enough or anything in the source to warrant a new Dink release. I can certainly think of some things I would like to add though...
February 8th 2013, 05:53 AM
goblins.gif
Hmmmm, A bad realization just hit me. Only the source for Dink v1.08 is released, and not Dink v1.08 Aural+. Aural+ is so much better...and there is no way I would be able to replicate what it does. I wonder if Redink even still has the source for it?
February 8th 2013, 06:26 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
These little tweaks DO make a difference. Anything else you have in the pipeline? Would love a script pack at some point.
February 8th 2013, 06:58 AM
goblins.gif
I have one epic DMOD I'm working on (it will be quite a while...It might be close to 50% done right now)

I may also update my exploding missiles fix, although at this point I might just wait and release a whole script pack for weapons and spells dealing with all the errors I've been able to work around so far. I think that would be a lot more useful.

I would love to give a try at editing/updating the source, but I don't want to release it without the ability to play mp3's and load midi's fast. In other words, I'd want to start from v1.08 Aural+ which as far as I know hasn't had a source code release. Maybe I should try to get a hold of Redink? Oh yeah, I also need to learn how to read and edit it properly. I managed to open the source of v1.08 in Visual Studio C++ 2005 and I think I understood a lot of it. But, I haven't figured out how to compile it yet. I'm currently downloading Windows Platform SDK and hoping it will solve my compiling problem.

Edit: Well, it got a little further. But it looks like I'll need DirectX SDK as well.
February 8th 2013, 08:05 AM
dragon.gif
Quiztis
Peasant He/Him Sweden bloop
Life? What's that? Can I download it?! 
Add your upcoming DMOD to the upcoming DMOD list sticky!
February 8th 2013, 08:15 AM
spike.gif
I love how you spend time fixing those little things that we've just learnt to live with.

This. The lag when punching with ordinary fists is easiest to see if you first try punching by tapping control, then change to holding down the left and right arrow keys (so that Dink's animation stops playing) and tap control; the rate at which Dink throws punches will be noticeably faster.
February 8th 2013, 08:21 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
You might be able to integrate mp3 play yourself if you look it up. I'm thinking you'll just have to change the .mid call to a function playing an mp3 through DirectAudio.
February 8th 2013, 08:30 AM
goblins.gif
I will add the DMOD to the list when it's closer being finished, and I make a thread for it. Until then I don't won't to arouse too much attention with it.

I've spent a little more time looking at the source and it's a lot easier to read than I had imagined it would be. Adding mp3 support may truly not be as difficult as I imagined, but once again, I make no promises. In fact, I still haven't succeeded in compiling the basic game, although I installed Direct X and now it's at least attempting to compile. I get a massive list of errors(105)/warnings(56) and it fails to compile. The log doesn't say anything about fatal errors so I'm a little lost as to how to proceed from here. Will I need to fix all the errors for it to compile or is there an easier way? At least it seems to have all the necessary files now, though.

By the way, I am using Visual C++ 2005.

Edit: I'm gonna try Jayon's suggestions and see if it works.
http://www.dinknetwork.com/forum.cgi?MID=104880&Posts=11
February 8th 2013, 08:44 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
Impressive and a pack of fixed scripts would be nice indeed Could add them to the new skelly i was working on, with all the basic scripts added to the items already... ... that i forgot about .. see you are enthusing others good job (is that a real word hehe)
February 8th 2013, 10:08 AM
goblins.gif
Well, I managed to get through all Jayon's suggestions (from the other topic I linked to), but it wasn't quite enough to get the game compiled.

I'm currently using the April 2007 release of the DirectX SDK. Does anyone know what the optimum version would be for Dink? I keep running into a lot of missing files and .lib errors with this DirectX SDK.

@MsDink, If you are considering making a skeleton I wouldn't mind testing it at some point. Although I remember reading when I posted my exploding missiles fix that they weren't accepting Skeleton DMOD's any more, but who knows. Maybe if it's a really good one it won't matter.
February 8th 2013, 10:19 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
We need a be all end all skeleton, I'm pretty sure it will be accepted

And have you tried contacting Seth about your compiling problems? He's actually pretty accessible for a game developer, I'm sure he'll help you out as far as he's capable
February 8th 2013, 10:23 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Also, doubleposting here because I noticed you lurking and might miss an edit, if you decide to contact Seth, ask him if he's ready to give out the DinkHD source code. He always said he would when his work on it concluded, which I think it did by now

If you get your hands on that source code, we can all have some fun with it
February 8th 2013, 10:23 AM
goblins.gif
No, I haven't tried contacting Seth. But thank you for the suggestion; I may try if I don't figure it out before too long. I may also try talking to ReDink but I'm not sure how best to contact him. For now I'm going to try an older DirectX (August 2006) and see if it helps at all, since DirectX seems to be my main problem right now.
February 8th 2013, 10:24 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
You won't get through to Redink, we've all tried, it won't work.

Which errors are left in the compilation process btw?
February 8th 2013, 10:28 AM
goblins.gif
I know a whole lot less about DinkHD. I played through the original game on it but never did play other DMODs on it. So I'll probably still base my work on the v1.08 source first and foremost. If I do ask him for help though, I will most certainly ask him about the release of the DinkHD source as well.

Edit again:

The current error (6 of them) is:

1>dink.obj : error LNK2001: unresolved external symbol _c_dfDIMouse
1>dink.obj : error LNK2001: unresolved external symbol _GUID_SysMouse
1>dink.obj : error LNK2019: unresolved external symbol _DirectInputCreateA@16 referenced in function "int __cdecl init_mouse(struct HWND__ *)" (?init_mouse@@YAHPAUHWND__@@@Z)
1>dink.obj : error LNK2019: unresolved external symbol _DirectSoundCreate@12 referenced in function "int __cdecl DSEnable(struct HWND__ *)" (?DSEnable@@YAHPAUHWND__@@@Z)
1>dink.obj : error LNK2019: unresolved external symbol _DirectDrawCreate@12 referenced in function "int __cdecl doInit(struct HINSTANCE__ *,int)" (?doInit@@YAHPAUHINSTANCE__@@H@Z)
February 8th 2013, 11:02 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
Yeah, i had mentioned it here and asked what they thought - was more of a starter dmod with everything that had a script attached (like hearts/bottles) was pre set up on starter screens (you delete those after u get yours going) and the tiles (wooden floor, sand, etc) laid correctly [man i hate how some cant lay those matched up..] people walking already speed set (you copy and stamp them and add to the script which was already attached to it) fish jumping etc etc - its about half done and then i stopped - must dig it out again and yep be nice to have u look over it. It was to assist those who didnt know the basics - like a beginner kit - not for those that wanna start from scratch. I had added new npc's and new death sequence, was adding moving bar people hmm.. scratches chin and wanders off....

Edit:
Found it...
February 8th 2013, 12:17 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Sounds like you can fix your errors just by finding those libraries online.
February 8th 2013, 12:21 PM
goblins.gif
I have already installed Direct X SDK and Windows Platform SDK. The current error seems to be a part of the Windows SDK. So I think I have the files I need...but I must be doing something wrong.

By the way, I learned that I put the wrong folders in the directories section of Visual C++ earlier for a couple of the SDK things... but I think I've fixed them now.

Something I read talks about "linking" the dinput8.lib and dxguid.lib with dinput, but I don't really understand how that works.
February 8th 2013, 01:31 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Good luck trying to get 1.08 to compile. I managed to do it several years ago, but it segfaulted immediately when running the executable, so I was probably still doing things wrong somewhere. I've found freedink to be more easily hackable, but there's the thing that any difference in behaviour between freedink and 1.08, 1.08 is canonical.

DinkHD would be nice to have the source code of, if only because that's been known to compile at least once in the past five years. I believe it can play mp3 as well, but I'm unsure about that. On the other hand, there have been some inconsistencies between it and 1.08? I've never really looked into it much.

I'd love to help you out, but I don't speak any DirectWhatever either (and barely C/C++, but enough to copy-paste things and modify existing code).

So, umm. Yeah, basically I'm just cheering you on. I have no idea what's going on either

EDIT: Goblin avatars rule!
February 8th 2013, 01:40 PM
goblins.gif
Up until now, I've been trying to build Dink only (not including all the other stuff, like FFcreate and DFarc2). But now I realize that there is a separate compile option under build. When I do it says it is successful, but I can't seem to locate the output file(s). I'll post an update when I figure out what's going on.

And yes, Goblin avatars do rule.
February 8th 2013, 01:58 PM
goblins.gif
Hmm, When I debug test it (F5) it only seems to try to start compress.exe... I guess I was closer to the right track before. When I try to build Dink.exe though I'm still having the "unresolved external symbols" I mentioned before. I'll keep trying things though and hope I can figure it out.

Edit: Also, I did figure out how to link things... I linked everything my google searches have told me to but so far it hasn't solved any of my problems.
February 8th 2013, 02:22 PM
goblins.gif
I, I, I, I... I got it to build! For real this time!

Of course, it wasn't perfect... it is about 600kb bigger than the original, and DMODs won't play for some reason (they show the "loading" screen and play the title music, but the loading screen stays there). The main game on the other hand, plays like a charm, with no discernable difference from the original v1.08 Dink.exe from what I can tell. More experimenting will be required, but I'm very happy I finally got a solid compilation!
February 8th 2013, 02:32 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
I'm impressed by your perseverance tbh. Keep it up and you'll make a real difference here
February 8th 2013, 02:36 PM
goblins.gif
Now if only I had an idea of how to get the .exe down to the normal size and make it play DMODs properly...

Edit: Well, I found the section in the DFArc2 source where it triggers the play option. But the only thing I see there is command line settings. So I can only assume that the command line options are not being read properly for the new .exe. Why this is or how to fix it, I don't know yet. But for now I'm going to take a break.
February 8th 2013, 03:12 PM
goblins.gif
HMMM... I went ahead and tested a few more DMODs, and I've discovered a lot of them actually do work, but others, like my own DMOD, do the freeze I mentioned. So it seems most DMODS work, but some do not, with the compile I've created. Well, at least it's a start.

Edit: Wow, actually it's crazy but, only the first two DMODs I tried out of my whole list seem to have any issue at all. Freaky. The two that freeze are my own DMOD, and Dink Get's Board (Bored). Every single other DMOD I've tried seem to work just like v1.08. Guess I'll be checking what I've done different in my DMOD that might be messing things up.
February 8th 2013, 03:35 PM
goblins.gif
Okay this is my last post for a while, for real (and yeah, sorry for the triple post).

My compilation of Dink.exe can't handle loopmidi at the beginning of game. I tried removing the line from my own main.c and the game loaded properly. I also found loopmidi in the main.c of Dink Gets Bored, confirming my suspicions. So at least now I have isolated the problem.
February 8th 2013, 03:52 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Great job getting it to work I'm looking forward to what you'll be doing with it^^ You have excellent problem solving skills btw.
February 8th 2013, 10:02 PM
goblins.gif
Thanks for the kind words, Kyle; I am an avid Googler, that's for sure. Unfortunately my running knowledge of C/C++ is pretty low so I will probably still be asking for help a lot, but I will try to figure out stuff on my own as well.

Update: The file included in the solution called "Compress" seems to be capable of compressing the rest of the data, and thus getting rid of that fat that is present in my .exe but is trimmed in Redink's. Unfortunately, I'm not sure how to call it so that it will compress the dink.exe. It only opens with a black dos screen and then closes. I want to figure this problem out before I try adding any features or changes to it because I want to make sure it's as close to the old file as possible for now.
February 8th 2013, 10:10 PM
goblins.gif
Ohhh, never mind. I think I figured out what compress is. It's the thing that makes .c files into .d files. That's not what I'm looking for at all.
February 9th 2013, 04:29 AM
farmer.gif
Beuc
Peasant He/Him France
 
magicman: it's up to us to decide which version of the engine we want to make canonical