Reply to Re: O.K., what's wrong with this script ?
If you don't have an account, just leave the password field blank.
if you want to make a 10 screens long cave, you have to make only 5 screens.
( begin, 3 caves and cave end )
If dink walks to the left ( he needs to walk 10 screens ) if he walks to the right, he exits the cave,
when he walked 10 screens to the left he will exit the cave on the other side.
You need a global int for this, lets call it &caveloop...
Ok
Begin Exit = O
Cave = X
Cave Exit = P
dink needs to reach P
here is a picture:
PXXXXXXXXXXO
but in the editor its
P X X X O
1 2 3 4 5 ( map screen numbers, for example )
then add this script to map screen 2:
void main(void)
{
freeze(1);
if (&caveloop == 10);
{
goto end;
}
script_attach(1000);
&player_map = 3;
load_screen(3);
draw_screen();
&caveloop += 1;
end:
unfreeze(1);
kill_this_task();
}
and add this script to screen 5:
void main(void)
{
&caveloop=0;
kill_this_task();
}
Now, add this script to screen 1:
void main(void)
{
&caveloop=10;
kill_this_task();
}
and this script to screen 4:
void main(void)
{
freeze(1);
if (&caveloop == 0);
{
goto end;
}
script_attach(1000);
&player_map = 3;
load_screen(3);
draw_screen();
&caveloop -= 1;
end:
unfreeze(1);
kill_this_task();
}
editted: sorry, error. Its fixed now
( begin, 3 caves and cave end )
If dink walks to the left ( he needs to walk 10 screens ) if he walks to the right, he exits the cave,
when he walked 10 screens to the left he will exit the cave on the other side.
You need a global int for this, lets call it &caveloop...
Ok
Begin Exit = O
Cave = X
Cave Exit = P
dink needs to reach P
here is a picture:
PXXXXXXXXXXO
but in the editor its
P X X X O
1 2 3 4 5 ( map screen numbers, for example )
then add this script to map screen 2:
void main(void)
{
freeze(1);
if (&caveloop == 10);
{
goto end;
}
script_attach(1000);
&player_map = 3;
load_screen(3);
draw_screen();
&caveloop += 1;
end:
unfreeze(1);
kill_this_task();
}
and add this script to screen 5:
void main(void)
{
&caveloop=0;
kill_this_task();
}
Now, add this script to screen 1:
void main(void)
{
&caveloop=10;
kill_this_task();
}
and this script to screen 4:
void main(void)
{
freeze(1);
if (&caveloop == 0);
{
goto end;
}
script_attach(1000);
&player_map = 3;
load_screen(3);
draw_screen();
&caveloop -= 1;
end:
unfreeze(1);
kill_this_task();
}
editted: sorry, error. Its fixed now