some help with treasure chests
March 3rd 2005, 08:19 AM
sir akn
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
show us the script you are using. We can see it immediatly
void touch( void )
{
&gold += 200;
Maybe this line helps
void touch( void )
{
&gold += 200;
Maybe this line helps
March 3rd 2005, 08:26 AM
sir akn
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(¤t_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(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
external("make", "gold500")
sp_seq(¤t_sprite, 177);
sp_script(¤t_sprite, "");
sp_notouch(¤t_sprite, 1);
sp_nohit(¤t_sprite, 1);
}
//script for chest with 500 gold in it
void main( void)
{
preload_seq(177);
}
void hit ( void )
{
//play noise
int &hold = sp_editor_num(¤t_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(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
external("make", "gold500")
sp_seq(¤t_sprite, 177);
sp_script(¤t_sprite, "");
sp_notouch(¤t_sprite, 1);
sp_nohit(¤t_sprite, 1);
}
I used that one to or a little similar.
But I miss a gold + line see upper reply of me.
But I miss a gold + line see upper reply of me.
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.
I have stole this script from another DMOD I don't know which it was. I will try find one for you.
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
sir akn
i extracted all the source from develop to my story folder i already did that it still doesent work
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.
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
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
That is odd. Could you send me you're story file.
jpdebruijn@gmail.com
jpdebruijn@gmail.com
thats not hard i didnt write any of my own i always use theres but erase certain things
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?
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
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
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
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.
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.
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.
But sometimes when it is saved as a .d file there can be a bug that will cause a problem by running the game.
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/
On my own computer are standing a lot of scripts maybe I have one that could help you/