yet another mystery script problem.
theres another wierd problem that i can't figure out. this script freezes when you choose option 2. here goes;
void main (void)
{
say("`6hello there young man.", ¤t_sprite);
}
void talk (void)
{
freeze(1);
freeze(¤t_sprite);
choice_start();
"be nice."
"be somewhat less nice."
"leave"
choice_end();
if (&result == 1)
{
say_stop("hi, your looking very old today", 1);
say_stop("`6why thank you.", ¤t_sprite);
say_stop("...", 1);
say_stop("`6hmmm...", ¤t_sprite);
say_stop("i'll go now.", 1);
unfreeze(1);
unfreeze(¤t_sprite);
}
if (&result == 2)
{
say_stop("I HATE YOU!", 1);
say_stop("`6fair enough...", ¤t_sprite);
wait(700);
say_stop("hmmm.. i wasnt expecting that...", 1);
say_stop("i know!", 1);
wait(500);
hurt(¤t_sprite, 500);
playsound(9, 8000,0,0,0);
say_stop("that'l teach him to talk back to me!", 1);
unfreeze(1);
}
}
thanks.
void main (void)
{
say("`6hello there young man.", ¤t_sprite);
}
void talk (void)
{
freeze(1);
freeze(¤t_sprite);
choice_start();
"be nice."
"be somewhat less nice."
"leave"
choice_end();
if (&result == 1)
{
say_stop("hi, your looking very old today", 1);
say_stop("`6why thank you.", ¤t_sprite);
say_stop("...", 1);
say_stop("`6hmmm...", ¤t_sprite);
say_stop("i'll go now.", 1);
unfreeze(1);
unfreeze(¤t_sprite);
}
if (&result == 2)
{
say_stop("I HATE YOU!", 1);
say_stop("`6fair enough...", ¤t_sprite);
wait(700);
say_stop("hmmm.. i wasnt expecting that...", 1);
say_stop("i know!", 1);
wait(500);
hurt(¤t_sprite, 500);
playsound(9, 8000,0,0,0);
say_stop("that'l teach him to talk back to me!", 1);
unfreeze(1);
}
}
thanks.
Weird. Oh well. Make the talk proc look like something like below. Are you sure you weren't talking about choice 3??
void talk (void)
{
freeze(1);
freeze(¤t_sprite);
choice_start()
"be nice."
"be somewhat less nice."
"leave"
choice_end()
if (&result == 1)
{
say_stop("hi, your looking very old today", 1);
say_stop("`6why thank you.", ¤t_sprite);
say_stop("...", 1);
say_stop("`6hmmm...", ¤t_sprite);
say_stop("i'll go now.", 1);
unfreeze(1);
unfreeze(¤t_sprite);
}
if (&result == 2)
{
say_stop("I HATE YOU!", 1);
say_stop("`6fair enough...", ¤t_sprite);
wait(700);
say_stop("hmmm.. i wasnt expecting that...", 1);
say_stop("i know!", 1);
wait(500);
hurt(¤t_sprite, 500);
playsound(9, 8000,0,0,0);
say_stop("that'l teach him to talk back to me!", 1);
unfreeze(1);
}
if (&result == 3)
{
unfreeze(1);
unfreeze(&urrent_sprite);
}
}
void talk (void)
{
freeze(1);
freeze(¤t_sprite);
choice_start()
"be nice."
"be somewhat less nice."
"leave"
choice_end()
if (&result == 1)
{
say_stop("hi, your looking very old today", 1);
say_stop("`6why thank you.", ¤t_sprite);
say_stop("...", 1);
say_stop("`6hmmm...", ¤t_sprite);
say_stop("i'll go now.", 1);
unfreeze(1);
unfreeze(¤t_sprite);
}
if (&result == 2)
{
say_stop("I HATE YOU!", 1);
say_stop("`6fair enough...", ¤t_sprite);
wait(700);
say_stop("hmmm.. i wasnt expecting that...", 1);
say_stop("i know!", 1);
wait(500);
hurt(¤t_sprite, 500);
playsound(9, 8000,0,0,0);
say_stop("that'l teach him to talk back to me!", 1);
unfreeze(1);
}
if (&result == 3)
{
unfreeze(1);
unfreeze(&urrent_sprite);
}
}
nope. still doesent work. and yes, i had'nt even tryed option 3.
Try this:
void main (void)
{
say("`6hello there young man.", ¤t_sprite);
void talk (void)
{
freeze(1);
freeze(¤t_sprite);
choice_start();
"be nice."
"be somewhat less nice."
"leave"
choice_end();
if (&result == 1)
{
say_stop("hi, your looking very old today", 1);
say_stop("`6why thank you.", ¤t_sprite);
say_stop("...", 1);
say_stop("`6hmmm...", ¤t_sprite);
say_stop("i'll go now.", 1);
unfreeze(1);
unfreeze(¤t_sprite);
}
if (&result == 2)
{
say_stop("I HATE YOU!", 1);
say_stop("`6fair enough...", ¤t_sprite);
wait(700);
say_stop("hmmm.. i wasnt expecting that...", 1);
say_stop("i know!", 1);
wait(500);
hurt(¤t_sprite, 500);
playsound(9, 8000,0,0,0);
say_stop("that'l teach him to talk back to me!", 1);
unfreeze(1);
}
}
)
void main (void)
{
say("`6hello there young man.", ¤t_sprite);
void talk (void)
{
freeze(1);
freeze(¤t_sprite);
choice_start();
"be nice."
"be somewhat less nice."
"leave"
choice_end();
if (&result == 1)
{
say_stop("hi, your looking very old today", 1);
say_stop("`6why thank you.", ¤t_sprite);
say_stop("...", 1);
say_stop("`6hmmm...", ¤t_sprite);
say_stop("i'll go now.", 1);
unfreeze(1);
unfreeze(¤t_sprite);
}
if (&result == 2)
{
say_stop("I HATE YOU!", 1);
say_stop("`6fair enough...", ¤t_sprite);
wait(700);
say_stop("hmmm.. i wasnt expecting that...", 1);
say_stop("i know!", 1);
wait(500);
hurt(¤t_sprite, 500);
playsound(9, 8000,0,0,0);
say_stop("that'l teach him to talk back to me!", 1);
unfreeze(1);
}
}
)
No, don't try that. You must 'close' the main( void ) before 'opening' another void.
Other than that, I don't see a reason why your script can go wrong. Maybe the colorcode + the first character after it can give some problems. It's probably not your problem, but try putting a space after the colorcode
Other than that, I don't see a reason why your script can go wrong. Maybe the colorcode + the first character after it can give some problems. It's probably not your problem, but try putting a space after the colorcode
and where does the script freezes? At a line? At the end of the conversation? At the beginning of the choice?
September 19th 2004, 08:57 AM

MiloBones


Two things which oughtn't be relevant:
1. hurt(); on at least one occasion, has caused freeze-type problems for me. But I think it's a stable command, in general.
2. Why play the sound at speed 8000? 22050 AFAIK is the default... although there's no reason I can see for 8000 causing problems.
1. hurt(); on at least one occasion, has caused freeze-type problems for me. But I think it's a stable command, in general.
2. Why play the sound at speed 8000? 22050 AFAIK is the default... although there's no reason I can see for 8000 causing problems.
Oh, wait, I see another thing... You don't need semicolons ";" after the choice_start() and the choice_end()
That ain't really a problem, they're just useless. And my way fixes that anyway. And he says that the script freezes when you choose option 2, therefore commands such as hurt(); and the playsound command (and 8000 is right, 22050 is too fast for that sound) are irrelevant.
The script modified by me is 100% correct. The problem is somewhere else.
EDIT: spacehoggy, try writing something else than "be somehat less nice." on the second command. It shouldn't help, but try anyway.
The script modified by me is 100% correct. The problem is somewhere else.
EDIT: spacehoggy, try writing something else than "be somehat less nice." on the second command. It shouldn't help, but try anyway.
the playsound command is somthing i never used before, and dont understand. i just randomly put in the 2nd number, i used to think it had something to do with how long the sound lasted. anyway, the man dies, the sound is played, and he says the thing. its as if somethings wrong with the unfreeze command, but i dont know what.
So the man dies and the script is attached to him? Sheesh.... You said it crashes when you choose option 2.
Do script_attach(1000); before hurting him and kill_this_task(); after you unfreeze Dink.
EDIT: Like this:
script_attach(1000);
wait(500);
hurt(¤t_sprite, 500);
playsound(9, 8000,0,0,0);
say_stop("that'l teach him to talk back to me!", 1);
unfreeze(1);
kill_this_task();
Do script_attach(1000); before hurting him and kill_this_task(); after you unfreeze Dink.
EDIT: Like this:
script_attach(1000);
wait(500);
hurt(¤t_sprite, 500);
playsound(9, 8000,0,0,0);
say_stop("that'l teach him to talk back to me!", 1);
unfreeze(1);
kill_this_task();
ok, theres an improvment to how it works,it doesent freeze, but it doesent hurt him.
EDIT: might as well put this in;
if (&result == 2)
{
say_stop("I HATE YOU!", 1);
say_stop("`6fair enough...", ¤t_sprite);
wait(700);
say_stop("hmmm.. i wasnt expecting that...", 1);
say_stop("i know!", 1);
wait(500);
script_attach(1000);
wait(500);
hurt(¤t_sprite, 500);
playsound(9, 8000,0,0,0);
say_stop("that'l teach him to talk back to me!", 1);
unfreeze(1);
kill_this_task();
}
EDIT: might as well put this in;
if (&result == 2)
{
say_stop("I HATE YOU!", 1);
say_stop("`6fair enough...", ¤t_sprite);
wait(700);
say_stop("hmmm.. i wasnt expecting that...", 1);
say_stop("i know!", 1);
wait(500);
script_attach(1000);
wait(500);
hurt(¤t_sprite, 500);
playsound(9, 8000,0,0,0);
say_stop("that'l teach him to talk back to me!", 1);
unfreeze(1);
kill_this_task();
}
September 19th 2004, 01:56 PM

MiloBones


Would the script_attach change ¤t_sprite to 1000?
mm, try putting script_attach(1000); right after hurt(¤t_sprite, 500);
The simplest way that should fix all though, is to do the following:
if (&result == 2)
{
say_stop("I HATE YOU!", 1);
say_stop("`6fair enough...", ¤t_sprite);
wait(700);
say_stop("hmmm.. i wasnt expecting that...", 1);
say_stop("i know!", 1);
wait(500);
playsound(9, 8000,0,0,0);
hurt(¤t_sprite, 500);
unfreeze(1);
say_stop("that'l teach him to talk back to me!", 1);
}
If it doesn't matter you that much that Dink unfreezes before saying the last sentence, that is.
The simplest way that should fix all though, is to do the following:
if (&result == 2)
{
say_stop("I HATE YOU!", 1);
say_stop("`6fair enough...", ¤t_sprite);
wait(700);
say_stop("hmmm.. i wasnt expecting that...", 1);
say_stop("i know!", 1);
wait(500);
playsound(9, 8000,0,0,0);
hurt(¤t_sprite, 500);
unfreeze(1);
say_stop("that'l teach him to talk back to me!", 1);
}
If it doesn't matter you that much that Dink unfreezes before saying the last sentence, that is.