Project1

标题: VA超级整合中的职业解锁系统怎么用啊 [打印本页]

作者: 300英雄    时间: 2015-8-15 10:25
标题: VA超级整合中的职业解锁系统怎么用啊
求助各位帮我下怎么使用这个脚本多谢了
作者: 300英雄    时间: 2015-8-15 14:12
为什么没人啊

作者: 300英雄    时间: 2015-8-15 14:40
  1. #
  2. # ▼ Yanfly Engine Ace - Class System Add-On: Class Unlock Level v1.00
  3. # -- Last Updated: 2011.12.20
  4. # -- Level: Normal
  5. # -- Requires: YEA - Class System v1.01+
  6. #
  7. #==============================================================================

  8. $imported = {} if $imported.nil?
  9. $imported["YEA-ClassUnlockLevel"] = true

  10. #==============================================================================
  11. # ▼ Updates
  12. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  13. # 2011.12.20 - Started Script and Finished.
  14. #
  15. #==============================================================================
  16. # ▼ Introduction
  17. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  18. # This script allows for classes to be unlocked after a class reaches a certain
  19. # level. Note that this script is made for the Class System script and not
  20. # using the MAINTAIN_LEVELS feature. Requirements for unlocking a class can be
  21. # multiple level requirements as well.
  22. #
  23. #==============================================================================
  24. # ▼ Instructions
  25. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  26. # To install this script, open up your script editor and copy/paste this script
  27. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  28. #
  29. # -----------------------------------------------------------------------------
  30. # Class Notetags - These notetags go in the class notebox in the database.
  31. # -----------------------------------------------------------------------------
  32. # <level unlock requirements>
  33. #   class x: level y
  34. #   class x: level y
  35. # </level unlock requirements>
  36. # Sets the requirements for unlocking that particular class. The unlocking of
  37. # the class will require classes x to be at level y. Insert multiple of the
  38. # strings in between the two opening and closing notetags to require all of the
  39. # class levels to be met.
  40. #
  41. #==============================================================================
  42. # ▼ Compatibility
  43. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  44. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  45. # it will run with RPG Maker VX without adjusting.
  46. #
  47. # This script requires Yanfly Engine Ace - Class System v1.01+.
  48. #
  49. #==============================================================================
  50. # ▼ Editting anything past this point may potentially result in causing
  51. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  52. # halitosis so edit at your own risk.
  53. #==============================================================================

  54. if $imported["YEA-ClassSystem"] && !YEA::CLASS_SYSTEM::MAINTAIN_LEVELS

  55. module YEA
  56.   module REGEXP
  57.   module CLASS
  58.    
  59.     LV_UNLOCK_ON =
  60.       /<(?:LEVEL_UNLOCK_REQUIREMENTS|level unlock requirements)>/i
  61.     LV_UNLOCK_OFF =
  62.       /<\/(?:LEVEL_UNLOCK_REQUIREMENTS|level unlock requirements)>/i
  63.     LV_UNLOCK_STR = /CLASS[ ](\d+): LEVEL[ ](\d+)/i
  64.    
  65.   end # CLASS
  66.   end # REGEXP
  67. end # YEA

  68. #==============================================================================
  69. # ■ DataManager
  70. #==============================================================================

  71. module DataManager
  72.   
  73.   #--------------------------------------------------------------------------
  74.   # alias method: load_database
  75.   #--------------------------------------------------------------------------
  76.   class <<self; alias load_database_cul load_database; end
  77.   def self.load_database
  78.     load_database_cul
  79.     load_notetags_cul
  80.   end
  81.   
  82.   #--------------------------------------------------------------------------
  83.   # new method: load_notetags_cul
  84.   #--------------------------------------------------------------------------
  85.   def self.load_notetags_cul
  86.     for obj in $data_classes
  87.       next if obj.nil?
  88.       obj.load_notetags_cul
  89.     end
  90.   end
  91.   
  92. end # DataManager

  93. #==============================================================================
  94. # ■ RPG::Class
  95. #==============================================================================

  96. class RPG::Class < RPG::BaseItem
  97.   
  98.   #--------------------------------------------------------------------------
  99.   # public instance variables
  100.   #--------------------------------------------------------------------------
  101.   attr_accessor :level_unlock
  102.   
  103.   #--------------------------------------------------------------------------
  104.   # common cache: load_notetags_cul
  105.   #--------------------------------------------------------------------------
  106.   def load_notetags_cul
  107.     @level_unlock = {}
  108.     @level_unlock_on = false
  109.     #---
  110.     self.note.split(/[\r\n]+/).each { |line|
  111.       case line
  112.       #---
  113.       when YEA::REGEXP::CLASS::LV_UNLOCK_ON
  114.         @level_unlock_on = true
  115.       when YEA::REGEXP::CLASS::LV_UNLOCK_OFF
  116.         @level_unlock_on = false
  117.       when YEA::REGEXP::CLASS::LV_UNLOCK_STR
  118.         next unless @level_unlock_on
  119.         @level_unlock[$1.to_i] = $2.to_i
  120.       end
  121.     } # self.note.split
  122.     #---
  123.   end
  124.   
  125. end # RPG::Class

  126. #==============================================================================
  127. # ■ Game_Actor
  128. #==============================================================================

  129. class Game_Actor < Game_Battler
  130.   
  131.   #--------------------------------------------------------------------------
  132.   # check_level_unlocked_classes
  133.   #--------------------------------------------------------------------------
  134.   def check_level_unlocked_classes
  135.     for item in $data_classes
  136.       next if item.nil?
  137.       next if unlocked_classes.include?(item.id)
  138.       next if item.level_unlock == {}
  139.       next unless class_unlock_level_requirements_met?(item)
  140.       unlock_class(item.id)
  141.     end
  142.   end
  143.   
  144.   #--------------------------------------------------------------------------
  145.   # class_unlock_level_requirements_met?
  146.   #--------------------------------------------------------------------------
  147.   def class_unlock_level_requirements_met?(item)
  148.     for key in item.level_unlock
  149.       class_id = key[0]
  150.       level_req = key[1]
  151.       return false if class_level(class_id) < level_req
  152.     end
  153.     return true
  154.   end
  155.   
  156. end # Game_Actor

  157. #==============================================================================
  158. # ■ Window_ClassList
  159. #==============================================================================

  160. class Window_ClassList < Window_Selectable
  161.   
  162.   #--------------------------------------------------------------------------
  163.   # alias method: actor=
  164.   #--------------------------------------------------------------------------
  165.   alias window_classlist_actor_equals_cul actor=
  166.   def actor=(actor)
  167.     return if @actor == actor
  168.     actor.check_level_unlocked_classes
  169.     window_classlist_actor_equals_cul(actor)
  170.   end
  171.   
  172. end # Window_ClassList

  173. end # $imported["YEA-ClassSystem"] && !YEA::CLASS_SYSTEM::MAINTAIN_LEVELS

  174. #==============================================================================
  175. #
  176. # ▼ End of File
  177. #
  178. #==============================================================================
复制代码

作者: 300英雄    时间: 2015-8-15 14:40
这是代码,救助怎么使用
作者: 3106345123    时间: 2015-8-16 10:24
本帖最后由 3106345123 于 2015-8-16 10:28 编辑

脚本没贴全
This script requires Yanfly Engine Ace - Class System v1.01+.

有注释不看
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
# <level unlock requirements>
#   class x: level y
#   class x: level y
# </level unlock requirements>
# Sets the requirements for unlocking that particular class. The unlocking of
# the class will require classes x to be at level y. Insert multiple of the
# strings in between the two opening and closing notetags to require all of the
# class levels to be met.
#


大概是在职业备注里加上
RUBY 代码复制
  1. <level unlock requirements>
  2.   class x: level y
  3.   class x: level y
  4. </level unlock requirements>

这样
作者: 300英雄    时间: 2015-8-16 11:51
我试过了,没有用的,我试过没用才放出来问问你们,麻烦大家再看看怎么用
作者: 御之嵐    时间: 2015-8-18 02:23
本帖最后由 御之嵐 于 2015-8-18 02:28 编辑
  1. # -----------------------------------------------------------------------------
  2. # Class Notetags - These notetags go in the class notebox in the database.
  3. # -----------------------------------------------------------------------------
  4. # <level unlock requirements>
  5. #   class x: level y
  6. #   class x: level y
  7. # </level unlock requirements>
  8. # Sets the requirements for unlocking that particular class. The unlocking of
  9. # the class will require classes x to be at level y. Insert multiple of the
  10. # strings in between the two opening and closing notetags to require all of the
  11. # class levels to be met.
复制代码
放在職業的備註裡面
RUBY 代码复制
  1. <level unlock requirements>
  2.    class x: level y
  3.    class x: level y
  4. </level unlock requirements>


假設你當前角色的職業是 class1
當 class1
達到 level 2的時候
開啟 class2

就在class2的備註這樣寫
  1. <level unlock requirements>
  2.   class 1: level 2
  3. </level unlock requirements>
复制代码
要兩種職業都到達才解鎖的話就用兩個
  1.   class x: level y
复制代码
我測試之後是有效果的噢

我原本角色主職業 是鬥士
主職業更換成  戰士  等級就變成了 LV1
但是原本的等級還會保留



前提是要有
  1. YEA - Class System
复制代码
這個本體腳本
作者: 300英雄    时间: 2015-9-27 11:39
恩谢谢啊完全解决了




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1