Creating D-mods
I have some problems with creating a D-mod.
For example,i can't use the heart that heal me.Please,help me.Or if you know some videos that can help me,just tell me its name.
For example,i can't use the heart that heal me.Please,help me.Or if you know some videos that can help me,just tell me its name.
There's a script called heart.c in develop folder. You can change how many lifes to add in &life.For example:
&life = +10;
&life = +10;
That is probably because you haven't attached the script to the sprite. You can do that in WinDinkEdit by right clicking on the object.
Aye, otherwise how will the engine know what to do with the heart?
I know that i have to attach it but there is problem.I can't use them.
Could you be more specific? "I can't use them" really doesn't say much.
If it's a problem with opening the scripts, you can find the .c scripts used in original dink in develop\source.zip. The .d scripts in dink\story\ are encrypted.
If it's a problem with opening the scripts, you can find the .c scripts used in original dink in develop\source.zip. The .d scripts in dink\story\ are encrypted.
I know that you were talking about the hearts, but how is it that you can't use them? Can't you see the heart graphics? Get the script attached to the heart? Modify the heart script???
Anubis, my advice as a developer to you is: Download the "Rudiment of Scripting" and examine it carefully. You'll learn quite a lot, trust me.
Further on there are a couple of tutorial movies available as well.
Further on there are a couple of tutorial movies available as well.
Anubis, your problem has inspired me to make a tutorial of sorts. I just released it and it is located here. Maybe this will help you.
Thanks to you,rabidwolf9,i can use the hearts and the other stuffs.And i've started creating a D-mod,but it won't be so good like "Cloud Castle" and other epic D-mods.It will be an ordinary mod.
[it will be more interesting than ABCDEFGHIGKLMNOPQRSTUVWXYZ and Scary Beast]
[it will be more interesting than ABCDEFGHIGKLMNOPQRSTUVWXYZ and Scary Beast]
If you try hard maybe it will be worth 5.5(use modify button)
Guys,please help me.I don't know how to make the stone moving when I push it.
It has it's own procedure, like talk, hit and the rest.
Example:
void push (void)
{
//do stuff when pushed
}
Best way to learn is to look at someone else's script for a moving rock or something.
Example:
void push (void)
{
//do stuff when pushed
}
Best way to learn is to look at someone else's script for a moving rock or something.
Can anyone tell me how can i pick up any sword or other stuffs?
Assuming you know somewhat about scripting, here are some code lines to get each item.
Items/weapons
-------------
//fists
add_item("item-fst",438,1);
//long sword
add_item("item-sw1",438,7);
//claw sword
add_item("item-sw2",438,20);
//light sword
add_item("item-sw3",438,21);
//bomb
add_item("item-bom",438,3);
//normal bow
add_item("item-b1",438,8);
//heavy bow
add_item("item-b2",438,12);
//fire bow
add_item("item-b3",438,13);
//elixir
add_item("item-eli",438,11);
//herb boots
add_item("item-bt",438,22);
Magic
-----
//fire ball
add_magic("item-fb",437,1);
//hellfire
add_magic("item-sfb",437,2);
//acid rain
add_magic("item-ice",437,5);
Items/weapons
-------------
//fists
add_item("item-fst",438,1);
//long sword
add_item("item-sw1",438,7);
//claw sword
add_item("item-sw2",438,20);
//light sword
add_item("item-sw3",438,21);
//bomb
add_item("item-bom",438,3);
//normal bow
add_item("item-b1",438,8);
//heavy bow
add_item("item-b2",438,12);
//fire bow
add_item("item-b3",438,13);
//elixir
add_item("item-eli",438,11);
//herb boots
add_item("item-bt",438,22);
Magic
-----
//fire ball
add_magic("item-fb",437,1);
//hellfire
add_magic("item-sfb",437,2);
//acid rain
add_magic("item-ice",437,5);
thanks but there is problem.i write this but i cant pick them up.
If you just want Dink to walk over it and pick it up, try this on the graphic you want: (My scripting is a little rusty):
void touch(void)
{
//add a sound if you want
add_item("item-sw1",438,7);
kill_this_task
}
I think that should do it.
Now, if you want a shop, that's a different story.
void touch(void)
{
//add a sound if you want
add_item("item-sw1",438,7);
kill_this_task
}
I think that should do it.
Now, if you want a shop, that's a different story.
Don't forget to give it a touch damage of -1 first. Otherwise the touch procedure will not be run.
A full script would be something like this:
(comments included...)
void main(void)
{
//set the touch damage, just in case we forgot to do this in the editor:
sp_touch_damage(¤t_sprite,-1);
}
void touch(void)
{
//Set back the touch damge to zero so it can't be run again until it's finished.
//It shouldn't be a problem in this script though, but just to obtain good habits:
sp_touch_damage(¤t_sprite,0);
//Next we check wether Dink has enough space in his backpack:
int &hold = free_items();
if (&hold < 1)
{
say("Ahh, I'm carrying to much...",1);
//Here you'd better make sure that Dink walks away before setting the touch damage back to -1.
//If you don't the script could repeat forever.
sp_touch_damage(¤t_sprite,-1);
return;
}
//If the script is here Dink has space in his backpack so let's give the item to Dink:
add_item("item-sw1",438,7);
say("Yipee, a sword!",1);
//Now let's kill of this sprite forever so Dink can only get this item once:
//If you want Dink to be able to get an infinite amount of this item, remove the next lines.
//This only works if the sprite is placed in the editor!!
&hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
{
editor_type(&hold,1);
}
sp_active(¤t_sprite,0);
}
A full script would be something like this:
(comments included...)
void main(void)
{
//set the touch damage, just in case we forgot to do this in the editor:
sp_touch_damage(¤t_sprite,-1);
}
void touch(void)
{
//Set back the touch damge to zero so it can't be run again until it's finished.
//It shouldn't be a problem in this script though, but just to obtain good habits:
sp_touch_damage(¤t_sprite,0);
//Next we check wether Dink has enough space in his backpack:
int &hold = free_items();
if (&hold < 1)
{
say("Ahh, I'm carrying to much...",1);
//Here you'd better make sure that Dink walks away before setting the touch damage back to -1.
//If you don't the script could repeat forever.
sp_touch_damage(¤t_sprite,-1);
return;
}
//If the script is here Dink has space in his backpack so let's give the item to Dink:
add_item("item-sw1",438,7);
say("Yipee, a sword!",1);
//Now let's kill of this sprite forever so Dink can only get this item once:
//If you want Dink to be able to get an infinite amount of this item, remove the next lines.
//This only works if the sprite is placed in the editor!!
&hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
{
editor_type(&hold,1);
}
sp_active(¤t_sprite,0);
}