Script problem
I don't know what's wrong with this script. When I speak to this lady the game freezes:
//script for xanthara, the owner of the medical lab
void main();
{
int &ransay = random(3,1);
if (&ransay == 1)
{
say("`4Good day to you sir!",¤t_sprite);
}
if (ransay == 2)
{
say("`4Intreted in biology, are you?",¤t_sprite);
}
if (ransay == 3)
{
say("`4Come in my dear sir!",¤t_sprite);
}
}
//talk procdure
void talk();
{
//freeze 'em
freeze(1);
freeze(¤t_sprite);
//blablabla
choice_start()
set_y 240
title_start();
Welcome, my dear sir into this lab.
title_end();
(&slayer == 2)"Here's the corpse of the slayer"
(&dragon == 2)""Here's the corpse of the dragon"
"What is this place?"
"Do you need help"
"What corpses are these?"
"Goodbye"
choice_end();
//if &dragon and &slayer are 2
if (&result == 1)
{
say_stop("`4Thank you adventurer, I am very grateful.",¤t_sprite);
//side quest bonus
&gold +=100
&magic +=1
//still not have or given the dragon's corpse
if (&dragon == 1)
{
say_stop("`4Return when you have the dragon's corpse as well.",¤t_sprite);
}
}
//dragon
if (&result == 2)
{
say_stop("`4Than you, I needed this specimen",¤t_sprite);
&gold +=100
&magic +=1
//not given the slayer's corpse
if (&slayer == 1)
{
say_stop("`4Return when you have the slayers corpse as well.",¤t_sprite);
}
//choice 1
if (&result == 1)
{
say_stop("`4Well, I must say your knowledge is very poor.",¤t_sprite);
say_stop("`4Anyone could tell this is a biology lab.",¤t_sprite);
say_stop("`4I study the anatomy of the corpses kept here.",¤t_sprite);
say_stop("I knew it from the beginning, I was just joking.",1);
}
//choice 2
if (&result == 4)
{
if (&dragon == 0)
{
say_stop("`4Well, if you are interested I have a job for you.",¤t_sprite);
say_stop("I will be delighted to do it for you.",1);
say_stop("`4Well then as you can see this my lab.",¤t_sprite);
say_stop("`4But I need a dragon and a slayer's corpse to finish my research",¤t_sprite);
say_stop("But where can I find a slayer and a dragon.",¤t_sprite);
say_stop("`4There is a cave west of the village",¤t_sprite);
say_stop("`4from where you can bring exactly the specimens I want.",¤t_sprite);
say_stop("Very well then, I will return with the specimens as soon as I can.",1);
&slayer = 1;
&dragon = 1;
}
if (&dragon == 1)
{
say_stop("`4You should start looking for the specimens, adventurer",¤t_sprite);
}
}
if (&result == 5)
{
say_stop("`4Two are of pillbugs, one of a adult lady",¤t_sprite);
say_stop("`4and one of an old goblin.",¤t_sprite);
}
if (&result == 6)
{
unfreeze(1);
unfreeze(¤t_sprite);
}
unfreeze(1);
unfreeze(¤t_sprite);
}
//script for xanthara, the owner of the medical lab
void main();
{
int &ransay = random(3,1);
if (&ransay == 1)
{
say("`4Good day to you sir!",¤t_sprite);
}
if (ransay == 2)
{
say("`4Intreted in biology, are you?",¤t_sprite);
}
if (ransay == 3)
{
say("`4Come in my dear sir!",¤t_sprite);
}
}
//talk procdure
void talk();
{
//freeze 'em
freeze(1);
freeze(¤t_sprite);
//blablabla
choice_start()
set_y 240
title_start();
Welcome, my dear sir into this lab.
title_end();
(&slayer == 2)"Here's the corpse of the slayer"
(&dragon == 2)""Here's the corpse of the dragon"
"What is this place?"
"Do you need help"
"What corpses are these?"
"Goodbye"
choice_end();
//if &dragon and &slayer are 2
if (&result == 1)
{
say_stop("`4Thank you adventurer, I am very grateful.",¤t_sprite);
//side quest bonus
&gold +=100
&magic +=1
//still not have or given the dragon's corpse
if (&dragon == 1)
{
say_stop("`4Return when you have the dragon's corpse as well.",¤t_sprite);
}
}
//dragon
if (&result == 2)
{
say_stop("`4Than you, I needed this specimen",¤t_sprite);
&gold +=100
&magic +=1
//not given the slayer's corpse
if (&slayer == 1)
{
say_stop("`4Return when you have the slayers corpse as well.",¤t_sprite);
}
//choice 1
if (&result == 1)
{
say_stop("`4Well, I must say your knowledge is very poor.",¤t_sprite);
say_stop("`4Anyone could tell this is a biology lab.",¤t_sprite);
say_stop("`4I study the anatomy of the corpses kept here.",¤t_sprite);
say_stop("I knew it from the beginning, I was just joking.",1);
}
//choice 2
if (&result == 4)
{
if (&dragon == 0)
{
say_stop("`4Well, if you are interested I have a job for you.",¤t_sprite);
say_stop("I will be delighted to do it for you.",1);
say_stop("`4Well then as you can see this my lab.",¤t_sprite);
say_stop("`4But I need a dragon and a slayer's corpse to finish my research",¤t_sprite);
say_stop("But where can I find a slayer and a dragon.",¤t_sprite);
say_stop("`4There is a cave west of the village",¤t_sprite);
say_stop("`4from where you can bring exactly the specimens I want.",¤t_sprite);
say_stop("Very well then, I will return with the specimens as soon as I can.",1);
&slayer = 1;
&dragon = 1;
}
if (&dragon == 1)
{
say_stop("`4You should start looking for the specimens, adventurer",¤t_sprite);
}
}
if (&result == 5)
{
say_stop("`4Two are of pillbugs, one of a adult lady",¤t_sprite);
say_stop("`4and one of an old goblin.",¤t_sprite);
}
if (&result == 6)
{
unfreeze(1);
unfreeze(¤t_sprite);
}
unfreeze(1);
unfreeze(¤t_sprite);
}
Looking at the script hastily, the ;'s at the end of void main() and void talk() or the ; at the end of choice_end() might make it freeze.
On top of that:
(&dragon == 2)""Here's the corpse of the dragon"
Double quotage. Bad.
if (&slayer == 1)
{
say_stop("`4Return when you have the slayers corpse as well.",¤t_sprite);
}
This if is unclosed. Might not make it crash, but it's a bug nonetheless.
EDIT: Hum, of course, this if itself is closed, but not the choice-if (that checks &result) it was nested in.
//choice 1
if (&result == 1)
Should be '==3'. Also won't make it crash.
I'm relieved that there are so few bracket errors (only one!). Usually people screw those up big time.
(&dragon == 2)""Here's the corpse of the dragon"
Double quotage. Bad.
if (&slayer == 1)
{
say_stop("`4Return when you have the slayers corpse as well.",¤t_sprite);
}
This if is unclosed. Might not make it crash, but it's a bug nonetheless.
EDIT: Hum, of course, this if itself is closed, but not the choice-if (that checks &result) it was nested in.
//choice 1
if (&result == 1)
Should be '==3'. Also won't make it crash.
I'm relieved that there are so few bracket errors (only one!). Usually people screw those up big time.