The Dink Network

Broken Script

February 26th 2006, 03:39 PM
dragon.gif
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.
February 26th 2006, 03:52 PM
knightg.gif
cypry
Peasant He/Him Romania
Chop your own wood, and it will warm you twice. 
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).
February 26th 2006, 06:03 PM
dragon.gif
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.
February 26th 2006, 06:14 PM
dragon.gif
It still doesn't work.
February 26th 2006, 06:20 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
No semicolons after choice_start() and choice_end()... not sure about title_start() and title_end()
February 26th 2006, 06:24 PM
dragon.gif
Ok, I'll try that now. Thankyou.
February 26th 2006, 06:43 PM
dragon.gif
Arg! It still doesn't work!
February 26th 2006, 06:50 PM
dragon.gif
I found a problem with it myself. Where it says:

&attack == x

It should say:

&strength == x

However it still doesn't work.
February 26th 2006, 07:36 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
When setting &atfeat, use a single '='

Ditto with &intro.

== is a boolean operator, = is an assignment.
February 26th 2006, 07:40 PM
dragon.gif
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.
February 26th 2006, 07:45 PM
dragon.gif
Nah, still no luck.
February 26th 2006, 07:52 PM
dragon.gif
Looks like I may just have to give up on having feats in my dmod.
February 26th 2006, 07:56 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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.
February 26th 2006, 08:18 PM
dragon.gif
There is supposed to be a choice menu, but it doesn't come up.
February 26th 2006, 08:21 PM
dragon.gif
If I try what you said to do the say_stop("Hello!",1); exucutes, but not the rest.
February 26th 2006, 08:28 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
How are you running this script? Is it attached to a sprite?
February 26th 2006, 08:54 PM
dragon.gif
It's run by a script thats run by a script that's run by a script that's run by the intro script.
February 26th 2006, 08:57 PM
dragon.gif
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.
February 27th 2006, 02:02 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Those were perhaps the same ones that were missing the ending bracket altogether?
March 1st 2006, 01:11 AM
dragon.gif
Yes, they were.