Im not the hottest with scripts but I was wondering if it is possible to script up a system similar to ff6 magic learning through espers?
For example, could you make an item in your equipment gain experience through battles, seperate for each character and upon reaching an X amount teach the player a spell/ability.
As a feature? Awesome...
...
--------------------------------------------------
Warning: Unorganized Thoughts Ahead
--------------------------------------------------
But for now... You want espers (or your game's equivalent) as an item, right? I'm making this assumption.
How I'd approach this... and it's probably the most cumbersome way...
First I'd have all battles in the game summoned by one script or another. You can actually have an instead of battle script that happens when a random battle would otherwise occur, then have that script summon the battle.
You'll end up with a line:
If (fight formation (random formation (***)))
Where *** is the formation set you're using (if you're using formation sets). Now I'm also assuming that loosing a random battle is a game over in your game... but that doesn't have to be the case.
That line makes you fight a random battle (replace random formation with the exact formation if you want a specific one), and after the battle will return "true" if the player wins the fight, or false if the player runs (or loses) the fight.
So add a "Then" and make it check which item is in the equipment slot for your esper, then increment a global variable. After this have it check the global variable to see if it's high enough, and if it is have it teach the character the spell (you'll have to have the spell set to "learn from item" in the hero editor). Then continue the process for each character.
Now here's where my method gets cumbersome: You'll need a global variable for each spell for each character. Note that this won't necessarily be too much more time consuming than building the attacks... testing it could be annoying since I'm not sure exactly how you'd have a player check their progress of learning the spell...
Maybe you could have a menu option that displays strings written from the values of the variables specific to the "esper" equipped and the character equipping it... and now that assumes you're learning a specific number of spells from each "esper".
If you have four heros and 24 spells, then you'll end up with 96 variables using this method... unless you do something creative, like having each of eight espers teach three spells a piece, one at a time, then you only have (4 * 8) 32 global variables, such as Mjölner teaching Thunder, Sonic Boom, then Mega Hammer!
...
Also when teaching the spells you'd want to check both the variable and make sure your character didn't already have the spell, so that you could have it summon a message telling the player that they had learned the spell.
...
hm...
This also is only giving a set amount for battles in general. Unless that amount was actually an argument that could be manipulated before summoning this whole mess that's actually a script separate from the battle summoning script!
...
And that lady and gentlemen, is how my thought processes... for about three minutes.
...
--------------------------------------------------
Warning: Unorganized Thoughts Ahead
--------------------------------------------------
But for now... You want espers (or your game's equivalent) as an item, right? I'm making this assumption.
How I'd approach this... and it's probably the most cumbersome way...
First I'd have all battles in the game summoned by one script or another. You can actually have an instead of battle script that happens when a random battle would otherwise occur, then have that script summon the battle.
You'll end up with a line:
If (fight formation (random formation (***)))
Where *** is the formation set you're using (if you're using formation sets). Now I'm also assuming that loosing a random battle is a game over in your game... but that doesn't have to be the case.
That line makes you fight a random battle (replace random formation with the exact formation if you want a specific one), and after the battle will return "true" if the player wins the fight, or false if the player runs (or loses) the fight.
So add a "Then" and make it check which item is in the equipment slot for your esper, then increment a global variable. After this have it check the global variable to see if it's high enough, and if it is have it teach the character the spell (you'll have to have the spell set to "learn from item" in the hero editor). Then continue the process for each character.
Now here's where my method gets cumbersome: You'll need a global variable for each spell for each character. Note that this won't necessarily be too much more time consuming than building the attacks... testing it could be annoying since I'm not sure exactly how you'd have a player check their progress of learning the spell...
Maybe you could have a menu option that displays strings written from the values of the variables specific to the "esper" equipped and the character equipping it... and now that assumes you're learning a specific number of spells from each "esper".
If you have four heros and 24 spells, then you'll end up with 96 variables using this method... unless you do something creative, like having each of eight espers teach three spells a piece, one at a time, then you only have (4 * 8) 32 global variables, such as Mjölner teaching Thunder, Sonic Boom, then Mega Hammer!
...
Also when teaching the spells you'd want to check both the variable and make sure your character didn't already have the spell, so that you could have it summon a message telling the player that they had learned the spell.
...
hm...
This also is only giving a set amount for battles in general. Unless that amount was actually an argument that could be manipulated before summoning this whole mess that's actually a script separate from the battle summoning script!
...
And that lady and gentlemen, is how my thought processes... for about three minutes.
Well, not necessarily espers I used them because its a pretty easy reference that most if not all would understand.
Say my relic slot item or something would have this. Lets call AP the experience pts for the "Relic"
Lets say Relic A,
100 AP - Learn Spell A
450 AP - Learn Spell B
1200 AP - Learn Spell C
All of that in itself of course would be a script. With enough variables and work would be calculated seperately for each hero.
After winning a battle you would get X amount of AP. My worry here is how hard would it be to display the amount of AP you get. Would I only be able to do this after the battle is complete with a text box that appears after a fight? Also how complicated it would be for giving a different AP value per fight. Because I would prefer not to give 1 AP for every fight and so people can just farm the level 1 monster over and over and abuse the flaw.
Another small concern but I am pretty sure it can be done as detailed as I want it to be is to be able to view all of your items that teach spells and their AP per character along with what can be learned from them.
I havent used the scripts in like 8 years but I vaguely remember most of the functions and that is why I am asking here if it's ultimately possible to do it in a clean way and not something that looks yucky or too confusing to the player. Wordup.
Say my relic slot item or something would have this. Lets call AP the experience pts for the "Relic"
Lets say Relic A,
100 AP - Learn Spell A
450 AP - Learn Spell B
1200 AP - Learn Spell C
All of that in itself of course would be a script. With enough variables and work would be calculated seperately for each hero.
After winning a battle you would get X amount of AP. My worry here is how hard would it be to display the amount of AP you get. Would I only be able to do this after the battle is complete with a text box that appears after a fight? Also how complicated it would be for giving a different AP value per fight. Because I would prefer not to give 1 AP for every fight and so people can just farm the level 1 monster over and over and abuse the flaw.
Another small concern but I am pretty sure it can be done as detailed as I want it to be is to be able to view all of your items that teach spells and their AP per character along with what can be learned from them.
I havent used the scripts in like 8 years but I vaguely remember most of the functions and that is why I am asking here if it's ultimately possible to do it in a clean way and not something that looks yucky or too confusing to the player. Wordup.
I've not done enough work with strings to tell you how to have this display, but here's a trick:
Don't display the AP per fight.
Have every creature give the same amount of XP as AP.
Tell the player that XP count towards both level growth and spell learning (if they have a relic equipped).
Don't display the AP per fight.
Have every creature give the same amount of XP as AP.
Tell the player that XP count towards both level growth and spell learning (if they have a relic equipped).



