The Dink Network

Levelup

October 15th 2007, 02:09 AM
knights.gif
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?
October 15th 2007, 03:35 AM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
faulty scripting-try re-doing the menus
October 15th 2007, 04:11 AM
knights.gif
Have you created an alternate level up system?
October 15th 2007, 04:52 AM
duckdie.gif
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.
October 15th 2007, 05:34 AM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
i had a similiar problem with a shop script, so shut up! my shop script is way more complex than your level-up!
October 16th 2007, 12:18 AM
custom_skull.gif
skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Actually, it isn't.
October 16th 2007, 12:47 AM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
how the hell would you know?
October 16th 2007, 05:26 AM
custom_skull.gif
skull
Peasant He/Him Finland bloop
A Disembodied Sod 
´cause it's a shop-script, which is much much MUCH easier than level-up script.
October 16th 2007, 06:47 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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
October 16th 2007, 07:17 AM
spike.gif
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.
October 16th 2007, 07:41 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
I think someone needs to have his temper checked.
October 16th 2007, 05:20 PM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
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(&current_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(&current_sprite);
kill_this_task();
}

and just in case your wondering why has he got freeze(&current_sprite); in a shop script? it's because the "shop" is actually a walking person
October 16th 2007, 06:32 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
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..
October 17th 2007, 02:16 AM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
i wondered why i couldn't talk to him...
October 17th 2007, 03:56 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
goto done; rather than goto done: ?
October 17th 2007, 08:23 AM
custom_skull.gif
skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Actual master scripter.