Broken Script
The following script won't work and I can't figure out why. There are also other scripts based on this one that won't work. Can someone please help me out here.
void main()
{
featloop:
choice_start();
title_start();
Please choose a feat.
title_end();
"Attack Skill"
"Attack Speciality"
"Attack Mastery"
"Cancel"
choice_end();
if (&result == 1)
{
if (&atfeat > 0)
{
say_stop_xy("You already have this feat."
goto featloop;
}
else
{
&atfeat == 1;
&attack += 1;
kill_this_task();
}
}
if (&result == 2)
{
if (&atfeat > 1)
{
say_stop_xy("You already have this feat."
goto featloop;
}
if (&atfeat == 1)
{
if (level == 5)
{
&atfeat == 2;
&attack += 1;
kill_this_task();
}
else
{
say_stop_xy("You don't meet the requirements for this feat.", 10, 40);
goto featloop;
}
}
else
{
say_stop_xy("You don't meet the requirements for this feat.", 10, 40);
goto featloop;
}
}
if (&result == 3)
{
if (&atfeat == 3)
{
say_stop_xy("You already have this feat."
goto featloop;
}
if (&atfeat == 2)
{
if (level == 10)
{
&intro == 0;
&atfeat == 2;
&attack += 1;
kill_this_task();
}
else
{
say_stop_xy("You don't meet the requirements for this feat.", 10, 40);
goto featloop;
}
}
else
{
say_stop_xy("You don't meet the requirements for this feat.", 10, 40);
goto featloop;
}
}
else
{
spawn("stfeats2");
kill_this_task();
}
}
Oh, and all of the global variables are declared in the Main.c file and the Begin script does exist.
void main()
{
featloop:
choice_start();
title_start();
Please choose a feat.
title_end();
"Attack Skill"
"Attack Speciality"
"Attack Mastery"
"Cancel"
choice_end();
if (&result == 1)
{
if (&atfeat > 0)
{
say_stop_xy("You already have this feat."
goto featloop;
}
else
{
&atfeat == 1;
&attack += 1;
kill_this_task();
}
}
if (&result == 2)
{
if (&atfeat > 1)
{
say_stop_xy("You already have this feat."
goto featloop;
}
if (&atfeat == 1)
{
if (level == 5)
{
&atfeat == 2;
&attack += 1;
kill_this_task();
}
else
{
say_stop_xy("You don't meet the requirements for this feat.", 10, 40);
goto featloop;
}
}
else
{
say_stop_xy("You don't meet the requirements for this feat.", 10, 40);
goto featloop;
}
}
if (&result == 3)
{
if (&atfeat == 3)
{
say_stop_xy("You already have this feat."
goto featloop;
}
if (&atfeat == 2)
{
if (level == 10)
{
&intro == 0;
&atfeat == 2;
&attack += 1;
kill_this_task();
}
else
{
say_stop_xy("You don't meet the requirements for this feat.", 10, 40);
goto featloop;
}
}
else
{
say_stop_xy("You don't meet the requirements for this feat.", 10, 40);
goto featloop;
}
}
else
{
spawn("stfeats2");
kill_this_task();
}
}
Oh, and all of the global variables are declared in the Main.c file and the Begin script does exist.
You didn't closed some brakets:
say_stop_xy("You already have this feat."
You should close the bracket and put ; after this line(in several places).
say_stop_xy("You already have this feat."
You should close the bracket and put ; after this line(in several places).
Opps. I thought I had. Thanks. I'll try that with each script and see if they work.
Oh and sorry it's such a pig post.
Oh and sorry it's such a pig post.
No semicolons after choice_start() and choice_end()... not sure about title_start() and title_end()
I found a problem with it myself. Where it says:
&attack == x
It should say:
&strength == x
However it still doesn't work.
&attack == x
It should say:
&strength == x
However it still doesn't work.
When setting &atfeat, use a single '='
Ditto with &intro.
== is a boolean operator, = is an assignment.
Ditto with &intro.
== is a boolean operator, = is an assignment.
Okay. Maybe it'll work this time. I hope so anyway.
That &intro was supposed to of been deleted though. I'll get around to doing that now as well.
That &intro was supposed to of been deleted though. I'll get around to doing that now as well.
Looks like I may just have to give up on having feats in my dmod.
Can you describe what it does do? For example, does it show the choice menu? If not, you might want to remove the semicolons after title_start() and title_end()
If even that doesn't work, put a say_stop("Hello!",1); as the first line of the main() proc. See if it executes at all.
If even that doesn't work, put a say_stop("Hello!",1); as the first line of the main() proc. See if it executes at all.
There is supposed to be a choice menu, but it doesn't come up.
If I try what you said to do the say_stop("Hello!",1); exucutes, but not the rest.
How are you running this script? Is it attached to a sprite?
It's run by a script thats run by a script that's run by a script that's run by the intro script.
I found another problem and now it finally works now that I've fixed it. I simply add ,10, 40 after the closing speech marks in a few of the say_stop_xy lines.
Those were perhaps the same ones that were missing the ending bracket altogether?