Reply to Re: wait_for_bottom
If you don't have an account, just leave the password field blank.
I'll just go pimp run_script_by_number() again. If you put ¤t_script somewhere in a global, you can use that in a key script to jump to a procedure.
It's a bit of a roundabout way of doing things, though. Still, it may be of some use in some cases.
Also works great with spawn():
It's a bit of a roundabout way of doing things, though. Still, it may be of some use in some cases.
// somewhere in main.c
make_global_int("&keyhandler",0);
// key-68.c
void main( void )
{
if (&keyhandler > 0)
{
run_script_by_number(&keyhandler,"d");
}
kill_this_task();
}
// script.c
void main( void )
{
int &d = 0;
}
void talk( void )
{
if (&d > 0)
{
say_stop("Nope. Wrong button. Press D.",1);
return;
}
say_stop("Oh. Looks like I have to press D to continue.",1);
&keyhandler = ¤t_script;
return;
d1:
say_stop("Another bit of stuff here.",1);
say_stop("Mind, you, to see more, press D again.",1);
&keyhandler = ¤t_script;
return;
d2:
say_stop("That's it! Keep pressing that key!",1);
&keyhandler = ¤t_script;
return;
d3:
say_stop("End of story.",1);
}
// I'm not too happy about this bit, but oh well. You could of course put the cutscene-stuff directly inside this.
void d( void )
{
&keyhandler = 0;
&d += 1;
if (&d == 1)
{
goto d1;
}
if (&d == 2)
{
goto d2;
}
if (&d == 3)
{
goto d3;
}
}
Also works great with spawn():
// In main.c
make_global_int("&keyhandler",0);
// Did you know: main.c gets run on game load as well!
&keyhandler = spawn("keyhandler");
// keyhandler.c
void d( void )
{
say("D",1);
}
// key-68.c
void main( void )
{
if (&keyhandler > 0)
{
run_script_by_number(&keyhandler,"d");
}
kill_this_task();
}







