PDA

View Full Version : Leveling System



bigjoe
04-06-2007, 06:27 PM
This is more of an idea than a request but if anyone is willing to do it, that would be great. It is this.

There is a new counter for experience which is modified whenever your protagonist kills an enemy. When the counter reaches certain (varying) numbers, your stats (Life/Magic) are increased by an amount which can be customized. The number, of course, gets bigger at higher levels.

Some questions:

Can different enemies be made to give you different amounts of experience?

Could little numbers (perhaps FFCs) appear and show the amount of exp received when you kill an enemy?

EDIT: I'm going to start putting together a script, which will appear in a code bracket at the bottom of this post. anyone is free to edit/suggest things and reply.

The comment near the bottom shows what I currently need help with.




// Leveling System
// This is a system that will modify
// Link's Life and Magic based on his level.

import "std.zh"

// The amount of heart containers awarded at each level.

const int HCL1_EARNED = 1;
const int HCL2_EARNED = 1;
const int HCL3_EARNED = 1;
const int HCL4_EARNED = 1;
const int HCL5_EARNED = 1;
const int HCL6_EARNED = 1;
const int HCL7_EARNED = 1;
const int HCL8_EARNED = 1;
const int HCL9_EARNED = 1;
const int HCL10_EARNED = 1;

// The amount of magic containers awarded at each level.

const int MCL1_EARNED = 0;
const int MCL2_EARNED = 1;
const int MCL3_EARNED = 0;
const int MCL4_EARNED = 1;
const int MCL5_EARNED = 0;
const int MCL6_EARNED = 1;
const int MCL7_EARNED = 0;
const int MCL8_EARNED = 1;
const int MCL9_EARNED = 0;
const int MCL10_EARNED = 1;

// The amount of experience needed to advance each level.

const int EXPL1 = 10;
const int EXPL2 = 50;
const int EXPL3 = 250;
const int EXPL4 = 1250;
const int EXPL5 = 2500;
const int EXPL6 = 3000;
const int EXPL7 = 4000;
const int EXPL8 = 8000;
const int EXPL9 = 16000;
const int EXPL10 = 32000;

// What I'm trying to do below is make the FFC jump to
// Where the enemy is when it dies. If anyone can correct
// It would help.

FFC script ffc_experience_1
{
void run ()
{
npc enemy_1 = Screen->CreateNPC(1);
ffc ffcexp_1 = Screen->LoadFFC(1);

if(enemy_1->HP == 0){
ffcexp_1->X = enemy1->X;
ffcexp_1->Y = enemy1->Y;
}
}
}


Also, some experience graphics ripped from a subscreen I put together.

http://i113.photobucket.com/albums/n212/BigJoe_013/experience.png

beefster09
04-06-2007, 11:05 PM
I think it's possible unless there's no way to figure out which enemy has been killed. In other words, I don't know how to do it.

ShadowMancer
05-07-2007, 05:33 PM
If you can use the enemy's ID number
(i am not sure how yet, mabye something like)
if (enemy->ID = 57)
{
exp += 10
}
that would be alot of if statements (is there a select..case or something similar in zscript?)
I am just learning zscript myself and I was thinking of writeing an experience system for a new quest. If I come up with anything solid I will post it

C-Dawg
05-08-2007, 12:08 PM
Why not just make a new drop item that acts as experience? Sort of like Castlevania 2. Link collects exp items (stars? those power pieces from Four Swords?) and when he gets enough, his maximum health increases. Maybe at certain levels his armor improves (using like twenty custom armor items each providing a one-fourth heart's increase) and reduction in magic use.

The_Amaster
05-10-2007, 07:50 PM
Interesting. In addition to the power and defense granted by Rings and Swords, I wonder if somehow you could modify the variables directly through this. Thus you gradually increase as you level up.

ShadowMancer
05-10-2007, 09:31 PM
Ah yes, the 'experince item' was one one thing i was thinking of. I also figured out (in theroy) how to do an experience system although it would require alot of scripting, and you would have to create each enemy in each room with a script. Basically what i was thinking was to write a few similar scripts with different varibles (different random enemies to appear in each room, depending on the teriain) each enemy would have a exp_value varible assined to him. I think this would work fine for the overworld, but i would think you would want more control of what enemies you place in a dungon, i was considering make a script that would give you exp for each room in a dungon you pass, kind of a 'puzzle solveing bonus' of course this has its own problems, you would only want to give the exp bouns once per room, but the enmies would come back each time you visit (unles you set the rule otherwise) nedless to say it is not totaly workable at theis point, mabye if we get varible arrays and can assign local varible to specific 'objects' (enemies) it would be totaly possible...