The Dink Network

Reply to Re: Some self-indulgence

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:
 
 
June 21st 2012, 11:54 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
I don't know what you mean that to imply.

What I mean is that in this thread you've focused on the performance of actually writing these scripts rather than the performance of their function. So I deduce from that that according to you the real merit of this file is the scripting technology behind it, not the functional performance. This is not something I would deduce from the readme, which starts with:

This is a demonstration and public beta test of a bunch of scripts under the working
title "MouseDink" which allow a mouse controlled Dink. I'm pretty happy with the
result. I think it's superior to the standard way of controlling Dink.


From this I really get that you're trying to show off a mouse control system for Dink, not just a demonstration on how such a system could be realized. That's why I can't see why the comment you where so unhappy about wouldn't be valid criticism. Now as I wrote in my previous post I too think we should find a middle ground between appreciating novel scripting techniques and focusing on functionality only. However that doesn't make the criticism invalid. Perhaps a little bit more text spend on the quality of scripting wouldn't have hurt, but the basic points that where addressed don't seem at all unreasonable.

If everyone judged MouseDink primarily on the gameplay or how easily it is adopted into other DMODs, I wouldn't have optimised MouseDink for those things; I would have simply not released it.

Well, I suppose it's good people have different opinions then.

The idea that MouseDink was developed to patent mouse control so that everybody who uses mouse control must credit you.

Glad that is cleared up. Note that I didn't say MouseDink was released to patent mouse control. I said that that feeling hangs over this thread which is because of all the discussion of crediting people I suppose. I would loathe a file being released purely to claim a certain scripting technique.

How is releasing MouseDink not helping in any way? Any way?

A file purely released for claiming a DMOD making technique wouldn't be helpful, that's what I meant to say. I was never trying to say that MouseDink wasn't being helpful, I'm sorry if you understood it that way.

What I mean by saying that it isn't helping (perhaps I should have left out the 'in any way') is that if a script has limited functionality but does demonstrate a technique could lead someone wishing to develop something similar himself to be discouraged because he has to credit someone else for a lot of work (since the other person used this file to 'patent' the technique) but he still has to do a lot of work himself. Doing a lot of work yourself without getting the credit for it yourself is highly counter-productive. That's what I mean by releasing a 'patent development file' not being helpful in any way.

If a script is a good help that really reduces the amount of work someone else has to do to get something to work, of course that is a helpful contribution. The 'patent' development file I'm talking about is the kind of file that is not helpful but does contain a certain technique. Releasing such a file is, in my opinion, indeed not helpful, period.

If you claim to invent something, you should mention you weren't first

That's a long way off having to credit someone for their work. Of course you can't say that you where the first to think of something when you weren't. However I wouldn't have a problem with not mentioning the other file and just writing it from scratch yourself. You shouldn't say you 'invented' it, but you did 'create' it.

Really. How does it work?

Short answer: Wait and see

Long answer: Here's the aiming part of my script, comments are the ones also in the original script:

//And do the shooting:
//For that we first need to figure out where Dink actually is..
&dix = sp_x(1,-1);
&diy = sp_y(1,-1);
//and the monster's position:
&mox = sp_x(&difper1,-1);
&moy = sp_y(&difper1,-1);
//Now let's see how they compare:
&dix -= &mox;
&diy -= &moy;
//Firstly, when Dink is at the exact same location as the monster
//No shots will be fired:
if (&dix == 0)
{
if (&diy == 0)
goto loop;
}
//Now for simplicity's sake I just work with positive numbers now
//I'll add the negative values later, but this reduces the amount
//of work quite a bit... So &mox and &moy now hold the positive
//values for &dix and &diy
&mox = &dix;
&moy = &diy;
if (&dix < 0)
&mox * -1;
if (&diy < 0)
&moy * -1;

//Okay, now that the negative values have been removed
//we save directions in &posx and &posy.
if (&mox > &moy)
{
  &posx = 4;
  &posy = 0;
  if (&moy > 0)
  {
    &posy = &moy;
    &posy * 4;
    &posy / &mox;
  }
}

if (&mox <= &moy)
{
  &posy = 4;
  &posx = 0;
  //Just so we don't divide by zero:
  if (&mox > 0)
  {
    &posx = &mox;
    &posx * 4;
    &posx / &moy;
  }
}

//Okay, now we have directions we will need to reintroduce negative values:
if (&dix < 0)
&posx * -1;
if (&diy < 0)
&posy * -1;
//Yes, it's easy as that.


From there onward the values of &posx and &posy will be used as values for sp_move_x() and sp_move_y() to aim where Dink roughly is. You can edit the speed of the projectile by choosing a different value than '4' in this script. The higher the speed the more accurate the aiming. Of course this script truncates x and y values rather than rounding them off, but I'm happy with the accuracy I obtain using truncation.

Oh, and &difper1 is a juggling global that I use a lot to refer to sprites other than the one the script is attached to. In this case the firing loop is in a spawned script so that the hit/talk procedures don't interrupt the firing loop.

EDIT: Reading over my (and your) post again I don't feel we really disagree much. Mostly a difference of opinion regarding how to trade off functionality with scripting achievement.