Script(s) Problem(s)
Dink is going to get some nut from an alktree for his mother, when he gets back is his village on fire, and after dink has fainted and the fire is gone, can dink go and get more nuts, but then is the village on fire again.
//Nut Script
void main( void )
{
sp_touch_damage(¤t_sprite, -1);
}
void touch( void )
{
int &junk = free_items();
if (&junk < 1)
{
say("I'm full! I can't pick up anything else.", 1);
return;
}
Playsound(10,22050,0,0,0);
add_item("item-nut",438, 19);
if (&nuttree < 1)
{
&nuttree = 1;
&story = 2;
}
say("I picked up a nut!",1);
sp_active(¤t_sprite, 0);
}
//Vision Script
void main( void )
{
if (&story == 2)
{
&vision = 1;
say("OH NO, My village is on fire!! I need to check if mom is ok!", 1);
}
if (&story >= 3)
{
&vision = 2;
}
}
//Nut Script
void main( void )
{
sp_touch_damage(¤t_sprite, -1);
}
void touch( void )
{
int &junk = free_items();
if (&junk < 1)
{
say("I'm full! I can't pick up anything else.", 1);
return;
}
Playsound(10,22050,0,0,0);
add_item("item-nut",438, 19);
if (&nuttree < 1)
{
&nuttree = 1;
&story = 2;
}
say("I picked up a nut!",1);
sp_active(¤t_sprite, 0);
}
//Vision Script
void main( void )
{
if (&story == 2)
{
&vision = 1;
say("OH NO, My village is on fire!! I need to check if mom is ok!", 1);
}
if (&story >= 3)
{
&vision = 2;
}
}
I had a problem like this once, but then I realised I hadn't declared the global variables in the Main script. I assume you did not make the same mistake?
No I everything is declared in the MAIN.c
I thought so, in which case I can't help you since I'm still a newbie really.
You never change &story to 3?
Not in these scriopts anyway.
Not in these scriopts anyway.
scratcher is right. Your vision script should look like this:
//Vision Script
void main( void )
{
if (&story >= 3)
{
&vision = 2;
}
if (&story == 2)
{
&vision = 1;
say("OH NO, My village is on fire!! I need to check if mom is ok!", 1);
&story = 3;
}
}
I changed the "if"s places because if I didn't, the &story would become 3 in the first "if", then the second if would change the vision to 2, in the same script.
//Vision Script
void main( void )
{
if (&story >= 3)
{
&vision = 2;
}
if (&story == 2)
{
&vision = 1;
say("OH NO, My village is on fire!! I need to check if mom is ok!", 1);
&story = 3;
}
}
I changed the "if"s places because if I didn't, the &story would become 3 in the first "if", then the second if would change the vision to 2, in the same script.