The Dink Network

Scripting question

December 1st 2003, 02:58 PM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
Hey there. I'm making this add-on for the Dink fighting engine, where you can "miss".
There is a small chance you miss when you attack. Though, the only way I could think of is make your strength 0 for a microsecond, and then turn it back to old strength.
The problem is, Seth was a horrible programmer, and because of that, it actually takes time to count down to 0 for strength. Because of this, *some* times, you miss, and still do damage. I could prevent this by putting in a bigger wait, but that would be kinda stupid, to see your strength go to 0 for an x ammount of time (which would be too long if strength is high. when strength is higher it takes a longer time to count to 0).

My question; does anyone know a way this can be easier done?
December 1st 2003, 03:10 PM
old.gif
In the weapon script, add to the use(void)

int &chance = random(9,1)
if (&chance > 6) { //miss sp_nodraw(1,1) //create a clone of dink, that cannot do damage &clone = create_sprite( blabla ) sp_strength(&clone, 0) //play the sequence } else { //do original stuff }

Ik hoop dat dat je op koers helpt
Ben de commandos een beetje vergeten door DarkBASIC
December 1st 2003, 05:05 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
There are two basic ways to do this, not including theprophet's silly way:

1) Set the strength to 0 immediately, and restore it immediately. Just do something like this:

&strength = 0;
draw_status();
//Fightin' Stuff!
&strength = &oldstr;
draw_status();

2) Remove the special frame from Dink's attack animation, so Dink can't actually hit anything. Like so:

init("set_frame_special 102 3 0");
init("set_frame_special 104 3 0");
init("set_frame_special 106 3 0");
init("set_frame_special 108 3 0");
//Fightin' Stuff
init("set_frame_special 102 3 1");
init("set_frame_special 104 3 1");
init("set_frame_special 106 3 1");
init("set_frame_special 108 3 1");

Of course, you'd need a few if (&randomvar == &somevalue) things around the code above, but that should be relatively simple to figure out.
December 2nd 2003, 01:00 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
The first method Redink1 suggests isn't nearly as good as the second, because due to the safety measures Seth built in, you will still be able to do 1 damage to the monster even with 0 strength.

The second method is extremely cool though and will definitely yield the results you want.
December 2nd 2003, 01:28 AM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
Thanks a bunch man, it works perfectly
December 3rd 2003, 09:30 AM
wizardg.gif
Paul
Peasant He/Him United States
 
How about?:
sp_range(1, -100);

That seems to have the same effect as redink1's option 2. Also, I'd suggest that there's no reason to set it back afterwards, as long as you set it back when he disarms the weapon, and randomly each time he attacks.
December 3rd 2003, 12:18 PM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
hmm, does it improve anything? Redink1's way is prefect and bugless, so I won't change it I think. I guess yours is too though.
December 3rd 2003, 12:58 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Paul's would probably work better. I seem to recall some various, unpredictable bugs when specifying special frames with init lines in-game.
December 3rd 2003, 01:07 PM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
Oh, okay. So I just have to enter
//random chance
sp_range(1, -100);
//100% - random chance
sp_range(1, x);
where x is the range of the weapon you are carrying?
December 3rd 2003, 01:16 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Looks right.
December 4th 2003, 01:13 PM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
what is the range of the fists? 0?
December 5th 2003, 01:34 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Zero is impossible. I'm not sure what the exact number is though.
December 5th 2003, 03:09 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
sp_range() for Dink... this is only mentioned in the item-swX (swords 1 to 3) scripts.

Arm procedure in each script sets both range and distance for each sword, disarm resets both to 0
December 5th 2003, 10:28 AM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
I figured it out, and it ís 0 Kyle. It works with 0, and it makes sense, 'cause your "hit-range" is just as big as your hardbox. With swords and all, this is extended. (I think)

Anyway, 0 works for me.
December 5th 2003, 10:44 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Nah, Dink has a built-in check so if your range is 0, it is actually set to 23 or something like that.
December 5th 2003, 10:49 AM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
Ah. Well anyway, when set to 0 it works, so I don't care