• Announcements

    • RagingHobo

      Forum Upgraded!   07/17/2017

      We have successfully upgraded our forum to the latest version! Some things have moved around but don't worry everything is still there, we still need to find updated versions of the plugins we were using previously to restore everything to the way it was. There will be a running topic in the Feedback and Support in case you notice something wrong. Before you do so please clear your browser cache and close your browser completely to rule out a caching issue. Thank you for your patience during the outage and while we get everything back to 150%  
Sign in to follow this  
Followers 0
Tsukihime

Learn and Replace

8 posts in this topic

Learn and Replace

-Tsukihime

 

This script allows you to have a newly learned skill "replace" an old

skill. For example, if you have Fire 1, Fire 2, and Fire 3, and you want

to simulate skill mastery where higher levels of the skill replace lower

levels, then learning Fire 2 may replace Fire 1.

 

Download

 

Script: Download here

 

Usage

 

Note-tag Learning objects with

 

 

 
<replace: ID1 ID2 ID3 ... >
Where the ID's are the ID's of skills that will be forgotten upon learning the new skill.

 

learnReplace1.JPG

 

Compatibility

 

As reported by HellKiteChaoS, there is an issue with yanfly's Victory Aftermath where new skills aren't shown if they replace one existing skill.

 

This is a bug in the victory script that does not do an accurate check on whether the actor learned anything new or not (instead it checks skill count, which happens to be the same if you replace an old skill)

 

Place the following script below the Victory script (or make the appropriate changes):

 

class Window_VictorySkills < Window_Selectable
  def refresh(actor, temp_actor)
    contents.clear

    # fixed. We are checking whether we learned any new skills
    # so we should be checking for any differences
    new_skills = actor.skills - temp_actor.skills
    if new_skills.empty?
      unselect
      @data = []
      create_contents
      return
    end
    @data = actor.skills - temp_actor.skills
    if @data.size > 8
      select(0)
      activate
    else
      unselect
      deactivate
    end
    create_contents
    draw_all_items
  end
end
Edited by Tsukihime

Share this post


Link to post
Share on other sites

Couldn't figure it out at first, I thought "Note-tag Learning objects with" meant in the Skills tab of the database.

You tag the skill whilst in the Classes tab.

 

I have to say, this is pretty nice.

Share this post


Link to post
Share on other sites

nice script. the second scripter who use 'rarely used note'. and also use it perfectly for it's purpose (first one is formar in his trait lv up)

Share this post


Link to post
Share on other sites

Hey Tsukihime,

 

I hate bringing up script adjustment requests, but I just really enjoy this script and would hate to have to remove other scripts. I'm really glad you took the time to make this script, this is one I've been hunting for a long time. I've even attempted doing something like this with events and it was a nightmare. 

 

 

My question is: I use Yanfly's Victory Aftermath script. (Here) With your script, when the character levels up, if there is a spell being replaced, it does not display that new spell. 

 

Example:

Mage has Fire I learned. Mage levels up, and learns Fire II. Fire II will replace Fire I. In the aftermath screen, it does not display that the mage learned Fire II, it just simply has the new spell in the spell list.

 

What can I do to have it display the new spell being learned or is it simply a script compatibility issue?

 

Thanks,

ChaoS

Share this post


Link to post
Share on other sites

Paste this under the victory aftermath script. All I did was change how the check was done to more accurately reflect what it is actually checking.

class Window_VictorySkills < Window_Selectable
  def refresh(actor, temp_actor)
    contents.clear

    # fixed. We are checking whether we learned any new skills
    # so we should be checking for any differences
    new_skills = actor.skills - temp_actor.skills
    if new_skills.empty?
      unselect
      @data = []
      create_contents
      return
    end
    @data = actor.skills - temp_actor.skills
    if @data.size > 8
      select(0)
      activate
    else
      unselect
      deactivate
    end
    create_contents
    draw_all_items
  end
end

 

I have not tested the scripts, but from looking at the aftermath script, I imagine this is the problem

 

Window_VictorySkills#refresh

if actor.skills.size == temp_actor.skills.size
  unselect
  @data = []
  create_contents
  return
end

If you are replacing one skill, then the number of skills doesn't change, and therefore the script assumes there weren't any changes.

 

I would say this is a bug in yanfly's script since you're supposed to check whether there are new skills, not checking whether the count has changed.

 

I'll re-write the above function and release it as a patch and put it somewhere.

 

 

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Paste this under the victory aftermath script. All I did was change how the check was done to more accurately reflect what it is actually checking.

class Window_VictorySkills < Window_Selectable
  def refresh(actor, temp_actor)
    contents.clear

    # fixed. We are checking whether we learned any new skills
    # so we should be checking for any differences
    new_skills = actor.skills - temp_actor.skills
    if new_skills.empty?
      unselect
      @data = []
      create_contents
      return
    end
    @data = actor.skills - temp_actor.skills
    if @data.size > 8
      select(0)
      activate
    else
      unselect
      deactivate
    end
    create_contents
    draw_all_items
  end
end

I have not tested the scripts, but from looking at the aftermath script, I imagine this is the problem

 

Window_VictorySkills#refresh

if actor.skills.size == temp_actor.skills.size
  unselect
  @data = []
  create_contents
  return
end
If you are replacing one skill, then the number of skills doesn't change, and therefore the script assumes there weren't any changes.

 

I would say this is a bug in yanfly's script since you're supposed to check whether there are new skills, not checking whether the count has changed.

 

I'll re-write the above function and release it as a patch and put it somewhere.

 

 

Works perfectly. Thanks again for taking the time to make this update.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.