The Dink Network

How do i make it so i can pick up gold

October 9th 2005, 01:24 PM
slayer.gif
RANKN67
Peasant He/Him
 
im new at programing since i actually started 2 days ago,and i need halp makin a script so i can have dink pik up gold wen he walks over it

plese help!
October 9th 2005, 01:29 PM
spike.gif
Check the source of original Dink, it's in the "develop" folder.
October 9th 2005, 01:31 PM
slayer.gif
RANKN67
Peasant He/Him
 
wat should i be lookin for?
October 9th 2005, 01:54 PM
spike.gif
1gold, gold200, gold500
October 9th 2005, 06:33 PM
anon.gif
RANKN67
Ghost They/Them
 
ok, i cant find it, but if i do , i atach the script to the gold, then wat, should the gold have a hard box? should i activate nohit?............
October 9th 2005, 06:49 PM
spike.gif
Default path is C:\Program Files\Dink Smallwood\develop\source.zip

Then you put a piece/pile of gold in the editor, and attach the script to it. The sprite shouldn't be hard and should have nohit(&current_sprite, 1); which is propably in the script to begin with so you don't have to do it yourself. Actually you don't have to copy the script at all unless you want to modify it (which you propably do though), just attach it to a sprite.
October 9th 2005, 07:10 PM
anon.gif
RANKN67
Ghost They/Them
 
Thank u thank u thank u thank u thank u!!

ur a real life saver.

ur a smart kid!

thanku!!
October 9th 2005, 08:22 PM
anon.gif
RANKN67
Ghost They/Them
 
wait, one more thing, how do i make a sprite drop gold wen it dies?

October 10th 2005, 01:39 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Generally this is done via the script emake.
You can put one of these line in a sprites void die() procedure.
external("emake","small"); //for small hearts
external("emake","medium"); //for a low amount of gold, food, small heart or a large heart.
external("emake","large"); //for a high amount of gold, food or a large heart
external("emake","xlarge"); //for a large heart or a really large sum of money

What you get when running one of these procedures is randomly determined.

If you want to manualy determine the amount of money dropped by a sprite try putting this in the void die() procedure:

&save_x = sp_x(&current_sprite, -1);
&save_y = sp_y(&current_sprite, -1);
int &golda = create_sprite&save_x,&save_y,0,178,3);
sp_script(&golda,"lgold");
//(you could actually also use mgold, 1gold, gold200 or gold500 for this, but I chose lgold for this example)

If you also want to excactly determine the amount of gold given to the player, copy lgold from the source folder and edit it as you like.
You should probably replace these lines:

int &mcrap = random(25,50);
&gold += &mcrap;
say("I found &mcrap gold.",1);

with:

&gold += *the amount of money you want to give the player*;
say("I found *the amount of money you want to give the player* gold.",1);

October 10th 2005, 09:01 AM
slayer.gif
Rankn67
Peasant He/Him
 
im new at this but could u show me an example on wat the script would look like?
October 10th 2005, 10:40 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
You mean the script lgold? You can just look into the source folder.
This is an example of a script you can use (just lgold with some modifications):

void main( )
{
sp_pseq(¤t_sprite, 178);
sp_frame(¤t_sprite, 4);
sp_touch_damage(¤t_sprite, -1);
sp_nohit(¤t_sprite, 1);

&save_x = sp_x(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
&save_y += random(5,1);
int &startframe = random(5,1);
int &spark = create_sprite(&save_x, &save_y, 15, 165, 1);
sp_seq(&spark, 165);
sp_nohit(&spark, 1);
sp_frame(&spark, &startframe);
sp_brain_parm(&spark, ¤t_sprite);

}

void touch( void )
{
&gold += 1000;
say("WOW! I just found 1000 gold!",1);
sp_brain_parm(¤t_sprite, 10);
sp_brain(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_sprite, 0);
}

You should only use this one with monsters
if you want to be able to place it in the editor paste these lines into the script: (directly after sp_timing(&current_sprite,0)

int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
editor_type(&hold, 1);
October 10th 2005, 11:35 AM
slayer.gif
rankn67
Peasant He/Him
 
ok, i still dont get it, do u think we could pm each other some time? then u could kinda walk me through it?
October 10th 2005, 01:32 PM
knightg.gif
cypry
Peasant He/Him Romania
Chop your own wood, and it will warm you twice. 
I suggest you to download CEdit. It has some great tutorials at help.
October 10th 2005, 03:43 PM
slayer.gif
rankn67
Peasant He/Him
 
i downloaded it but i still dont see how it will help
October 10th 2005, 03:45 PM
slayer.gif
rankn67
Peasant He/Him
 
o ya metatarsal, wat does the void die () procedure look like?
October 11th 2005, 09:39 AM
goblins.gif
igloo15
Peasant He/Him
 
Its impossible for the people on the forum to answer every question you have and help you along the way. I suggest you read the MANY MANY faqs here on the website learn about how dink works and then start reading sample scripts in the develop folder soon you may be able to get it.
October 11th 2005, 11:09 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Just use the standard void die() procedure from one of the enemies in the source folder.
After some modifications the void die() procedure would look like this:
void die( void )
{
int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
editor_type(&hold, 6);

&save_x = sp_x(&current_sprite, -1);
&save_y = sp_y(&current_sprite, -1);
int &golda = create_sprite&save_x,&save_y,0,178,3);
sp_script(&golda,"<the name of the script of the gold>");
}
October 12th 2005, 04:20 PM
pillbug.gif
XXhex
Peasant He/Him
 
I suggest you download a source file dude..
------------------------------------------------------------------------------------------------
script for 200 gold
------------------------------------------------------------------------------------------------/200 gold

void main( )
{
sp_pseq(&current_sprite, 178);
sp_frame(&current_sprite, 4);
// sp_brain(&current_sprite, 6);
sp_touch_damage(&current_sprite, -1);
sp_nohit(&current_sprite, 1);
}

void touch( void )
{
&gold +=200;
say("Where could I spend this?",1);
sp_brain_parm(&current_sprite, 10);
sp_brain(&current_sprite, 12);
sp_touch_damage(&current_sprite, 0);
sp_timing(&current_sprite, 0);

//kill this item so it doesn't show up again for this player
int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
editor_type(&hold, 1);

}
October 12th 2005, 06:26 PM
custom_carrie2004.gif
carrie2004
Peasant She/Her Canada
*chomp* 
I found it really helpful to use Dinkedit and look at the main game.Going into a screen that has something happening that you'd like to know how to do, is fairly simple.Once you are looking at a particular screen, press 'i' and it will show you the scripts on that screen.Write the names of those scripts down.By using Cedit, you can open those scripts that are in the 'develop' folder.
This will show you what is needed to make certain things happen.(does that make any sense?)
October 29th 2005, 11:08 AM
slayer.gif
RANKN67
Peasant He/Him
 
how do i make it so i cna run the main game wiht dinkedit

October 29th 2005, 04:34 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Just fire up Dinkedit.exe, if you didn't do anything special with it, it should edit the main game.
October 31st 2005, 07:47 AM
anon.gif
RANKN67
Ghost They/Them
 
sweet!!
November 14th 2005, 06:22 AM
slayer.gif
RANKN67
Peasant He/Him
 
o ya, igloo or watever ur name, not to be mean but screw u!! why the hech do u think i go to the forums if i dont want all my questions answered or would u rather me make a little topic for every little question, i thought it would save some room, JEESE
November 14th 2005, 10:39 AM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
Hey now. He is right you know. And he is only trying to help you. You can always ask some specific questions, of course, but most -if not all- of the answers to your questions can be simply answered by reading some tutorials. Check out the development section, download some tutorials about making D-Mods, play Dink goes Boating, and all will be good. Heck, if everyone will do that, there might even be world peace!
November 14th 2005, 02:29 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
So don't do it.
November 14th 2005, 05:05 PM
anon.gif
RANKN67
Ghost They/Them
 
ok thanks guys, i think i was just gettin alittle frustrated and snaped, sorry iglooo