The Dink Network

Alternative hero and Visions

March 7th 2010, 01:03 PM
boncap.gif
Killersong96
Peasant He/Him Turkey
A horse! A horse! My banana for a horse! 
Hello, I am trying to make a D-mod. But I dont understand the vision part and alternative hero. Can someone help me . thanks
March 7th 2010, 10:14 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Alternate hero.

You'll need to edit some scripts and make your own weapon scripts, but I'll try to guide you through and hopefully it will be easy. I'll even base it off of the silver knight you wanted to use.

(1) Firstly you shoud edit start1.c.

Sp_base_walk() and sp_base_attack() are defined here. Replace those with this chunk of code.
    sp_base_walk(1, 290);
    sp_base_attack(1, 720);
    set_dink_base_push(290);
    sp_base_idle(1,290);


Also, since we will be making our own weapons, replace add_item("item-fst",438,1) with the following line. It will be for the axe as a weapon.

    add_item("item-ax1",438, 6);


(2) Making your new weapon scripts

Copy over item-sw1. We're using this one over item-fst because it includes range and uses a more appropriate hit sound. After you do so, rename it to 'item-ax1'.

Look for the line that says &basehit += 100. Change it to 720. This one is for the silver knight's attack.

Next remove the &strength += 4 and &strength -= 4 from the arm and disarm procedures respectively. You could just change them to 0s to hold the place if you're planning on making different grades of weapons, in which you would add in the +4 or whatever. Just make sure to subtract the exact amount added.

Now remove all the init() lines because we don't need them.

Lastly, add in these lines to the arm procedure to make sure the sequences are loaded corectly
preload_seq(291);
preload_seq(293);
preload_seq(295);
preload_seq(297);
preload_seq(299);

preload_seq(722);
preload_seq(724);
preload_seq(726);
preload_seq(728);


(3) Copy over and modify Dinfo.c

We now need to modify the death script so when the new hero dies, it will play his death sequence. Copy over Dinfo.c and look for sp_seq(1,436). Replace it with the following lines. And after that you should procede to removing the init() lines because (again) they are unnecessary.
sp_seq(1, 295);
sp_frame(1, 1);


I actually scripted this as I was typing it, so I could email the scripts if you want to do it the lazy way
March 7th 2010, 10:24 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Visions

Visions are easy to do, it's just a pain to figure out how to make them work for beginners. There's just one rule you need to remember. You HAVE to change &vision on a script attached to a screen. You do so by (in WinDinkEdit) right clicking on the screen and going to properties.

All you need to do is change &vision to whichever vision you want to be showing. Oh, and make sure there are no wait() say_stop() move_stop or any other commands of the sort before changing &vision because that will mess it up.

To make sprites appear in a certain vision, right click on them (in WinDinkEdit) and go to properties. There will be an input box marked vision which you should change accordingly. Robj's videos explain this part fairly well.
March 8th 2010, 06:16 AM
boncap.gif
Killersong96
Peasant He/Him Turkey
A horse! A horse! My banana for a horse! 
Thank you, I hope it will work out.
March 8th 2010, 06:28 AM
boncap.gif
Killersong96
Peasant He/Him Turkey
A horse! A horse! My banana for a horse! 
Sorry to bother again but there is no base idle and base push in start-1c
March 8th 2010, 06:35 AM
spike.gif
Nope, no there is not. You'll need to add them.
March 8th 2010, 08:11 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
I forgot something. I think I read in the DinkC Reference that set_dink_base_push() isn't saved with the game, so if you load a game, the game will use Dink's push if you haven't started a new game since you last quit. An easy fix should be to put set_dink_base_push(290); somewhere in start.c. It really shouldn't matter where.

Edit

Uh oh, set_dink_base_push() is making me walk through hardness. You can always disable push altogether by using this if it's not working for you either
push_active(0);

This is very odd..
March 8th 2010, 08:49 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Ok, if you're going to use pushing, here's the work-around. Delete set_dink_base_push() from your scripts and do this instead.

Open dink.ini and search for '312'. Replace that whole base sequence (312,314,316,318) with this.

load_sequence_now graphics\people\knight\silver\c5-w1- 312 100 67 86 -21 -12 21 12
load_sequence_now graphics\people\knight\silver\c5-w3- 316 100 58 84 -27 -11 27 11
load_sequence_now graphics\people\knight\silver\c5-w7- 314 100 70 86 -22 -12 22 12
load_sequence_now graphics\people\knight\silver\c5-w9- 318 100 66 85 -24 -12 24 12
March 8th 2010, 01:09 PM
boncap.gif
Killersong96
Peasant He/Him Turkey
A horse! A horse! My banana for a horse! 
Thanks for help and your time.
March 8th 2010, 01:39 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
NP, if it helps make more quality DMODs then it's well worth it
March 9th 2010, 10:10 AM
boncap.gif
Killersong96
Peasant He/Him Turkey
A horse! A horse! My banana for a horse! 
I need help again, I coudn't found basehit. And It's not really necesary but the knight is always moving.
March 9th 2010, 10:43 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
This is the line you're looking for. It's right at the top under all the if statements. Perhaps you were confused by the commentary following it? Anyways, just change the 100 to 720.

&basehit += 100; //100 is the 'base' for the hit animations, we just add


And the knight is always moving because his base idle is the same as his base walk. You could set the base idle to -1 and he'll stand still, but he'll also be frozen on the last attack frame until he moves after attacking. You pick which one you prefer.
March 23rd 2010, 11:07 AM
boncap.gif
Killersong96
Peasant He/Him Turkey
A horse! A horse! My banana for a horse! 
Sorry man,I coudn't write an answer. I need to study hard on my exams. I can't do something this year. So I find you later on.
Thanks for your help