The Dink Network

Script problem

May 12th 2006, 06:10 AM
pq_skull.gif
dinkme
Peasant He/Him India
 
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!",&current_sprite);
}
if (ransay == 2)
{
say("`4Intreted in biology, are you?",&current_sprite);
}
if (ransay == 3)
{
say("`4Come in my dear sir!",&current_sprite);
}
}

//talk procdure
void talk();
{
//freeze 'em
freeze(1);
freeze(&current_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.",&current_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.",&current_sprite);
}

}

//dragon
if (&result == 2)
{
say_stop("`4Than you, I needed this specimen",&current_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.",&current_sprite);
}

//choice 1
if (&result == 1)
{
say_stop("`4Well, I must say your knowledge is very poor.",&current_sprite);
say_stop("`4Anyone could tell this is a biology lab.",&current_sprite);
say_stop("`4I study the anatomy of the corpses kept here.",&current_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.",&current_sprite);
say_stop("I will be delighted to do it for you.",1);
say_stop("`4Well then as you can see this my lab.",&current_sprite);
say_stop("`4But I need a dragon and a slayer's corpse to finish my research",&current_sprite);
say_stop("But where can I find a slayer and a dragon.",&current_sprite);
say_stop("`4There is a cave west of the village",&current_sprite);
say_stop("`4from where you can bring exactly the specimens I want.",&current_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",&current_sprite);
}
}

if (&result == 5)
{
say_stop("`4Two are of pillbugs, one of a adult lady",&current_sprite);
say_stop("`4and one of an old goblin.",&current_sprite);
}

if (&result == 6)
{

unfreeze(1);
unfreeze(&current_sprite);
}

unfreeze(1);
unfreeze(&current_sprite);
}
May 12th 2006, 06:15 AM
spike.gif
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.
May 12th 2006, 11:59 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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.",&current_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.
May 13th 2006, 01:03 AM
pq_skull.gif
dinkme
Peasant He/Him India
 
I corrected that bracket error and corrected that &result == 1 to &result == 3 and it worked.

Thanks for the help, guys.