Experience and Level Up stuff
In my D-Mod, I'm aiming for a different kind of status-bar and menu system. So I was wondering if it is at all possible to check how much experience you need to proceed to next level without looking at the number on the status bar. I want to get rid of the numbers on the status bar and just let a script tell you how much exp you need for next level. Any ideas?
The formula (hard coded, not changeable):
&level = level Dink is currently on
The total experience needed to advance a level is.
&total_exp_needed = &level * &level * 100;
Substracting the amount of experience from that is what you still need.
&exp_needed = &level * &level * 100 - &exp;
So for example, if you are level 2 and have 134 exp already, the status bar will show this: 134/400
&total_exp_needed will be 400
&exp_needed will be 266, the amount you'll need before another levelraise occurs.
&level = level Dink is currently on
The total experience needed to advance a level is.
&total_exp_needed = &level * &level * 100;
Substracting the amount of experience from that is what you still need.
&exp_needed = &level * &level * 100 - &exp;
So for example, if you are level 2 and have 134 exp already, the status bar will show this: 134/400
&total_exp_needed will be 400
&exp_needed will be 266, the amount you'll need before another levelraise occurs.
Is it possible to change the ammount of experience needed to gain a level?
So you have to change the source code then. That sucks. It should be done with a script.
Well, I have a solution to this, but that's a bit complicated. Let's say you want 100 exp for level 1, 200 exp for level 2, 300 exp for level 3, you should use the following seq, in every die procedure, at every monster script:
if(&exp >= &levexp)
{
&level += 1;
&exp -= &levexp;
external("lraise", "main");
}
also, in the lraise script, you should enter
&levexp = &level;
&levexp *= 100;
This works only if &levexp is lower than it should be. If it's higher, the lraise script should be emty:
void main(void)
{
kill_this_task();
}
and you should replace "lraise" with some other name.
You also need to find a way to remove the exp box from the status bar(maybe redink1 can tell us how he did in reconstruction).
I don't know if this will work, but you can try it.
if(&exp >= &levexp)
{
&level += 1;
&exp -= &levexp;
external("lraise", "main");
}
also, in the lraise script, you should enter
&levexp = &level;
&levexp *= 100;
This works only if &levexp is lower than it should be. If it's higher, the lraise script should be emty:
void main(void)
{
kill_this_task();
}
and you should replace "lraise" with some other name.
You also need to find a way to remove the exp box from the status bar(maybe redink1 can tell us how he did in reconstruction).
I don't know if this will work, but you can try it.
No statusbar? Just load blank frames (of the correct size, I guess) into the sequences used by the game.
If you don't know how to add new graphics, read some tutorials, found in the Development section.
You will need the original Dink Smallwood bmp pack (also in the Development section) to see what files are used for the statusbar, and where they are located in the graphics directory.
Rebuild that part of the graphics directory in your D-Mod's directory. For example, if the status bar is located in graphics/statusbar/stat-01.bmp, you should make a file called stat-01.bmp in your D-Mod's graphics/statusbar/ directory. I'm quite sure this isn't the actual place the graphic is in, but it's easy to find out if you have the original bmp pack.
This new stat-01.bmp (still the example) should have the exact image size (pixels) as the original one, but leave it white. The game will think this new white thing is the statusbar and display it. No dink.ini editing required!
You will need the original Dink Smallwood bmp pack (also in the Development section) to see what files are used for the statusbar, and where they are located in the graphics directory.
Rebuild that part of the graphics directory in your D-Mod's directory. For example, if the status bar is located in graphics/statusbar/stat-01.bmp, you should make a file called stat-01.bmp in your D-Mod's graphics/statusbar/ directory. I'm quite sure this isn't the actual place the graphic is in, but it's easy to find out if you have the original bmp pack.
This new stat-01.bmp (still the example) should have the exact image size (pixels) as the original one, but leave it white. The game will think this new white thing is the statusbar and display it. No dink.ini editing required!
I said I'm not sure what you mean, not I don't know how to do it. I know full very well how to add graphics.
I still don't know what you're suggesting I do.
I still don't know what you're suggesting I do.
He's suggesting that if you really want absolutely no status bar, you replace the status bar graphic with a big transparent frame so the status bar in-game is pretty much nothing.
But then you have the problem of the Dink screen surrounded (especially on the bottom) by nothingness.
But then you have the problem of the Dink screen surrounded (especially on the bottom) by nothingness.
Because you said that your DMOD might not have a statusbar. And magicman provides you with an easy way to do that.
I thought there would be an easier way to do it, such as altering a script.
Nope, statusbar things are all hardcoded. The way you gain experience, the way you levelup, the way strenght and defense are handled in combat, the way the statusbar is built (you can't change the magic pic to suddenly become the active weapon. At least, not easily).
Or, well, suddenly I remember something. Often the statusbar doesn't display during cutscenes, but only at the beginning of the game. You might check what command is used after the little talk scene in the main game to let the status bar appear, and remove it from your script. I'm still not sure how this affects savegames, though. I don't believe I've ever seen the statusbar disappear when it was previously there.
Or, well, suddenly I remember something. Often the statusbar doesn't display during cutscenes, but only at the beginning of the game. You might check what command is used after the little talk scene in the main game to let the status bar appear, and remove it from your script. I'm still not sure how this affects savegames, though. I don't believe I've ever seen the statusbar disappear when it was previously there.
You could remove the &update_status = 0, but the status bar'll just re-appear when the game is loaded.
This might work (dunno, haven't tried it).
&update_status = 0;
fill_screen(0); // or fill_screen 255, I forget
draw_background();
This might work (dunno, haven't tried it).
&update_status = 0;
fill_screen(0); // or fill_screen 255, I forget
draw_background();
It'll go away... If I remember right there was a disappearing status bar in LOT.
But blank frames are the easiest way to make it go away for good, or then I'm an uninformed little rabbit. :'(
But blank frames are the easiest way to make it go away for good, or then I'm an uninformed little rabbit. :'(
How do you make just one stat(let's say experience) dissapear from the status bar?
Only load blank frames for that one stat
Search what sequences are used for the experience numbers and replace them by blank graphics.
Search what sequences are used for the experience numbers and replace them by blank graphics.
Well actually I figured out a work around, but I'm not going to use it because I don't like it.