Help me!!!!! Again...
I want to know why this variable doesn't works!
___________________________________________________________________
//this script fills life up, touch_damage must be set to -1. (run script mode)
int &secret;
void main( )
{
sp_pseq(¤t_sprite, 163);
sp_frame(¤t_sprite, 4); //so the seq will start
// sp_brain(¤t_sprite, 0);
sp_touch_damage(¤t_sprite, -1);
sp_nohit(¤t_sprite, 1);
//create shiny thingie
&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 )
{
sp_brain_parm(¤t_sprite, 10);
sp_brain(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_sprite, 0);
if (&secret == 0)
{
say_stop(" Secret 1", 1);
&secret += 1;
}
if (&secret == 1)
{
say_stop(" Secrets 2", 1);
&secret += 2;
___________________________________________________________________
Please someone help me!! Again...
___________________________________________________________________
//this script fills life up, touch_damage must be set to -1. (run script mode)
int &secret;
void main( )
{
sp_pseq(¤t_sprite, 163);
sp_frame(¤t_sprite, 4); //so the seq will start
// sp_brain(¤t_sprite, 0);
sp_touch_damage(¤t_sprite, -1);
sp_nohit(¤t_sprite, 1);
//create shiny thingie
&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 )
{
sp_brain_parm(¤t_sprite, 10);
sp_brain(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_sprite, 0);
if (&secret == 0)
{
say_stop(" Secret 1", 1);
&secret += 1;
}
if (&secret == 1)
{
say_stop(" Secrets 2", 1);
&secret += 2;
___________________________________________________________________
Please someone help me!! Again...
Well, the most obvious thing is that you lack closing brackets to end void touch() and the last if statement.
It sounds like the variable &secret should be a global. Add this line in main.c: make_global_int("&secret", 0);
Remove the line int &secret; from the script, it doesn't do anything at the place it is right now.
Oh, and do what Striker told you, in fact always do what Striker tells you.
Remove the line int &secret; from the script, it doesn't do anything at the place it is right now.
Oh, and do what Striker told you, in fact always do what Striker tells you.
Not exacly Striker, this script continues ends at &secret == 30, the
bracket is closed at the real script and i already done this metatarasal, but the script doesn't works!!
Thanks for the help, but it still doesn't works...
bracket is closed at the real script and i already done this metatarasal, but the script doesn't works!!
Thanks for the help, but it still doesn't works...
Okay, next thing... is sprite set to normal, and not background?
What other information can you provide us with aside from "it doesn't work"? What's it doing right now?
What other information can you provide us with aside from "it doesn't work"? What's it doing right now?
I do not know how the dink.exe interpretes the *.c scripts, but do you know that in real ANSI / ISO C programming, it should never be void main() but int main() and then do not forget return 0; befor the ending curly brace.
- if, int main() is the only way to write this, is beyond my present knowledge.
ex.
int main()
{
/* bla bla bla*/
/* bla bla bla*/
/* bla bla bla*/
return 0;
}
If you have got the patience, you can find this at....
http://www.faqs.org/faqs/C-faq/faq/
- if, int main() is the only way to write this, is beyond my present knowledge.
ex.
int main()
{
/* bla bla bla*/
/* bla bla bla*/
/* bla bla bla*/
return 0;
}
If you have got the patience, you can find this at....
http://www.faqs.org/faqs/C-faq/faq/
While that is correct protocol for the C language... it won't work in DinkC. DinkC can only handle procedures that begin with void. That faq won't really help.
This script is used as an item, you touch it and Dink says "Secret 1", but when i get the second "Secret Item" Dink says "Secret 1"!! Is it happening cos' the variable is not working, right??
And another doubt, i don't know how edit the ini file, so... someone could help me?? "load_sequence_now graphics\dink\sword\hit\d-sa8- 108 75 46 109 -17 -16 17 10" "load_sequence_now graphics\dink\sword\hit\d-sa8" Until i know what to do but, which the meaning of the other numbers??
And thanks for the patience.
And another doubt, i don't know how edit the ini file, so... someone could help me?? "load_sequence_now graphics\dink\sword\hit\d-sa8- 108 75 46 109 -17 -16 17 10" "load_sequence_now graphics\dink\sword\hit\d-sa8" Until i know what to do but, which the meaning of the other numbers??
And thanks for the patience.