How do i make it so i can pick up gold
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!
plese help!
Check the source of original Dink, it's in the "develop" folder.
October 9th 2005, 06:33 PM

RANKN67


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?............
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(¤t_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.
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(¤t_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

RANKN67


Thank u thank u thank u thank u thank u!!
ur a real life saver.
ur a smart kid!
thanku!!
ur a real life saver.
ur a smart kid!
thanku!!
October 9th 2005, 08:22 PM

RANKN67


wait, one more thing, how do i make a sprite drop gold wen it dies?
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(¤t_sprite, -1);
&save_y = sp_y(¤t_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);
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(¤t_sprite, -1);
&save_y = sp_y(¤t_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);
im new at this but could u show me an example on wat the script would look like?
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(¤t_sprite,0)
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 1);
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(¤t_sprite,0)

int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 1);
ok, i still dont get it, do u think we could pm each other some time? then u could kinda walk me through it?
I suggest you to download CEdit. It has some great tutorials at help.
o ya metatarsal, wat does the void die () procedure look like?
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.
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(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 6);
&save_x = sp_x(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
int &golda = create_sprite&save_x,&save_y,0,178,3);
sp_script(&golda,"<the name of the script of the gold>");
}
After some modifications the void die() procedure would look like this:
void die( void )
{
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 6);
&save_x = sp_x(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
int &golda = create_sprite&save_x,&save_y,0,178,3);
sp_script(&golda,"<the name of the script of the gold>");
}
I suggest you download a source file dude..
------------------------------------------------------------------------------------------------
script for 200 gold
------------------------------------------------------------------------------------------------/200 gold
void main( )
{
sp_pseq(¤t_sprite, 178);
sp_frame(¤t_sprite, 4);
// sp_brain(¤t_sprite, 6);
sp_touch_damage(¤t_sprite, -1);
sp_nohit(¤t_sprite, 1);
}
void touch( void )
{
&gold +=200;
say("Where could I spend this?",1);
sp_brain_parm(¤t_sprite, 10);
sp_brain(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_sprite, 0);
//kill this item so it doesn't show up again for this player
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 1);
}
------------------------------------------------------------------------------------------------
script for 200 gold
------------------------------------------------------------------------------------------------/200 gold
void main( )
{
sp_pseq(¤t_sprite, 178);
sp_frame(¤t_sprite, 4);
// sp_brain(¤t_sprite, 6);
sp_touch_damage(¤t_sprite, -1);
sp_nohit(¤t_sprite, 1);
}
void touch( void )
{
&gold +=200;
say("Where could I spend this?",1);
sp_brain_parm(¤t_sprite, 10);
sp_brain(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_sprite, 0);
//kill this item so it doesn't show up again for this player
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 1);
}
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?)
This will show you what is needed to make certain things happen.(does that make any sense?)
Just fire up Dinkedit.exe, if you didn't do anything special with it, it should edit the main game.

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

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, 05:05 PM

RANKN67


ok thanks guys, i think i was just gettin alittle frustrated and snaped, sorry iglooo