Project1
标题:
又一个战斗问题,高手们帮帮忙哦
[打印本页]
作者:
KT猫
时间:
2008-4-13 02:36
提示:
作者被禁止或删除 内容自动屏蔽
作者:
joshua
时间:
2008-4-13 03:03
脚本里面改,不过没用过你的脚本,具体在哪,得看一下脚本
作者:
KT猫
时间:
2008-4-13 06:46
提示:
作者被禁止或删除 内容自动屏蔽
作者:
link006007
时间:
2008-4-13 07:03
Arrow_Enemy 的 update 没什么特殊要求的话 直接if 后加个or 就可以了
作者:
KT猫
时间:
2008-4-13 07:10
提示:
作者被禁止或删除 内容自动屏蔽
作者:
link006007
时间:
2008-4-13 07:15
比如:
# 光标右
if Input.repeat?(Input::RIGHT)
改成:
if Input.repeat?(Input::RIGHT) or Input.repeat?(Input::UP)
作者:
KT猫
时间:
2008-4-13 07:17
提示:
作者被禁止或删除 内容自动屏蔽
作者:
KT猫
时间:
2008-4-14 05:14
提示:
作者被禁止或删除 内容自动屏蔽
作者:
joshua
时间:
2008-4-14 05:19
按那家伙说的改的,把Arrow_Enemy 改了
#==============================================================================
# ■ Arrow_Enemy
#------------------------------------------------------------------------------
# 选择敌人的箭头光标。本类继承 Arrow_Base
# 类。
#==============================================================================
class Arrow_Enemy < Arrow_Base
#--------------------------------------------------------------------------
# ● 获取光标指向的敌人
#--------------------------------------------------------------------------
def enemy
return $game_troop.enemies[@index]
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 如果指向不存在的敌人就离开
$game_troop.enemies.size.times do
break if self.enemy.exist?
@index += 1
@index %= $game_troop.enemies.size
end
# 光标右
if Input.repeat?(Input::RIGHT) or Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
# 光标左
if Input.repeat?(Input::LEFT) or Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += $game_troop.enemies.size - 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
# 设置活动块坐标
if self.enemy != nil
self.x = self.enemy.screen_x
self.y = self.enemy.screen_y
end
end
#--------------------------------------------------------------------------
# ● 刷新帮助文本
#--------------------------------------------------------------------------
def update_help
# 帮助窗口显示敌人的名字与状态
@help_window.set_enemy(self.enemy)
end
end
作者:
joshua
时间:
2008-4-14 05:22
千万别用,那个家伙说的是改敌人选项按钮,你那个把脚本发上来可以吗?我不是用自己电脑,没有灵儿续传
作者:
link006007
时间:
2008-4-14 05:30
汗 lz说的是那个选项图标吗 - -b
我迷看见啊 我那个确实是改敌人的 不是lz要的
作者:
KT猫
时间:
2008-4-14 05:42
提示:
作者被禁止或删除 内容自动屏蔽
作者:
joshua
时间:
2008-4-14 05:44
我也晕,
SCENE_BATTLE吧
作者:
link006007
时间:
2008-4-14 05:45
自己分不清楚的话 把工程目录下data文件夹下的Scripts.rxdata发上来
不过这样包含了你全部脚本 lz自己看吧
作者:
KT猫
时间:
2008-4-14 05:48
提示:
作者被禁止或删除 内容自动屏蔽
作者:
KT猫
时间:
2008-4-14 05:53
提示:
作者被禁止或删除 内容自动屏蔽
作者:
link006007
时间:
2008-4-14 06:21
修改
★战斗菜单
class Window_CommandIcon < Window_Selectable
的update函数
因为这个update函数的super直接调用了父类方法, 而传入的common只有0,1,2,3,所以up和down按键是无效的
只要修改updte就可以修改光标了
def update
super
# 可以移动光标的情况下
if self.active and @item_max > 0 and @index >= 0
# 方向键下被按下的情况下
if Input.repeat?(Input::DOWN)
@index = 2
end
# 方向键上被按下的情况下
if Input.repeat?(Input::UP)
@index = 0
end
# 方向键右被按下的情况下
if Input.repeat?(Input::RIGHT)
@index = 3
end
# 方向键左被按下的情况下
if Input.repeat?(Input::LEFT)
@index = 1
end
end
icon_update
com_name_update if Momo_IconCommand::COM_NAME_DROW
if move_index?
@last_index = self.index
end
end
这个是我修改的 可以使用, 只是没有更新helpwindow的帮助, 而且重复调用了父类的方法, 效率也不高, 只是测试一下而已(个人建议如果要修改窗体的按键更新,最好不要继承Window_Selectable, 这样可以避免系统重复调用无用的更新判断) [LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者:
KT猫
时间:
2008-4-14 06:44
提示:
作者被禁止或删除 内容自动屏蔽
作者:
KT猫
时间:
2008-4-14 06:48
提示:
作者被禁止或删除 内容自动屏蔽
作者:
link006007
时间:
2008-4-14 20:24
没改什么东西 就是把父类换掉了 - -
直接把原来的覆盖掉吧
class Window_CommandIcon < Window_Base
attr_accessor :last_index
attr_accessor :index
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, commands)
super(x, y, 37, 37)
# ウィンドウスキンに空文字列を指定してウィンドウを描画しないようにする
self.windowskin = RPG::Cache.windowskin("")
@item_max = commands.size
@commands = commands
@column_max = commands.size
@index = 0
@last_index = nil
@name_sprite = nil
@sprite = []
refresh
end
def dispose
super
for sprite in @sprite
sprite.dispose unless sprite.nil?
end
@name_sprite.dispose unless @name_sprite.nil?
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
@name_sprite.dispose unless @name_sprite.nil?
for sprite in @sprite
sprite.dispose unless sprite.nil?
end
@name_sprite = nil
draw_com_name if Momo_IconCommand::COM_NAME_DROW
@sprite = []
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# ● 項目の描画
#--------------------------------------------------------------------------
def draw_item(index)
@sprite[index] = Sprite_Icon.new(nil, @commands[index])
@sprite[index].z = self.z + 1
end
def draw_com_name
@name_sprite = Sprite_Comm_Name.new(nil, get_com_name)
end
# 更新
def update
super
# 可以移动光标的情况下
if self.active and @item_max > 0 and @index >= 0
# 方向键下被按下的情况下
if Input.repeat?(Input::DOWN)
@index = 2
end
# 方向键上被按下的情况下
if Input.repeat?(Input::UP)
@index = 0
end
# 方向键右被按下的情况下
if Input.repeat?(Input::RIGHT)
@index = 3
end
# 方向键左被按下的情况下
if Input.repeat?(Input::LEFT)
@index = 1
end
end
icon_update
com_name_update if Momo_IconCommand::COM_NAME_DROW
if move_index?
@last_index = @index
end
end
# アイコンの更新
def icon_update
qx = 25
qy = 385
for i in
[email protected]
@sprite[i].active = (@index == i)
@sprite[0].x = 40 +qx
@sprite[0].y = -15 +qy
@sprite[1].x = 0 + qx
@sprite[1].y = 23 + qy
@sprite[2].x = 40 + qx
@sprite[2].y = 59 + qy
@sprite[3].x = 81 + qx
@sprite[3].y = 23 + qy
#@sprite[i].x = self.x + i * 56
#@sprite[i].y = self.y + 0
@sprite[i].z = (@index == i) ? self.z + 2 : self.z + 1
@sprite[i].visible = self.visible
@sprite[i].update
end
end
# コマンドネームの更新
def com_name_update
if move_index?
@name_sprite.name = get_com_name
end
@name_sprite.x = self.x - 12 + Momo_IconCommand::COM_NAME_X_PLUS
@name_sprite.y = self.y - 40 + Momo_IconCommand::COM_NAME_Y_PLUS
@name_sprite.z = self.z + 1
@name_sprite.active = self.active
@name_sprite.visible = self.visible
@name_sprite.update
end
def get_com_name
make_name_set if @name_set.nil?
name = @name_set[self.index]
name = "" if name.nil?
return name
end
def make_name_set
@name_set = []
@name_set[0] = Momo_IconCommand::ATTACK_NAME
@name_set[1] = Momo_IconCommand::SKILL_NAME
@name_set[2] = Momo_IconCommand::GUARD_NAME
@name_set[3] = Momo_IconCommand::ITEM_NAME
end
def move_index?
return @index != @last_index
end
def need_reset
@name_sprite.need_reset = true if Momo_IconCommand::COM_NAME_DROW
end
end
复制代码
作者:
KT猫
时间:
2008-4-15 04:57
提示:
作者被禁止或删除 内容自动屏蔽
作者:
zlink
时间:
2008-4-15 06:58
以下引用
KT猫于2008-4-14 20:57:49
的发言:
晕了,像上面那样改就变成本来RPG默认那样的了
没有仙剑的那种效果了
[本贴由作者于 2008-4-14 21:01:06 最后编辑]
对不起, 我没有玩过仙剑啊
只是想让你知道要改的话, 改那个update函数
link006007没想到监狱的时间变久了 进去后还没有出来 - -b
作者:
KT猫
时间:
2008-4-15 07:52
提示:
作者被禁止或删除 内容自动屏蔽
作者:
KT猫
时间:
2008-4-15 07:53
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1