The Dink Network

Creating D-mods

May 6th 2008, 03:05 PM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
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.
May 7th 2008, 01:00 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
There's a script called heart.c in develop folder. You can change how many lifes to add in &life.For example:
&life = +10;
May 7th 2008, 06:39 AM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
But i can't make to use them!
May 7th 2008, 06:50 AM
fairy.gif
GlennGlenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
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.
May 7th 2008, 09:17 AM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
So,i have to attach the script to the sprite?
May 7th 2008, 12:18 PM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
Aye, otherwise how will the engine know what to do with the heart?
May 7th 2008, 01:48 PM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
I know that i have to attach it but there is problem.I can't use them.
May 7th 2008, 05:15 PM
spike.gif
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.
May 8th 2008, 06:05 AM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
sorry scratcher,i mean i can't use the hearts
May 8th 2008, 07:06 AM
spike.gif
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???
May 8th 2008, 07:15 AM
farmer.gif
soulman
Peasant He/Him Bulgaria
I don't break rules.I bend them. 
He means he can't pick it up.
May 8th 2008, 07:49 AM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
Yeah
May 8th 2008, 08:05 AM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
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.
May 8th 2008, 10:29 AM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
ok i'll do it.
May 10th 2008, 08:17 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
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.
May 11th 2008, 06:19 AM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
ok i hope it will help me.thank you anyway
May 11th 2008, 04:16 PM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
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]
May 11th 2008, 11:05 PM
farmer.gif
soulman
Peasant He/Him Bulgaria
I don't break rules.I bend them. 
If you try hard maybe it will be worth 5.5(use modify button)
May 19th 2008, 11:39 AM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
Guys,please help me.I don't know how to make the stone moving when I push it.
May 19th 2008, 02:29 PM
dinkdead.gif
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.
May 19th 2008, 02:38 PM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
Thanks SparrowHawk
May 23rd 2008, 09:22 AM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
Can anyone tell me how can i pick up any sword or other stuffs?
May 23rd 2008, 03:15 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
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);
June 8th 2008, 09:48 AM
wizard.gif
Anubis
Peasant He/Him Bulgaria
 
thanks but there is problem.i write this but i cant pick them up.
June 8th 2008, 11:56 AM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
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.
June 8th 2008, 05:43 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
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(&current_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(&current_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(&current_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(&current_sprite);
if (&hold != 0)
{
editor_type(&hold,1);
}
sp_active(&current_sprite,0);
}
June 8th 2008, 05:47 PM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
Yeah, I forgot to do that. I need to go over my DinkC Reference again.