Jump to content


Photo

Learn and Replace


  • Please log in to reply
7 replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 26 January 2013 - 02:48 PM

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, 29 February 2016 - 06:20 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#2 Napkiins

Napkiins

    Newbie

  • Ace Member
  • 3 posts
  • RM Skill - Designer

Posted 26 January 2013 - 04:58 PM

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.



#3 Fated

Fated

    Advanced Member

  • Ace Member
  • 115 posts

Posted 26 January 2013 - 05:32 PM

I was hoping a script like this would be made. Thanks.



#4 estriole

estriole

    Advanced Member

  • Ace Member
  • 1999 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 27 January 2013 - 12:59 AM

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)



#5 AzgarthX

AzgarthX

    Advanced Member

  • Ace Member
  • 31 posts

Posted 28 January 2013 - 10:08 AM

thanks for the script



#6 HellKiteChaoS

HellKiteChaoS

    Sometimes sidekicks are the true hero.

  • Ace Member
  • 176 posts
  • RM Skill - Jack of All Trades

Posted 30 January 2013 - 09:43 AM

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


Interested in seeing my work live? Have any questions about development? Below are links that can help you keep up with the project.

My Live stream:  http://www.twitch.tv/hellkitechaos

My Twitter:  @HellKiteChaoS

 

What I support ^.^

 

RDn36N8.png

 


#7 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 30 January 2013 - 10:06 AM

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

Spoiler

Edited by Tsukihime, 30 January 2013 - 07:35 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#8 HellKiteChaoS

HellKiteChaoS

    Sometimes sidekicks are the true hero.

  • Ace Member
  • 176 posts
  • RM Skill - Jack of All Trades

Posted 01 February 2013 - 07:40 AM

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
Spoiler

 

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


Interested in seeing my work live? Have any questions about development? Below are links that can help you keep up with the project.

My Live stream:  http://www.twitch.tv/hellkitechaos

My Twitter:  @HellKiteChaoS

 

What I support ^.^

 

RDn36N8.png

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users