Project1

标题: 能力的排序 [打印本页]

作者: 亂堂和樹    时间: 2014-12-25 22:59
标题: 能力的排序
本帖最后由 亂堂和樹 于 2014-12-25 23:04 编辑

是的,我又很厚臉皮的來了QAQ....因為不能一帖多問,所以等待上個帖子結束後...才來發問

關於裝備....應該說,有關這行"6.times {|i| draw_item(0, line_height  * (1 + i), 2 + i)}"

它的效果顯示這樣



我想請問大家的是...6.times {|i| draw_item(0, line_height  * (1 + i), 2 + i)}...這裡面的能力可以自己排嗎?

因為有些角色我想限定部分屬性不出現,或是出現新增的屬性

麻煩各位大大不吝嗇地在指導我一下吧..感激QAQ

另外...問個蠢問題,除了圖書館內的傷害公式可以玩出新花樣之外...
這新的VXAce...不能自己修改默認的傷害公式嗎?
(坦白說...因為有些屬性不想新增..就把內定的幸運值改成類似命中、好讓它隨著等級提升...)

作者: VIPArcher    时间: 2014-12-25 23:23
可以啊,6.times {|i| draw_item(0, line_height  * (1 + i), 2 + i)}其实就是执行6次draw_item,每次i加1(这样应该说得清楚了吧?
如果你的需求是这样,那么完全可以放弃默认的做法,直接用draw_item(x,y,能力值编号)来一个一个地绘制。只绘制你自己需要的能力值,坐标也可以自己调。
作者: 亂堂和樹    时间: 2014-12-26 01:52
本帖最后由 亂堂和樹 于 2014-12-26 02:16 编辑
VIPArcher 发表于 2014-12-25 23:23
可以啊,6.times {|i| draw_item(0, line_height  * (1 + i), 2 + i)}其实就是执行6次draw_item,每次i加1 ...


那這段又要怎麼改呢0.0"...因為新屬性用的  不是"param"..而是 "caram"...

#--------------------------------------------------------------------------
  # ● 繪制更換裝備後的能力值
  #--------------------------------------------------------------------------
  def draw_new_param(x, y, param_id)
    new_value = @temp_actor.param(param_id)
    change_color(param_change_color(new_value - @actor.param(param_id)))
    draw_text(x+19, y+77, 32, line_height, new_value, 1)
    end
end

比如說最上的貼圖來說

格鬥 param
射擊 caram
防禦 param
技量 param
命中 param
迴避 param

這樣子,他只會單獨顯示第一個"格鬥"...後面的數值都沒

=============================================
更正,雖然數字都有出現,但是卻沒顏色.....(正常是...增加= 綠 , 減少 = 紅)





腳本方面...

  def draw_new_param(x, y, param_id)
    #new_value = @temp_actor.param(param_id)
    #change_color(param_change_color(new_value - @actor.param(param_id)))
    #draw_text(x+19, y+77, 32, line_height, new_value, 1)
if @actor == $game_actors[3]
    new_value = @temp_actor.caram(1)
    change_color(param_change_color(new_value - @actor.caram(1)))
    draw_text(x+19, y+77, 40, line_height, new_value, 1)
elsif @actor == $game_actors[9]
    new_value = @temp_actor.caram(1)
    change_color(param_change_color(new_value - @actor.caram(1)))
    draw_text(x+19, y+77, 40, line_height, new_value, 1)
else
    new_value = @temp_actor.param(2)
    new_value1 = @temp_actor.param(4)
    change_color(param_change_color(new_value - @actor.param(2)))
    change_color(param_change_color(new_value1 - @actor.param(4)))
    draw_text(x+19, y+77, 40, line_height, new_value, 1)
    draw_text(x+19, y+101, 40, line_height, new_value1, 1)
  end
    new_value2 = @temp_actor.param(5)
    new_value3 = @temp_actor.param(3)
    new_value4 = @temp_actor.param(7)
    new_value5 = @temp_actor.param(6)
    change_color(param_change_color(new_value2 - @actor.param(5)))
    change_color(param_change_color(new_value3 - @actor.param(3)))
    change_color(param_change_color(new_value4 - @actor.param(7)))
    change_color(param_change_color(new_value5 - @actor.param(6)))
    draw_text(x+19, y+125, 40, line_height, new_value2, 1)
    draw_text(x+19, y+149, 40, line_height, new_value3, 1)
    draw_text(x+19, y+173, 40, line_height, new_value4, 1)
    draw_text(x+19, y+197, 40, line_height, new_value5, 1)
    end
end
作者: 喵呜喵5    时间: 2014-12-26 10:32
亂堂和樹 发表于 2014-12-26 01:52
那這段又要怎麼改呢0.0"...因為新屬性用的  不是"param"..而是 "caram"...

#-------------------------- ...


change_color这个方法修改的是接下去描绘的所有文字的颜色
  1.     new_value2 = @temp_actor.param(5)
  2.     new_value3 = @temp_actor.param(3)
  3.     new_value4 = @temp_actor.param(7)
  4.     new_value5 = @temp_actor.param(6)
  5.     change_color(param_change_color(new_value2 - @actor.param(5)))
  6.     change_color(param_change_color(new_value3 - @actor.param(3)))
  7.     change_color(param_change_color(new_value4 - @actor.param(7)))
  8.     change_color(param_change_color(new_value5 - @actor.param(6)))
  9.     draw_text(x+19, y+125, 40, line_height, new_value2, 1)
  10.     draw_text(x+19, y+149, 40, line_height, new_value3, 1)
  11.     draw_text(x+19, y+173, 40, line_height, new_value4, 1)
  12.     draw_text(x+19, y+197, 40, line_height, new_value5, 1)
复制代码
所以你写的这个脚本至少应该改成这样颜色的描绘才是正常的:
  1.     new_value2 = @temp_actor.param(5)
  2.     new_value3 = @temp_actor.param(3)
  3.     new_value4 = @temp_actor.param(7)
  4.     new_value5 = @temp_actor.param(6)
  5.     change_color(param_change_color(new_value2 - @actor.param(5)))
  6.     draw_text(x+19, y+125, 40, line_height, new_value2, 1)
  7.     change_color(param_change_color(new_value3 - @actor.param(3)))
  8.     draw_text(x+19, y+149, 40, line_height, new_value3, 1)
  9.     change_color(param_change_color(new_value4 - @actor.param(7)))
  10.     draw_text(x+19, y+173, 40, line_height, new_value4, 1)
  11.     change_color(param_change_color(new_value5 - @actor.param(6)))
  12.     draw_text(x+19, y+197, 40, line_height, new_value5, 1)
复制代码





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