设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1882|回复: 9
打印 上一主题 下一主题

[已经过期] 战斗选择目标敌人问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
236
在线时间
191 小时
注册时间
2010-6-22
帖子
233
跳转到指定楼层
1
发表于 2010-8-13 15:52:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
一般选择目标敌人时按 ESC 可以取消选取
可是当我的箭头在右面的敌人,再按 ESC ,敌斗选单便消失了
什么都不能选择,卡住了
若箭头在最左面的敌人,按 ESC 却可以取消选取,没有问题
如何解决卡住了的情况?

图解:
当我的箭头在右面的敌人


按 ESC 后,敌斗选单便消失了,不见了选择"攻击","仙术"的选项,卡住了

Lv1.梦旅人

梦石
0
星屑
50
在线时间
73 小时
注册时间
2010-6-26
帖子
279
2
发表于 2010-8-13 15:53:21 | 只看该作者
你按右下角的0看看
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
236
在线时间
191 小时
注册时间
2010-6-22
帖子
233
3
 楼主| 发表于 2010-8-13 15:58:43 | 只看该作者
回复 a849797000 的帖子
键盘上的0?
没有反应~
   
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
236
在线时间
191 小时
注册时间
2010-6-22
帖子
233
4
 楼主| 发表于 2010-8-17 14:09:37 | 只看该作者
没有人?
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (管理员)

老黄鸡

梦石
0
星屑
40703
在线时间
7542 小时
注册时间
2009-7-6
帖子
13506

开拓者贵宾

5
发表于 2010-8-21 19:02:28 | 只看该作者
右下角的0等于X键,别听LS胡咧咧

应该是脚本没有设置按B的情况

你打开脚本看看update_command这里应该有设置
  1. # 按下 B 键的情况下
  2.    if Input.trigger?(Input::B)
  3.      # 演奏取消 SE
  4.      $game_system.se_play($data_system.cancel_se)
  5.      # 切换的地图画面
  6.      $scene = Scene_Map.new
  7.      return
  8.    end
复制代码
这个是原版的代码,你可以照着格式改
RGDirect - DirectX驱动的RGSS,点我了解.
RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
236
在线时间
191 小时
注册时间
2010-6-22
帖子
233
6
 楼主| 发表于 2010-8-21 19:12:21 | 只看该作者
回复 fux2 的帖子
是在哪个脚本?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2010-7-5
帖子
483
7
发表于 2010-8-21 19:17:04 | 只看该作者
...当然就是你用的脚本。。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
236
在线时间
191 小时
注册时间
2010-6-22
帖子
233
8
 楼主| 发表于 2010-8-21 19:37:25 | 只看该作者
回复 BBBBB6 的帖子
这个吗?
没有 update_command
  1. #==============================================================================
  2. # ■ Arrow_Enemy
  3. #------------------------------------------------------------------------------
  4. #  选择敌人的箭头光标。本类继承 Arrow_Base
  5. # 类。
  6. #==============================================================================

  7. class Arrow_Enemy < Arrow_Base
  8.   #--------------------------------------------------------------------------
  9.   # ● 获取光标指向的敌人
  10.   #--------------------------------------------------------------------------
  11.   def enemy
  12.     return $game_troop.enemies[@index]
  13.   end
  14.   #--------------------------------------------------------------------------
  15.   # ● 刷新画面
  16.   #--------------------------------------------------------------------------
  17.   def update
  18.     super
  19.     # 如果指向不存在的敌人就离开
  20.     $game_troop.enemies.size.times do
  21.       break if self.enemy.exist?
  22.       @index += 1
  23.       @index %= $game_troop.enemies.size
  24.     end
  25.     # 光标右
  26.     if Input.repeat?(Input::RIGHT)
  27.       $game_system.se_play($data_system.cursor_se)
  28.       $game_troop.enemies.size.times do
  29.         @index += 1
  30.         @index %= $game_troop.enemies.size
  31.         break if self.enemy.exist?
  32.       end
  33.     end
  34.     # 光标左
  35.     if Input.repeat?(Input::LEFT)
  36.       $game_system.se_play($data_system.cursor_se)
  37.       $game_troop.enemies.size.times do
  38.         @index += $game_troop.enemies.size - 1
  39.         @index %= $game_troop.enemies.size
  40.         break if self.enemy.exist?
  41.       end
  42.     end
  43.     # 设置活动块坐标
  44.     if self.enemy != nil
  45.       self.x = self.enemy.screen_x
  46.       self.y = self.enemy.screen_y
  47.     end
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● 刷新帮助文本
  51.   #--------------------------------------------------------------------------
  52.   def update_help
  53.     # 帮助窗口显示敌人的名字与状态

  54.   end
  55. end
复制代码
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (管理员)

老黄鸡

梦石
0
星屑
40703
在线时间
7542 小时
注册时间
2009-7-6
帖子
13506

开拓者贵宾

9
发表于 2010-8-22 14:26:59 | 只看该作者
回复 仙芋 的帖子

没有自己添加
   
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
236
在线时间
191 小时
注册时间
2010-6-22
帖子
233
10
 楼主| 发表于 2010-8-22 15:21:00 | 只看该作者
回复 fux2 的帖子
问题原来不在刚才的脚本
是在这个
可是我找不出什么问题
  1. #==============================================================================
  2. #==============================================================================

  3. module Momo_IconCommand
  4.   # 图标名称设定
  5.   ATTACK_ICON_NAME = "Attack" # 攻击
  6.   SKILL_ICON_NAME = "Skill"   # 特技
  7.   GUARD_ICON_NAME = "Guard"  # 防御
  8.   ITEM_ICON_NAME = "Thing"     # 物品
  9.   # X坐标修正
  10.   X_PLUS = -320
  11.   # Y坐标修正
  12.   Y_PLUS = -100
  13.   # 选择时图标的动作
  14.   # 0:静止 1:放大
  15.   SELECT_TYPE = 0
  16.   # 闪烁时光芒的颜色
  17.   FLASH_COLOR = Color.new(255, 255, 255, 128)
  18.   # 闪烁时间
  19.   FLASH_DURATION = 10
  20.   # 闪烁间隔
  21.   FLASH_INTERVAL = 20
  22.   # 是否写出文字的名称
  23.   COM_NAME_DROW = false
  24.   # 文字名称是否移动
  25.   COM_NAME_MOVE = false
  26.   # 文字内容
  27.   ATTACK_NAME = "攻击"    # 攻击
  28.   SKILL_NAME = "特技"   # 特技
  29.   GUARD_NAME = "防御"     # 防御
  30.   ITEM_NAME = "物品"  # 物品
  31.   # 文字颜色
  32.   COM_NAME_COLOR = Color.new(255, 255, 255, 255)
  33.   # 文字坐标修正
  34.   COM_NAME_X_PLUS = 0
  35.   COM_NAME_Y_PLUS = 0
  36. end

  37. class Window_CommandIcon < Window_Selectable
  38.   attr_accessor :last_index
  39.   #--------------------------------------------------------------------------
  40.   # ● オブジェクト初期化
  41.   #--------------------------------------------------------------------------
  42.   def initialize(x, y, commands)
  43.     super(x, y, 37, 37)
  44.     # ウィンドウスキンに空文字列を指定してウィンドウを描画しないようにする
  45.     self.windowskin = RPG::Cache.windowskin("")
  46.     @item_max = commands.size
  47.     @commands = commands
  48.     @column_max = commands.size
  49.     @index = 0
  50.     @last_index = nil
  51.     @name_sprite = nil
  52.     @sprite = []
  53.     refresh
  54.   end
  55.   def dispose
  56.     super
  57.     for sprite in @sprite
  58.       sprite.dispose unless sprite.nil?
  59.     end
  60.     @name_sprite.dispose unless @name_sprite.nil?
  61.   end
  62.   #--------------------------------------------------------------------------
  63.   # ● リフレッシュ
  64.   #--------------------------------------------------------------------------
  65.   def refresh
  66.     @name_sprite.dispose unless @name_sprite.nil?
  67.     for sprite in @sprite
  68.       sprite.dispose unless sprite.nil?
  69.     end
  70.     @name_sprite = nil
  71.     draw_com_name if Momo_IconCommand::COM_NAME_DROW
  72.     @sprite = []
  73.     for i in 0...@item_max
  74.       draw_item(i)
  75.     end
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   # ● 项目の描画
  79.   #--------------------------------------------------------------------------
  80.   def draw_item(index)
  81.     @sprite[index] = Sprite_Icon.new(nil, @commands[index])
  82.     @sprite[index].z = self.z + 1
  83.   end
  84.   def draw_com_name
  85.     @name_sprite = Sprite_Comm_Name.new(nil, get_com_name)
  86.    
  87.   end
  88.   
  89.   # 更新
  90.   def update
  91.     super
  92.   #--------------------------------------------------------------------------
  93.   
  94.     if Input.repeat?(Input::DOWN)
  95.       $game_system.se_play($data_system.cursor_se)
  96.       @index = 2
  97.     end
  98.     if Input.repeat?(Input::UP)
  99.       $game_system.se_play($data_system.cursor_se)
  100.       @index = 0
  101.     end
  102.     if Input.repeat?(Input::RIGHT)
  103.       $game_system.se_play($data_system.cursor_se)
  104.       @index = 3
  105.     end
  106.     if Input.repeat?(Input::LEFT)
  107.       $game_system.se_play($data_system.cursor_se)
  108.       @index = 1
  109.     end
  110.       
  111.   #--------------------------------------------------------------------------

  112.     icon_update
  113.     com_name_update if Momo_IconCommand::COM_NAME_DROW
  114.     if move_index?
  115.       @last_index = self.index
  116.     end
  117.   end
  118.   # アイコンの更新
  119.   def icon_update
  120.     qx = 25
  121.     qy = 385
  122.     for i in [email protected]
  123.       @sprite[i].active = (self.index == i)
  124.       @sprite[0].x = 40 +qx
  125.       @sprite[0].y = -15 +qy
  126.       @sprite[1].x = 0 + qx
  127.       @sprite[1].y = 23 + qy
  128.       @sprite[2].x = 40 + qx
  129.       @sprite[2].y = 59 + qy
  130.       @sprite[3].x = 81 + qx
  131.       @sprite[3].y = 23 + qy
  132.       #@sprite[i].x = self.x + i * 56
  133.       #@sprite[i].y = self.y + 0
  134.       @sprite[i].z = (self.index == i) ? self.z + 2 : self.z + 1
  135.       @sprite[i].visible = self.visible
  136.       @sprite[i].update
  137.     end
  138.   end
  139.   # コマンドネームの更新
  140.   def com_name_update
  141.     if move_index?
  142.       @name_sprite.name = get_com_name
  143.     end
  144.     @name_sprite.x = self.x - 12 + Momo_IconCommand::COM_NAME_X_PLUS
  145.     @name_sprite.y = self.y - 40 + Momo_IconCommand::COM_NAME_Y_PLUS
  146.     @name_sprite.z = self.z + 1
  147.     @name_sprite.active = self.active
  148.     @name_sprite.visible = self.visible
  149.     @name_sprite.update
  150.   end
  151.   def get_com_name
  152.     make_name_set if @name_set.nil?
  153.     name = @name_set[self.index]
  154.     name = "" if name.nil?
  155.     return name
  156.   end
  157.   def make_name_set
  158.     @name_set = []
  159.     @name_set[0] = Momo_IconCommand::ATTACK_NAME
  160.     @name_set[1] = Momo_IconCommand::SKILL_NAME
  161.     @name_set[2] = Momo_IconCommand::GUARD_NAME
  162.     @name_set[3] = Momo_IconCommand::ITEM_NAME
  163.   end
  164.   def move_index?
  165.     return self.index != @last_index
  166.   end
  167.   def need_reset
  168.     @name_sprite.need_reset = true if Momo_IconCommand::COM_NAME_DROW
  169.   end
  170. end

  171. # アイコン用スプライト
  172. class Sprite_Icon < Sprite
  173.   attr_accessor :active
  174.   attr_accessor :icon_name
  175.   #--------------------------------------------------------------------------
  176.   # ● オブジェクト初期化
  177.   #--------------------------------------------------------------------------
  178.   def initialize(viewport, icon_name)
  179.     super(viewport)
  180.     @icon_name = icon_name
  181.     @last_icon = @icon_name
  182.     @count = 0
  183.     self.bitmap = RPG::Cache.icon(@icon_name)
  184.     self.ox = self.bitmap.width / 2
  185.     self.oy = self.bitmap.height / 2
  186.     @active = false
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ● 解放
  190.   #--------------------------------------------------------------------------
  191.   def dispose
  192.     if self.bitmap != nil
  193.       self.bitmap.dispose
  194.     end
  195.     super
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ● フレーム更新
  199.   #--------------------------------------------------------------------------
  200.   def update

  201.    

  202.    
  203.     super
  204.     if @icon_name != @last_icon
  205.       @last_icon = @icon_name
  206.       self.bitmap = RPG::Cache.icon(@icon_name)
  207.     end
  208.     if @active
  209.       @count += 1
  210.       case Momo_IconCommand::SELECT_TYPE
  211.       when 0
  212.         icon_flash
  213.       when 1
  214.         icon_zoom
  215.       end
  216.       @count = 0 if @count == 20
  217.     else
  218.       icon_reset
  219.     end
  220.   end
  221.   def icon_flash

  222.    
  223.    
  224.    
  225.     if @count % Momo_IconCommand::FLASH_INTERVAL == 0 or @count == 1
  226.       self.flash(Momo_IconCommand::FLASH_COLOR, Momo_IconCommand::FLASH_DURATION)
  227.     end
  228.   end
  229.   def icon_zoom
  230.     case @count
  231.     when 1..10
  232.       zoom = 1.0 + @count / 10.0
  233.     when 11..20
  234.       zoom = 2.0 - (@count - 10) / 10.0
  235.     end
  236.     self.zoom_x = zoom
  237.     self.zoom_y = zoom
  238.   end
  239.   def icon_reset
  240.     @count = 0
  241.     self.zoom_x = 1.0
  242.     self.zoom_y = 1.0
  243.   end
  244. end

  245. # コマンドネーム用スプライト
  246. class Sprite_Comm_Name < Sprite
  247.   attr_accessor :active
  248.   attr_accessor :name
  249.   attr_accessor :need_reset
  250.   #--------------------------------------------------------------------------
  251.   # ● オブジェクト初期化
  252.   #--------------------------------------------------------------------------
  253.   def initialize(viewport, name)
  254.     super(viewport)
  255.     @name = name
  256.     @last_name = nil
  257.     @count = 0
  258.     @x_plus = 0
  259.     @opa_plus = 0
  260.     @need_reset = false
  261.     @active = false
  262.     self.bitmap = Bitmap.new(160, 32)
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # ● 解放
  266.   #--------------------------------------------------------------------------
  267.   def dispose
  268.     if self.bitmap != nil
  269.       self.bitmap.dispose
  270.     end
  271.     super
  272.   end
  273.   #--------------------------------------------------------------------------
  274.   # ● フレーム更新
  275.   #--------------------------------------------------------------------------
  276.   def update

  277.    

  278.    
  279.    
  280.     super
  281.     if @active
  282.       if need_reset?
  283.         @need_reset = false
  284.         @last_name = @name
  285.         text_reset
  286.       end
  287.       move_text if Momo_IconCommand::COM_NAME_MOVE
  288.     end
  289.   end
  290.   def move_text
  291.     @count += 1
  292.     @x_plus = [@count * 8, 80].min
  293.     self.y = 0
  294.     self.x = self.x - 300 - @x_plus
  295.     self.opacity = @count * 25
  296.   end
  297.   def text_reset
  298.     @count = 0
  299.     @x_plus = 0
  300.     self.bitmap.clear
  301.     self.bitmap.font.color = Momo_IconCommand::COM_NAME_COLOR
  302.     self.bitmap.draw_text(0, 0, 160, 32, @name)
  303.   end
  304.   def need_reset?
  305.     return (@name != @last_name or @need_reset)
  306.   end
  307. end

  308. class Scene_Battle
  309.   #--------------------------------------------------------------------------
  310.   # ● プレバトルフェーズ开始
  311.   #--------------------------------------------------------------------------
  312.   alias scene_battle_icon_command_start_phase1 start_phase1
  313.   def start_phase1
  314.     com1 = Momo_IconCommand::ATTACK_ICON_NAME
  315.     com2 = Momo_IconCommand::SKILL_ICON_NAME
  316.     com3 = Momo_IconCommand::GUARD_ICON_NAME
  317.     com4 = Momo_IconCommand::ITEM_ICON_NAME
  318.     @actor_command_window = Window_CommandIcon.new(0, 0, [com1, com2, com3, com4])
  319.     @actor_command_window.y = 160
  320.     @actor_command_window.back_opacity = 160
  321.     $fff = 0
  322.     @actor_command_window.active = false
  323. #    @actor_command_window.visible = false
  324.     @actor_command_window.update
  325.     scene_battle_icon_command_start_phase1
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ● アクターコマンドウィンドウのセットアップ
  329.   #--------------------------------------------------------------------------
  330.   alias scene_battle_icon_command_phase3_setup_command_window phase3_setup_command_window
  331.   def phase3_setup_command_window
  332.     scene_battle_icon_command_phase3_setup_command_window
  333.     # アクターコマンドウィンドウの位置を设定
  334.     @actor_command_window.x = 1000
  335.     @actor_command_window.y = 1000
  336.     @actor_command_window.need_reset
  337.   end
  338.   def command_window_actor_x(index)
  339.     $game_party.actors[index].screen_x + Momo_IconCommand::X_PLUS
  340.   end
  341.   def command_window_actor_y(index)
  342.     $game_party.actors[index].screen_y + Momo_IconCommand::Y_PLUS
  343.   end
  344. end

  345. #==============================================================================
  346. #==============================================================================
复制代码
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-2-20 14:18

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表