Old FF Style Spells
#1
Old FF Style Spells
by Jaberwocky
May 29 2007

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given.


This is a script that lets you have a number of spell levels, with a certain number of times that you can cast spells from that level, as well as a limit on how many spells of that level you can learn. It also lets you have skills that consume SP like normal, too.

DBS Version

RTAB Version




The two constants at the top:
SKILLTHINGYELEMENT = 20
SKILLTHINGYMAX = 3

SKILLTHINGYELEMENT is the element ID that you have to mark skills that will be using this system with. On these skills, you need to set the SP cost of the skill to the level of the skill.

SKILLTHINGYMAX is the maximum number of spells you can learn from each level.

A little further down, you'll find:
@spellsmax = [4, 3, 3, 2, 2, 1, 1, 0, 0, 0]

This is the number of spell levels, and the starting number of spells per level.
You can add as many levels as you want, just add numbers to the array.

You can increase the maximum for any actor by using:
$game_actors[actor id].spellsmax[spell level] = amount

Lastly, to reset the number of times you can cast spells to their maximum levels, use $game_party.resetspellsleft

It should work with most other battle systems, as long as the make_skill_effect thing isnt changed, even then, it's not hard to make it work correctly s:

Edit - To add the increase when level up thing, just follow these steps:
Step 1:
Add 'SPELLINCLEVELS = []' up at the top, right beneath 'SKILLTHINGYMAX ='

Step 2:
(Have fun with this one XD)
To set the spellmax for levels, the method is
SPELLINCLEVELS[actor id] = {
level => [lvl0 spells, lvl1 spells, lvl2 spells, lvl3 spells, lvl4 spells, lvl5 spells, lvl6 spells, lvl7 spells, lvl8 spells, lvl9 spells],
level => [lvl0 spells, lvl1 spells, lvl2 spells, lvl3 spells, lvl4 spells, lvl5 spells, lvl6 spells, lvl7 spells, lvl8 spells, lvl9 spells],
etc...
}
This way if the spells max remains the same for a few levels, you don't have to copy the same thing in for all those levels.
If you have a different number of spell levels than 0-9, keep going until you've done them all. If you don't fill out the array with the same number of values as the @spellsmax/@spellsleft/@spellslevels arrays, then it won't work right and will crash s:

Step 3:
Insert this method:
Code:
alias thingamajigger level=
  def level=(level)
    thingamajigger(level)
    for i in 1..level
      unless SPELLINCLEVELS[self.id] == nil
        @spellsmax = SPELLINCLEVELS[self.id][level] unless SPELLINCLEVELS[self.id][level] == nil
      end
    end
    for j in 0...@spellsleft.size
      if @spellsleft[j] > @spellsmax[j]
        @spellsleft[j] = @spellsmax[j]
      end
    end
  end

right below the forget_skill method.

And that should do it o_ob (at least, it's working for me >.>;;)


Another Edit -

Made this window for the menu to show the spells left

Still uses the old system in battle, I have no idea how to fit anything more in there unless I make it hide the battlers at the bottom and show this window over it x| It should also be able to fit up to maybe around 15-16 spell levels if you change the spacing s:

Spell Window


Also, if your 'resetspellsleft' method doesnt look like this:

Code:
def resetspellsleft
    for actor in $game_party.actors
      for i in 0...actor.spellsleft.size
        actor.spellsleft[i] = actor.spellsmax[i]
      end
    end
  end

You need to replace it with that to fix a silly error that links the spellsleft and spellsmax arrays x|
[Image: rkv4oh.png]
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Zelda Style Save winter-chaos 0 2,685 03-21-2009, 01:00 PM
Last Post: winter-chaos



Users browsing this thread: 1 Guest(s)