查看: 2725|回复: 6

[已经解决] 如何增加人物属性的数量

[复制链接]
梦石
0
星屑
50
在线时间
525 小时
注册时间
2012-2-23
回帖
139
发表于 2013-6-18 13:00:55 来自手机 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 alwsheng 于 2013-6-18 21:44 编辑

如题,能详细的说下怎么添加更好,有看到一些帖子有说,就是没怎么明白,
梦石
0
星屑
278
在线时间
122 小时
注册时间
2010-12-23
回帖
168
发表于 2013-6-18 15:31:58 | 显示全部楼层
本帖最后由 双叶GL 于 2013-6-18 15:34 编辑

善用搜索
http://rpg.blue/forum.php?mod=viewthread&tid=303162
直接添加额外属性
这个应该属于简单易懂,

复制下面的脚本

额外成长,敌人属性,技能加成,都是写在备注即可

而且想要添加其他的,就搜索其中一个属性,然后吧相关内容全部复制,然后修改搜索属性的名字即可



http://rpg.blue/thread-99474-1-1.html
读取某段字符

评分

参与人数 1星屑 +100 收起 理由
Sion + 100 感谢帮忙

查看全部评分

- -作图太麻烦了,又是PS又是素材的
还不如玩游戏实际- -嗯嗯,娱乐就好!!

=====================
神马都简单,但是需要时间&精力,虽然我时间很多,但是专注一样东西的精力- -
====================
回复

使用道具 举报

梦石
0
星屑
385
在线时间
117 小时
注册时间
2012-10-2
回帖
114
发表于 2013-6-18 16:18:33 | 显示全部楼层
2楼好渊博

但是有个小问题············第二个地址指向的VX的脚本···················那个脚本能用在VA上么?求解释
梦想只有到了实现的时候,你才知道她的容貌。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
回帖
103
发表于 2013-6-18 18:57:13 | 显示全部楼层
本帖最后由 tyq4590 于 2013-6-18 23:20 编辑

在外站找到一个脚本应该可以帮到你。效果如下图:



先说一下用法:

在角色的备注里按照以下格式填写对应属性的成长公式:

[pre lang="ruby" line="1"]<xstat>
:str => '(level/3.5) + 16',
:con => '(level/5.6) + 12',
:dex => '(level/5.25) + 15 + agi',
:int => '(level/10.5) + 10',
:wis => '(level/10.5) + 10',
:cha => '(level/10.5) + 10',
<xstat_end>[/pre]

也可以直接在角色或敌人的备注栏里填写固定数值:

[pre lang="ruby" line="1"]<xstat>
:str => 15,
:con => 14,
:dex => 13,
:int => 12,
:wis => 11,
:cha => 0,
<xstat_end>[/pre]

在武器或护甲的备注里按照如下格式填写可以让该装备增加对应属性:

[pre lang="ruby" line="1"]<weapon_xstat: STAT x>[/pre]

范例,让装备增加5点‘str’属性:

[pre lang="ruby" line="1"]<weapon_xstat: str 5>[/pre]

调用属性:

[pre lang="ruby" line="1"]$game_actors[1].xstat.str[/pre]

范例,设置x技能的伤害公式为【人物的‘str’乘以5】:

[pre lang="ruby" line="1"]a.xstat.str * 5[/pre]

----------------------------------------------------------分割线------------------------------------------------------------

脚本:
[pre lang="ruby" line="1"]#===============================================================================
#                                                N.A.S.T.Y. Extra Stats
#                                  Nelderson's Awesome Scripts To You
# By: Nelderson
# Made On: 12/19/2011
# Last Updated : 3/27/2012
#===============================================================================
# Update History:
# - Version 1.1  - Cleaned up some shit, and added enemies xstats for Enemies!
# - Version 1.0  - Initial release, made for the shit of it <img src='http://forums.rpgmakerweb.com/public/style_emoticons/<#EMO_DIR#>/tongue.png' class='bbc_emoticon' alt=':P' />
#===============================================================================
# *Notes:
# - This script can be used to make all sorts of stats that can derive from
#   an actor's level, and base stats.
#
# - This thing can be a pain to set up, but once it's done, it can be a very
#   powerful way to include new stats into your game!
#
# - Made a quick edit to the status screen to show up to 6 stats!
#
# *Usage
#
# -First is the STATS section.  This is an array that holds all the new
#  stats that everything else gets info from.
#
# - Next fill out the Default Level formula(Use Example Below as a guide)
#   *ANYTHING that an actor has, you can base it off of (Except other XSTATS!)
#           (level, hp, mp, atk, spi, agi, maxhp, etc.)
#
# -You can use the ACTOR and ENEMY NOTETAGS to customize
#  the formulas for each actor.
#
#  Examples:
#   Place the following in an actor's notebox(You must make one for each stat):
#                 <xstat>
#                 :str => '(level/3.5) + 16',
#                 :con => '(level/5.6) + 12',
#                 :dex => '(level/5.25) + 15 + agi',
#                 :int => '(level/10.5) + 10',
#                 :wis => '(level/10.5) + 10',
#                 :cha => '(level/10.5) + 10',
#                 <xstat_end>
#
#   Or you can place this in an actor's/enemy's notebox
#                 <xstat>
#                 :str => 15,
#                 :con => 14,
#                 :dex => 13,
#                 :int => 12,
#                 :wis => 11,
#                 :cha => 0,
#                 <xstat_end>
#
# - This script also uses notetags for weapons and armors to increase xstats
#   if you want.  Just place in a notebox:
#
#                 <weapon_xstat: STAT x> , where STAT is th name of the new stat
#
#           Ex. <weapon_xstat: str 5> , would raise the actor's str +5
#
#  *For Scripters
#
#  -If you want to access the stats, just use:
#                actor.xstat.STAT - Where STAT is the name of the new stat
#          
#           Ex. $game_actors[1].xstat.str , will return actor 1's str
#  
#===============================================================================
# Credits:
# -Nelderson and Zetu
#  Original Script was made by Zetu, and I spiced the shit out of it!
#===============================================================================

module Z26

  STATS = [:str,:con,:dex,:int,:wis,:cha]

  #Default xstat formulas for ACTORS
  DEFAULT_LEVEL_FORMULA =
                {
                  :str => '(level/3.5) + 16 + atk',
                  :con => '(level/5.6) + 12',
                  :dex => '(level/5.25) + 15 + agi',
                  :int => '(level/10.5) + 10',
                  :wis => '(level/10.5) + 10',
                  :cha => '(level/10.5) + 10',
                }

  #Default xstat formulas for ENEMIES          
  DEFAULT_FOR_ENEMIES =
                {
                  :str => 0,
                  :con => 0,
                  :dex => 0,
                  :int => 0,
                  :wis => 0,
                  :cha => 0,
                }

   def self.actor_level_formulas(actor_id)
          jhh = ""
          strin = $data_actors[actor_id].get_start_end_cache
          strin.each do |i|
                jhh += i
          end
          return DEFAULT_LEVEL_FORMULA if strin == "" or strin == []
          return eval("{#{jhh}}")
        end

        def self.enemy_stats(enemy_id)
          jhh = ""
          strin = $data_enemies[enemy_id].get_start_end_cache
          strin.each do |i|
                jhh += i
          end
          return DEFAULT_FOR_ENEMIES if strin == "" or strin == []
          return eval("{#{jhh}}")
        end

  #=============================================================================
  SYMBOLS = []
  for stat in STATS
        SYMBOLS.push(stat)
  end
  Xstats = Struct.new(*SYMBOLS)
end

class Game_Enemy < Game_Battler
  attr_accessor :xstat

  alias z26_enemy_set initialize unless $@
  def initialize(*args)
        z26_enemy_set(*args)
        @xstat = Z26::Xstats.new(*([0]*Z26::STATS.size))
        for stat in Z26::STATS
          z26variate_stats(stat)
        end
  end

  def z26variate_stats(stat)
        return if Z26.enemy_stats(@enemy_id)[stat].nil?
        if Z26.enemy_stats(@enemy_id)[stat].is_a?(String)
          set_in = eval(Z26.enemy_stats(@enemy_id)[stat]).to_i
          eval("@xstat.#{stat} += #{set_in}")
        else
          set_in = Z26.enemy_stats(@enemy_id)[stat]
          @xstat[stat] += set_in
        end
  end
end

class Game_Actor < Game_Battler
  attr_accessor :xstat

  alias z26_s setup unless $@
  def setup(actor_id)
        z26_s(actor_id)
        @xstat = Z26::Xstats.new(*([0]*Z26::STATS.size))
        for item in equips.compact
          z26variate_equip(item)
        end
        for stat in Z26::STATS
          z26variate_stats(stat, @level)
        end
  end

  alias z26_change_equip change_equip
  def change_equip(equip_type, item, test = false)
        last_item = equips[equip_type]
        z26_change_equip(equip_type, item)
        z26variate_equip(item)
        z26variate_equip(last_item, false)
  end

  #=====================#
  ##EDITED BY NELDERSON##
  #=====================#
  def z26variate_equip(item, adding = true)
        return if item.nil?
        for line in item.note.split(/[\r\n]+/).each{ |a|
          case a
          when /<weapon_xstat:[ ](.*)[ ](\d+)>/i
                  if Z26::STATS.include?(eval(":" + $1))
                        if adding
                          eval("@xstat.#{$1} += #{$2}")
                        else
                        eval("@xstat.#{$1} -= #{$2}")
                  end
                end
          end
          }
        end
  end

  def z26variate_stats(stat, level, adding = true)
        return if Z26.actor_level_formulas(@actor_id)[stat].nil?
        if Z26.actor_level_formulas(@actor_id)[stat].is_a?(String)
          amount = eval(Z26.actor_level_formulas(@actor_id)[stat]).to_i
        else
          amount = Z26.actor_level_formulas(@actor_id)[stat]
        end
        if adding
          eval("@xstat.#{stat} += #{amount}")
        else
          eval("@xstat.#{stat} -= #{amount}")
        end
  end

  alias z26level_up level_up unless $@
  def level_up
        for stat in Z26::STATS
          z26variate_stats(stat, @level, false)
        end
        z26level_up
        for stat in Z26::STATS
          z26variate_stats(stat, @level)
        end
  end
end

class Window_Status < Window_Selectable
  def draw_block3(y)
        draw_parameters(0, y)
        draw_equipments(344, y)#288
        draw_xstat_parameters(172, y)
  end

  def draw_xstat_parameters(x, y)
        @actor.xstat.size.times {|i|
        draw_actor_xstat_param(@actor, x, y + line_height * i, i) }
  end
end

class Window_Base < Window
  def draw_actor_xstat_param(actor, x, y, param_id)
        id = Z26::STATS[param_id]
        change_color(system_color)
        draw_text(x, y, 120, line_height, id.capitalize)
        change_color(normal_color)
        draw_text(x + 120, y, 36, line_height, actor.xstat[id], 2)
  end
end

class RPG::BaseItem
  def get_start_end_cache
        record = false
        temp = []
        self.note.split(/[\r\n]+/).each do |line|
          if line =~ /<xstat>/i
                record = true
          elsif line =~ /<xstat_end>/i
                record = false
          end
          if record
                temp << line
          end
        end
        return nil if temp == ""
        temp.delete_at(0)
        temp
  end
end[/pre]

原帖链接:
http://forums.rpgmakerweb.com/in ... -nasty-extra-stats/

评分

参与人数 1星屑 +150 收起 理由
Sion + 150 感谢帮忙

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
525 小时
注册时间
2012-2-23
回帖
139
 楼主| 发表于 2013-6-18 21:21:03 | 显示全部楼层
tyq4590 发表于 2013-6-18 18:57
在外站找到一个脚本应该可以帮到你。效果如下图:

这个会不会有点麻烦,必须要在角色的备注栏里写上吗?有没有简单点的?没有的话就不用了,就用你这个

点评

在备注栏里和在数据库的数值区设置能力值有什么区别吗?都是填入数据而已,想要把游戏做的更多元化当然就要比一般人多花点功夫咯:)  发表于 2013-6-18 21:37
回复

使用道具 举报

梦石
0
星屑
50
在线时间
525 小时
注册时间
2012-2-23
回帖
139
 楼主| 发表于 2013-6-18 21:38:39 | 显示全部楼层
alwsheng 发表于 2013-6-18 21:21
这个会不会有点麻烦,必须要在角色的备注栏里写上吗?有没有简单点的?没有的话就不用了,就用你这个 ...

好吧,谢谢你了,对了,有日站的网址么?我之前有记的,好像被我删了,有的话发我下

点评

不懂日文,从来不上日站。你再问问其他人吧。。。  发表于 2013-6-18 21:43
回复

使用道具 举报

梦石
0
星屑
278
在线时间
122 小时
注册时间
2010-12-23
回帖
168
发表于 2013-6-18 21:48:03 | 显示全部楼层
113340 发表于 2013-6-18 16:18
2楼好渊博

但是有个小问题············第二个地址指向的VX的脚本············· ...

第二个地址是,通用

VX和VA通用,请看图书馆目录的最后楼
- -作图太麻烦了,又是PS又是素材的
还不如玩游戏实际- -嗯嗯,娱乐就好!!

=====================
神马都简单,但是需要时间&精力,虽然我时间很多,但是专注一样东西的精力- -
====================
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部