Alternative hero and Visions
Hello, I am trying to make a D-mod. But I dont understand the vision part and alternative hero. Can someone help me
. thanks

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.
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.
(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
(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.
I actually scripted this as I was typing it, so I could email the scripts if you want to do it the lazy way
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

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.
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.
Thank you, I hope it will work out.
Sorry to bother again but there is no base idle and base push in start-1c

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
This is very odd..
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..
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.
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
Thanks for help and your time.

NP, if it helps make more quality DMODs then it's well worth it

I need help again, I coudn't found basehit. And It's not really necesary but the knight is always moving.
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.
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.
&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.
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
Thanks for your help
