doh!
void talk(void)
{
if(&stick==1)
{
say_stop("This stick will work, two more",1);
&stick += 1;
if(&stick==2)
{
say_stop("Ok, one more should do it!",1);
&stick=+1;
if(&stick==3)
{
say_stop("Now I'll try to start a fire in my house.",1);
&stick+=1;
Kill_this_task();
}
}
}
}
\\these two in unison should work, you can't \\talk to the sticks!
VOID MAIN(VOID)
{
playmidi("1.mid");
int &mom = create_sprite(208, 164, 16, 353, 1);
sp_base_walk(&mom, 350);
sp_speed(&mom, 1);
freeze(&mom);
freeze(1);
move_stop(1, 9, 195, 1);
sp_dir(1,9);
sp_kill(&mom,51000);
say("Hi mom!",1);
wait(4000);
say("`6Not now, I'm busy looking at Dink's masterpiece!!",&mom);
wait(4000);
say("`6Who the heck are you?",&mom);
wait(4000);
say("Mom.. I'm Blink, your son!?",1);
wait(4000);
say("`6Oh yeah, you",&mom);
wait(4000);
say("`6BUT DINK PAINTED THE WALL, WHITE!!",&mom);
wait(4000);
say("Mom, what about me?",1);
wait(4000);
say("Dink is all you talk about!",1);
wait(4000);
say("`6What did you ever do, Blink?",&mom);
wait(4000);
say("Well, today, I was voted best in the science fai...",1);
wait(4000);
say("`6That's great, I need to look at Dink's paintings now!",&mom);
waiT(4000);
say("Well... bye mom! I love you!",1);
wait(4000);
move_stop(&mom, 2, 280, 1);
sp_dir(&mom, 8);
say("`6Whatever",&mom);
wait(4200);
say("I'll do something to make you notice me mom.",1);
wait(4000);
say("For starters, I'll bring in some firewood!",1);
unfreeze(1);
&stick=1;
stopmidi("1.mid");
kill_this_task():
}
{
if(&stick==1)
{
say_stop("This stick will work, two more",1);
&stick += 1;
if(&stick==2)
{
say_stop("Ok, one more should do it!",1);
&stick=+1;
if(&stick==3)
{
say_stop("Now I'll try to start a fire in my house.",1);
&stick+=1;
Kill_this_task();
}
}
}
}
\\these two in unison should work, you can't \\talk to the sticks!
VOID MAIN(VOID)
{
playmidi("1.mid");
int &mom = create_sprite(208, 164, 16, 353, 1);
sp_base_walk(&mom, 350);
sp_speed(&mom, 1);
freeze(&mom);
freeze(1);
move_stop(1, 9, 195, 1);
sp_dir(1,9);
sp_kill(&mom,51000);
say("Hi mom!",1);
wait(4000);
say("`6Not now, I'm busy looking at Dink's masterpiece!!",&mom);
wait(4000);
say("`6Who the heck are you?",&mom);
wait(4000);
say("Mom.. I'm Blink, your son!?",1);
wait(4000);
say("`6Oh yeah, you",&mom);
wait(4000);
say("`6BUT DINK PAINTED THE WALL, WHITE!!",&mom);
wait(4000);
say("Mom, what about me?",1);
wait(4000);
say("Dink is all you talk about!",1);
wait(4000);
say("`6What did you ever do, Blink?",&mom);
wait(4000);
say("Well, today, I was voted best in the science fai...",1);
wait(4000);
say("`6That's great, I need to look at Dink's paintings now!",&mom);
waiT(4000);
say("Well... bye mom! I love you!",1);
wait(4000);
move_stop(&mom, 2, 280, 1);
sp_dir(&mom, 8);
say("`6Whatever",&mom);
wait(4200);
say("I'll do something to make you notice me mom.",1);
wait(4000);
say("For starters, I'll bring in some firewood!",1);
unfreeze(1);
&stick=1;
stopmidi("1.mid");
kill_this_task():
}
What are you trying to do, you can delete all those if statements, because they dink will run all those say_stop commands...
Btw, you can only talk to the sticks, when the variable IS 1, if its 0, then you will never be able to talk to them.
WHAT ARE YOU TRYING TO DO? :S
WHAT ARE YOU TRYING TO DO? :S
So, basically even though I want Dink to say something different when he finds each stick, they'll all run together because I used say_stop instead of plain say? I also included the other script to show that I already set the variable, &stick, to 1
And I did make the global variable, if you're gonna ask that
And I did make the global variable, if you're gonna ask that
Oh, assign this script to each stick on the ground:
void talk(void)
{
if (&stick == 1) goto ast;
if (&stick == 2) goto bst;
if (&stick == 3) goto cst;
AST:
say_stop("First text", 1);
goto end;
BST:
say_stop("Second text", 1);
goto end;
CST:
say_stop("Third text", 1);
end:
&stick += 1;
editor_type(¤t_sprite, 1);
}
void talk(void)
{
if (&stick == 1) goto ast;
if (&stick == 2) goto bst;
if (&stick == 3) goto cst;
AST:
say_stop("First text", 1);
goto end;
BST:
say_stop("Second text", 1);
goto end;
CST:
say_stop("Third text", 1);
end:
&stick += 1;
editor_type(¤t_sprite, 1);
}
when &stick = 4 dink has all the sticks, when its 1 he has none
Dink runs all the text at once, since you don't have return; after you add 1 to the story...
You should do like this:
if(&stick==1)
{
&stick += 1;
say_stop("This stick will work, two more",1);
return;
}
if(&stick==2)
{
&stick += 1;
say_stop("Ok, one more should do it!",1);
return;
}
if(&stick==3)
{
&stick += 1;
say_stop("Now I'll try to start a fire in my house.",1);
return;
}
You should do like this:
if(&stick==1)
{
&stick += 1;
say_stop("This stick will work, two more",1);
return;
}
if(&stick==2)
{
&stick += 1;
say_stop("Ok, one more should do it!",1);
return;
}
if(&stick==3)
{
&stick += 1;
say_stop("Now I'll try to start a fire in my house.",1);
return;
}
As an alternative for all those gotos:
void talk(void)
{
if (&stick == 3)
{
//do this
}
if (&stick == 2)
{
//do this
}
if (&stick == 1)
{
//do this
}
&stick += 1;
}
void talk(void)
{
if (&stick == 3)
{
//do this
}
if (&stick == 2)
{
//do this
}
if (&stick == 1)
{
//do this
}
&stick += 1;
}
Simeon, I find the gotos much easier, why? Because I have a problem with spaces, when I make a if statement, it always doesnt work, because, I dont know, I think too many or little spaces.
I know its strange, but I thing the goto-way is easier and never fails...
I know its strange, but I thing the goto-way is easier and never fails...
Thanks! I never knew that goto command existed, it'll save me a whole lota time.
!! TheProphet is a goto whore...I hate goto, any real programmer does.
START:
sp_kill(&wc, 1);
goto START;
I love goto's
I know goto's are not perfect, but it helps. And I know you shouldnt use gotos, but I do
sp_kill(&wc, 1);
goto START;
I love goto's
I know goto's are not perfect, but it helps. And I know you shouldnt use gotos, but I do
Well, since dink doesn;t support while, for, ect loops, goto's are needed, but there is a easier way to write that script (and probably much better for editing. Here is my example.
void talk(void)
{
if (&stick == 3)
{
say_stop("Third text", 1);
&stick += 1;
editor_type(¤t_sprite, 1);
}
if (&stick == 2)
{
say_stop("Second text", 1);
&stick += 1;
editor_type(¤t_sprite, 1);
}
if (&stick == 1)
{
say_stop("First text", 1);
&stick += 1;
editor_type(¤t_sprite, 1);
}
}
void talk(void)
{
if (&stick == 3)
{
say_stop("Third text", 1);
&stick += 1;
editor_type(¤t_sprite, 1);
}
if (&stick == 2)
{
say_stop("Second text", 1);
&stick += 1;
editor_type(¤t_sprite, 1);
}
if (&stick == 1)
{
say_stop("First text", 1);
&stick += 1;
editor_type(¤t_sprite, 1);
}
}
that one doesn't seem to work, you can't even talk to the stick...
I've no idea why your if-statements don't work, but anyway, when you get to work with real languages, you'll see why you shouldn't use goto's there - those languages offer greater contol of running parts of a script somewhere else
This is a nice one!
D:
goto a;
B:
goto C;
A:
goto b;
C:
goto D;
D:
goto a;
B:
goto C;
A:
goto b;
C:
goto D;
Assign this to any sprite:
void main( void )
{
crap:
say("I suck.", 1);
goto crap;
}
void main( void )
{
crap:
say("I suck.", 1);
goto crap;
}