Esper + Junction system (as requested) v0.7

Esper + Junction System
Version: 0.7

Introduction

This script is a mix of the FFVI Esper system + FFVIII Junction System.
It was requested by Ama55. I've never played Final Fantasy VI or VIII, everything in this script is how Ama55 told me to do.
But for those that, like me, never played FFVI nor FFVIII, the script goes like this:

You own espers trough the game.
Each actor can equip one esper.
The espers give stats and skills, and they increase as the esper level up.
The espers can be removed like any equip, but, if you remove it, you loose the skills and the bonus (duh!).

Also, this is my first plubic script ever. Hope you guys like it.
Features

  • Add and customize how much espers you want
  • Espers level up by the use of its "main skill"
  • 1 to 5 levels per esper
Screenshots

Screenshot 1 Show
http://www.lobosque.dact.com.br/screenshot1.PNG[/IMG]
Screenshot 2 Show
http://lobosque.isgreat.org/screenshot2.PNG[/IMG]


Demo

Download the script/demo here

Instructions

Actually you have to put it above main.
You must set up the "Esper + Junction system constants" tab.
There you can change the maximum ammount of espers, to use pictures or not, and the espers in itself


To add an esper to the party inventory, you should use:
   $game_party.gain_esper(ESPER::NAME)
Expand to see the code.

in an event script.
and in "Esper + Junction system constants":
NAME = (Game_Esper.new(1,"Bomb",[10,20,30,40,50],[7,8,9,10,11,12],
[6,10,12,13,15],[3,4,6,8,9],[1,3,4,6,6],[10,13,14,16],[10,9,5,3,1],[0,0,0,0,0],[7,8,8,9,9]))
Expand to see the code.

Detailed explanation Show
[color=red]id[/color] = Id of the esper, put 1 to the first, 2 to the second, there you go...
1

[color=red]name[/color] = The name of the esper.
"Ifrit"

[color=red]exp_table[/color] = How much times the actor must use the skill to level up, between brackets (if your esper just go to lvl3, you must put 0 to lvl4 and lvl5, the counter is cumulative)
[30,60,120,240] [color=blue]---->[/color] [lvl2,lvl3,lvl4,lvl5]

[color=red]skill[/color] = The ID of the skill that the esper will learn in each level. 0 if none
[7,8,9,10,11] [color=blue]---->[/color] [skill that comes within, lvl2 skill, lvl3 skill,lvl4 skill, lvl5skill]

[color=red]str[/color] = the strenght for each level. 0 if none
[1,2,3,4,5] [color=blue]---->[/color] [lvl1 str, lvl2 str, lvl3 str, lvl4str, lvl5str]

[color=red]dex[/color] = the dextery for each level. 0 if none
[1,2,3,4,5] [color=blue]---->[/color] [lvl1 dex, lvl2 dex, lvl3 dex, lvl4dex, lvl5dex]

[color=red]agi[/color] = the agility for each level. 0 if none
[1,2,3,4,5] [color=blue]---->[/color] [lvl1 agi, lvl2 agi, lvl3 agi, lvl4agi, lvl5agi]

[color=red]int[/color] = the inteligence for each level. 0 if none
[1,2,3,4,5] [color=blue]---->[/color] [lvl1 int, lvl2 int, lvl3 int, lvl4int, lvl5int]

[color=red]atk[/color] = the attack power for each level. 0 if none
[1,2,3,4,5] [color=blue]---->[/color] [lvl1 atk, lvl2 atk, lvl3 atk, lvl4atk, lvl5atk]

[color=red]pdef[/color] = the physic defense for each level. 0 if none
[1,2,3,4,5] [color=blue]---->[/color] [lvl1 pdef, lvl2 pdef, lvl3 pdef, lvl4pdef, lvl5pdef]

[color=red]mdef[/color] = the magic defense for each level. 0 if none
[1,2,3,4,5] [color=blue]---->[/color] [lvl1 mdef, lvl2 mdef, lvl3 mdef, lvl4mdef, lvl5mdef]
Expand to see the code.


Don't forget to put the image and your esper with the same name if you wish to use them

FAQ

Nothing for now

Compatibility

The script aliases itself in a lot of methods and rewrite one or two too... So it can be compatible with anything, if you edit, of course. If you need my help, just post here and maybe i'll be avaible.

Changelog

Version 0.7 Show
Version 0.7

Bugfixes
  • More code cleanup and optimization
  • Skills now get correctly removed with the esper.
  • Esper removal corrected and improved (thanks darkloner).
  • Wrong status addition fixed (intelligence to be exact).
  • Another bug with esper removal, the sound this time.
  • Esper name display now dont get streched.
New Features
  • You can customize the text that appear when you do not have an esper (default = "????").
  • Esper's skills appear in a different color (customizable, default = yellow) in the skill windows (in menu and in battle).
  • Now the "esper remove" command text is customizable in the constants setup.
  • Help window added.
  • Completly reworked windows (looks better now in my opinion).

Version 0.6 Show
Version 0.6

Bugfixes
  • Fixed the crash when you loose/run a battle.
  • Fixed a bug with negative status.
  • Some code optimization suggested by Trickster.
New Features
  • New way to add espers, this will put a end in the editing bug.
  • Now you can choose to use pictures or not.
  • Red display for negative status.

Credits and Thanks
SephirothSpawn for his materia system, that helped me to understand some things :).

Author's Notes

The espers in the demo, including their graphics, skills and stats, is just to show how's the system in action. They were not planned or anything like that (they even have the same skills).
Please, post any bug/suggestion/comentary/anything that you find/think.
Looks very cool ;) .

Would we be able to make the picture of the esper animate?
Thanks.
Actually the picture just stand still hehe. Animate them like charsets is not a good idea, in my opinion. Mainly for their size.
Could you edit the script so you can have more then one esper equiped on you and they share exp among them(If you battle a ghost and he gave you 50 exp you get 50 and the espers if you have three they get 50/3 you know what i mean?)
I'm planning a second esper slot for the next version. About the exp thingy, they level up as you use its first spell.
can we use this script with RTAB?
Yes, but the part that mess with the battle system must be rewrited, since RTAB completly modify the battle system.
First off, THANK YOU SOOO MUCH!
Second, could you hypothetically add more levels by adding more brackets?
Third, What if you don't want a spell on level 2, what do you put inside the bracket to make it skip that.
Can you place the script here cause i cant download it!!!!O_o
[QUOTE=ama55;119740]First off, THANK YOU SOOO MUCH!
Second, could you hypothetically add more levels by adding more brackets?
Third, What if you don't want a spell on level 2, what do you put inside the bracket to make it skip that.[/QUOTE]

1st - Hehe you're welcome :)
2nd - No, you cant do that, the maximum level is 5, or the things will start to bug arround, but you can try it if you want :P
3rd - if you dont want a spell in a certain level, just put 0 in the corresponding level of the skill brackets.


[QUOTE=ArcanaMagek;119745]Can you place the script here cause i cant download it!!!!O_o[/QUOTE]

I'll upload it elsewhere.

--edit--
Ok, uploaded as an attachment,
It's not too bad, but I'll have to create a terrain flag for battle. I'll let you know what I come across. It would be nice to have some extra help. Maybe in my new game when it comes along.

Are you able to use these espers in battle, or do they just add extra abilites to the characters?

Cheers
I just got an error. What exactly does this mean?

"Script 'esper + junction' line 456: NoMethodError occured. undefined method `disposed' for Nil:Class"

This happened after I was defeated in battle. I DID have espers equipped. This did NOT happened if I did NOT have any espers equipped.
Oh thanks for reporting that bug dude. Anyway i have just fixed it and i'll re-upload the demo in a few hours, I'm a little busy now.
Ok, I have a problem, I get a syntax error when I try to add an esper. Here is the code I use

$game_party.gain_esper(Game_Esper.new
(1,"Ifrit",[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]))

Does this have to do with the picture I'm using?
Its because your sintax is wrong =]
You cant break the line there... Use this instead:
$game_party.gain_esper(Game_Esper.new(1,"Ifrit",[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]))
Expand to see the code.
I copied your code and put it in and the same problem happened :(
Dont use it in main. use it in map events.
Ok, I somehow fixed it. I just copied the event from your second demo you sent. Sorry!
Alright, I know I'm being a pain but this is pissing me off. When I use your demo version (the one you gave me) the code (inside the event) looks really long with no spaces. But when I type it in (WITH NOT SPACES!!!!) and click ok (when I'm done typing it into the call script) it looks like it has spaces!!
When I copied and pasted the event (from the demo) into my game, it worked fine, but the minute I clicked "edit" and went back out (without typing or touching anything) the code doesn't work!!! What am I doing wrong when I type it in!!!
Very fricken sweet.
ama55;120222 wrote:
Alright, I know I'm being a pain but this is pissing me off. When I use your demo version (the one you gave me) the code (inside the event) looks really long with no spaces. But when I type it in (WITH NOT SPACES!!!!) and click ok (when I'm done typing it into the call script) it looks like it has spaces!!
When I copied and pasted the event (from the demo) into my game, it worked fine, but the minute I clicked "edit" and went back out (without typing or touching anything) the code doesn't work!!! What am I doing wrong when I type it in!!!

Me too.
It seems RMXP automatically spaces it. That sucks.
Hey lobo, I found an error. It seems if you either lose a battle, (not a game over) or try to escape battles (I had these happen WITHOUT any espers) then the game bugs out.

I think someone already posted on this, I'm just checking on the progress.

Quote:
Me too.
It seems RMXP automatically spaces it. That sucks.


Yeah, I'm trying to find some solutions around it. I wonder if there is any way to connect the line with codes? Like, a character that connects lines and tells the code "hey man, I'm connected to that right there!" :(
Well, there is a solution to the autoformat that RMXP does. Credit goes to Krade (from neoseeker) because he figured this out. Here you go.

Insert a new page inside your script editor and enter this code.
def gain_mu
   $game_party.gain_esper(Game_Esper.new(1,"mu",[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]))
end
Expand to see the code.


Then use this as a call script.
gain_mu
Expand to see the code.
Yay! Now I can equip my people with GFs/Espers!
This does NOT correct the error that occurs when you lose a battle or try to escape though. Hopefully that will be corrected soon. :)
I hope so too.
Way to steal Seph's Thunder Lobosque :p But Really good work filling a script request

Indepth Code Analysis


Coding
  • Your Indentation is a bit off.
  • Would be nice to see method headers and commenting
  • You have code that could be aliased to increase compatibility the base_(stat) methods
    Example Show
        def base_str
        n = $data_actors[@actor_id].parameters[2, @level]
        weapon = $data_weapons[@weapon_id]
        armor1 = $data_armors[@armor1_id]
        armor2 = $data_armors[@armor2_id]
        armor3 = $data_armors[@armor3_id]
        armor4 = $data_armors[@armor4_id]
        esper1 = 0
        esper1 = @esper1.str if @esper1 != 0
        n += weapon != nil ? weapon.str_plus : 0
        n += armor1 != nil ? armor1.str_plus : 0
        n += armor2 != nil ? armor2.str_plus : 0
        n += armor3 != nil ? armor3.str_plus : 0
        n += armor4 != nil ? armor4.str_plus : 0
        n += esper1
        return [[n, 1].max, 999].min
      end
     
    Expand to see the code.
    When Aliasing could be turned into this
      alias esper_base_str base_str
      def base_str
        n = esper_base_str
        n += @esper1.str if @esper1 != 0
        return [[n, 1].max, 999].min
      end
     
    Expand to see the code.
  • What's with the extra_(stat) methods why not just check for nil since that's all it is doing
  • method skills could have been aliased as well
  • instance_of?, well is_a? does just about the same thing and with fewer characters :P (Not really a big deal, but just to mention this to you)
  • Don't modify the methods of Window Base Directly. Your Modifications to method draw_actor_name is okay since you only added a default parameter at the end, but do know that this can destroy compatibility, You should instead move your method into the Window Class that you are using it for.
  •     self.contents.font.name = $fontface
    #    self.contents.font.size = $fontsize
    Expand to see the code.
    This section of code needs to be cut off since It will cause errors in the legal version
  •   def refresh(esper = @esper)
        esper = @esper
    Expand to see the code.
  • Well Instead of having the user of this script creating the Espers themselves, why not have a place in the script where the user can define them themselves instead of trying to fit the code in a call script. (I prefer a Module with constants, but there are other ways to go about this)
Well that's All I could find at this point, there maybe be more stuff If I find it I will edit this post, you already have me on MSN so message me if you have any problems or want to explain the stuff I found.

Overall Nice Job, there are a few things off, but they can be easily fixed.
I already fixed a some of them, but with all this silly christmas thing is hard to work in the script, but as soon as I can i'll post the new version with the bugs corrected. Ok?

Thanks for the analysis Trickster and thanks to everyone who pointed a bug.
Oh, and thanks for everyone who enjoied the script :).
i enjoyed the script alot... nice set up... only if it was compatible with my game...
Ok, the new version is out. with 3 bugfixed and 3 new little things. A nice christmas gift i think. I hope that everyone enjoy.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=11111