Levelup
For my Hells Gate D mod I am trying to modify the level up script so it has other things to do.
So I modify the level up script so it has sub menus, but when one of the sub menus are selected the menu quits.
Is this unavoidable or is it a scripting error?
The sub menus I want are save, warp home, and finish leveling up (choose two stats).
Also the only menu I want the level up to quit from is the finish leveling up one.
P.S. How long does it take a file to be uploaded?
So I modify the level up script so it has sub menus, but when one of the sub menus are selected the menu quits.
Is this unavoidable or is it a scripting error?
The sub menus I want are save, warp home, and finish leveling up (choose two stats).
Also the only menu I want the level up to quit from is the finish leveling up one.
P.S. How long does it take a file to be uploaded?
faulty scripting-try re-doing the menus
So I modify the level up script so it has sub menus, but when one of the sub menus are selected the menu quits.
Is this unavoidable or is it a scripting error?
It would really help if you posted your edited script.
P.S. How long does it take a file to be uploaded?
It depends on your modem, the file's size, and the staff members' laziness.
Is this unavoidable or is it a scripting error?
It would really help if you posted your edited script.
P.S. How long does it take a file to be uploaded?
It depends on your modem, the file's size, and the staff members' laziness.
i had a similiar problem with a shop script, so shut up! my shop script is way more complex than your level-up!
how the hell would you know?
´cause it's a shop-script, which is much much MUCH easier than level-up script.
Hahahaha, not true. The menu parts of a multi-layered level-up menu (save, warp home, choose stats), or a multi-layered shop menu (buy, sell leave) are just as easy. As long as you properly add return;, a multi-layered menu is just as easy as a single layer of menu. As far as I know, the most common mistakes happen because &result gets overwritten:
void talk( void )
{
//In these examples, I'm cheap. There's no title, nothing fancy, just menu code.
choice_start();
"Choice 1"
"Choice 2"
choice_end();
if (&result == 1)
{
choice_start();
"Submenu 1, choice 1"
"Submenu 1, choice 2"
choice_end();
if (&result == 1)
{
//Do something
//Accidentally forget return; It goes unnoticed, as nothing weird happens.
}
if (&result == 2)
{
//Do something else
//Accidentally forget return; Since &result equals 2, the submenu 2 code will be executed, and you'll ask on the board wtd is going wrong.
}
}
if (&result == 2)
{
choice_start();
"Submenu 2, choice 1"
"Submenu 2, choice 2"
choice_end();
if (&result == 1)
{
//Do stuff
}
if (&result == 2)
{
//Do other stuff
}
}
}
Note that not only choice menus affect the value of &result. The wait_for_button() function also uses it. So, if you use wait_for_button() inside menu code, strange things may happen as well.
EDIT: I was typoing all over the place
void talk( void )
{
//In these examples, I'm cheap. There's no title, nothing fancy, just menu code.
choice_start();
"Choice 1"
"Choice 2"
choice_end();
if (&result == 1)
{
choice_start();
"Submenu 1, choice 1"
"Submenu 1, choice 2"
choice_end();
if (&result == 1)
{
//Do something
//Accidentally forget return; It goes unnoticed, as nothing weird happens.
}
if (&result == 2)
{
//Do something else
//Accidentally forget return; Since &result equals 2, the submenu 2 code will be executed, and you'll ask on the board wtd is going wrong.
}
}
if (&result == 2)
{
choice_start();
"Submenu 2, choice 1"
"Submenu 2, choice 2"
choice_end();
if (&result == 1)
{
//Do stuff
}
if (&result == 2)
{
//Do other stuff
}
}
}
Note that not only choice menus affect the value of &result. The wait_for_button() function also uses it. So, if you use wait_for_button() inside menu code, strange things may happen as well.
EDIT: I was typoing all over the place
I think you may be overestimating these people, it might just as well be missing braces or complete ignorance of how choice menus work in the first place.
I think someone needs to have his temper checked.
i'm actually an experienced dinkC scripter. (kind of). it's not like i look through the dinkC manual every 10 minutes when i'm scripting, i can work things out on my own. i think the problem with my shop script was the
return;
line: instead i just went
unfreeze(1);
unfreeze(¤t_sprite);
kill_this_task();
}
which didn't work very well so i made it goto done:
if (&result == option to leave, in my scripts it is usually 4th or 5th)
{
goto done:
}
done:
unfreeze(1);
unfreeze(¤t_sprite);
kill_this_task();
}
and just in case your wondering why has he got freeze(¤t_sprite); in a shop script? it's because the "shop" is actually a walking person
return;
line: instead i just went
unfreeze(1);
unfreeze(¤t_sprite);
kill_this_task();
}
which didn't work very well so i made it goto done:
if (&result == option to leave, in my scripts it is usually 4th or 5th)
{
goto done:
}
done:
unfreeze(1);
unfreeze(¤t_sprite);
kill_this_task();
}
and just in case your wondering why has he got freeze(¤t_sprite); in a shop script? it's because the "shop" is actually a walking person
You know if you use kill_this_task(); with an npc you wont be able to talk to them again until you re-enter the screen because you just killed their script..
i wondered why i couldn't talk to him...

















