The Dink Network

some help with treasure chests

March 3rd 2005, 08:19 AM
anon.gif
sir akn
Ghost They/Them
 
ii make a treasure chest and i hit it and i open it up i hooked a treasure chest script to it so money comes out but when i go over the money it says i found 500 gold but actually my money doesent go up whhat do i do
March 3rd 2005, 08:24 AM
milder.gif
show us the script you are using. We can see it immediatly

void touch( void )
{
&gold += 200;

Maybe this line helps
March 3rd 2005, 08:26 AM
anon.gif
sir akn
Ghost They/Them
 
here you are:

//script for chest with 500 gold in it

void main( void)
{
preload_seq(177);
}

void hit ( void )
{
//play noise
int &hold = sp_editor_num(&current_sprite);

if (&hold != 0)
{
//this was placed by the editor, lets make the chest stay open
editor_type(&hold, 4);
editor_seq(&hold, 177);
editor_frame(&hold, 6);
//type means show this seq/frame combo as background in the future
}
&save_x = sp_x(&current_sprite, -1);
&save_y = sp_y(&current_sprite, -1);
external("make", "gold500")

sp_seq(&current_sprite, 177);
sp_script(&current_sprite, "");
sp_notouch(&current_sprite, 1);
sp_nohit(&current_sprite, 1);
}
March 3rd 2005, 08:30 AM
milder.gif
I used that one to or a little similar.

But I miss a gold + line see upper reply of me.
March 3rd 2005, 08:31 AM
anon.gif
sir akn
Ghost They/Them
 
what i dont understand what your saying
March 3rd 2005, 08:32 AM
milder.gif
Notification I used that one to. But when I am not mistaken I am not on my own computer now. I have a good one at home.

I have stole this script from another DMOD I don't know which it was. I will try find one for you.
March 3rd 2005, 08:35 AM
anon.gif
sir akn
Ghost They/Them
 
cool ty
March 3rd 2005, 08:35 AM
milder.gif
Sorry, my fault. This is what you must do. You can use this one. But get in the develop file of the main dink game. In the source.zip. Copy the gold500.c and put it in you're storyfile of you're dmod. Then It will work good.
March 3rd 2005, 08:38 AM
anon.gif
sir akn
Ghost They/Them
 
i extracted all the source from develop to my story folder i already did that it still doesent work
March 3rd 2005, 08:40 AM
milder.gif
You didn;'t changed any .c names. Maybe you shouldn't extract all the files. Just the necessary ones. Maybe you have now two ch500.c or two gold500.c files.
March 3rd 2005, 08:42 AM
anon.gif
sir akn
Ghost They/Them
 
i dont
March 3rd 2005, 10:15 AM
milder.gif
And you have the make.c file to in you're story folder.
March 3rd 2005, 10:18 AM
death.gif
sirakn
Peasant He/Him
 
the file that i put up on there is in my stry file its a .c file i just dont get the gold when i pick it up how do fix that
March 3rd 2005, 10:18 AM
milder.gif
And the main script says seq 177 are you using that one and did you also put the gold.c files in you're story file
March 3rd 2005, 10:21 AM
death.gif
sirakn
Peasant He/Him
 
yes and i still dont get it when i pick it up
March 3rd 2005, 10:22 AM
milder.gif
That is odd. Could you send me you're story file.

jpdebruijn@gmail.com
March 3rd 2005, 10:22 AM
milder.gif
without you're own written scripts
March 3rd 2005, 10:24 AM
death.gif
sirakn
Peasant He/Him
 
my whole story file with all my scripts i have alot in there?
March 3rd 2005, 10:25 AM
milder.gif
without you're own written ones
March 3rd 2005, 10:26 AM
death.gif
sirakn
Peasant He/Him
 
thats not hard i didnt write any of my own i always use theres but erase certain things
March 3rd 2005, 10:27 AM
death.gif
sirakn
Peasant He/Him
 
and i didnt erase anything from the treasure chest file
March 3rd 2005, 10:29 AM
milder.gif
you could send them to me. I won't tell the community what the storyline is. Is the hardness around the chest good. Is there maybe some hardness that blocks the gold?
March 3rd 2005, 10:33 AM
death.gif
sirakn
Peasant He/Him
 
no i get the gold!! it just doesent add to my money it just says i found 500 gold and the gold disapears no sound goin chink chink chink like when you get gold it just disapears
March 3rd 2005, 10:37 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
Obviously, if Dink actually says "I found 500 gold.", then the chest scripts runs, make.c runs and gold500.c runs because that's the second line in gold500.c. In other words, there could be a problem with &gold += 500;

Things I can think of: can &gold be found in main.c (to be sure)?, is the status bar updating? (&update_status = 1 should be in start-1.c), have you by any chance set the &gold variable to a negative value in one of your own scripts? or: is there an actual &gold += 500; exactly like that in gold500.c? Or perhaps something else that I can't think of right now
March 3rd 2005, 10:37 AM
milder.gif
THen the line in the gold500.c file is not correct.

I was just looking in my story folder of the Ultimate Challenge I used the ch500.c script. But I did not put the make.c and the gold500.c in the storyfile. But it worked well in the dmod. I could hit the chest open and I could take the gold and it putted 500 gold to coin stats.

May be deleting the files make.c and gold500.c and the gold.c files it will work properly.
March 3rd 2005, 10:39 AM
death.gif
sirakn
Peasant He/Him
 
it dont have .c on it
March 3rd 2005, 10:42 AM
milder.gif
Every script in the story file can only work properly when it is saved as a .c file or as a .d file.

But sometimes when it is saved as a .d file there can be a bug that will cause a problem by running the game.
March 3rd 2005, 10:45 AM
death.gif
sirakn
Peasant He/Him
 
it dont have .c or .d nect to it but i know its
.c
March 3rd 2005, 11:16 AM
milder.gif
I know not an answer right now. I will see tonight when I am at home and when I am sitting behind my own computer then I will see what I can do.
On my own computer are standing a lot of scripts maybe I have one that could help you/
March 3rd 2005, 11:17 AM
death.gif
sirakn
Peasant He/Him
 
cool ty