UltimaForum

Skrypty [VX] - RingMenu podczas Walki

dawidos989 - Czw 04 Lut, 2010 15:06
Temat postu: RingMenu podczas Walki
To mój pierwszy skrypt na forum. Zmienia komendy podczas walki na ring menu.

Screen:
Spoiler:


Skrypt:
Spoiler:

Kod:

#=================================================
# Autor: Ziifee
#=================================================

module Zii
   # ikona (16 + vertical side - 1)
   FIGHT = 132 # walka
   ESCAPE = 143 # ucieczka
   ATTACK = 1 # atak
   GUARD = 52 # obrona
   SKILL = 137 # umiejętności
   ITEM = 144 # przedmiot
 
   # obrót ("positive" / "reverse")
   TURN = "positive"
 
   # buźki ("use" / "")
   STATUS_FACE = ""
 
   # wyśwetl ustawienia ( "name" / "")
   STATUS_LINE = "name"
 
   # wymiar (VX domyślny 20)
   LINE_SIZE = 14
 
  def self.turn_normal?
    return false if TURN == "reverse"
    return true if TURN == "positive"
    return true
  end
  def self.battle_face?
    return true if STATUS_FACE == ""
    return false
  end
  def self.line_name?
    return true if STATUS_LINE == "name"
    return false
  end
end

class Window_Base
  def draw_face(face_name, face_index, x, y, size = 96, opacity = 255)
    bitmap = Cache.face(face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = face_index % 4 * 96 + (96 - size) / 2
    rect.y = face_index / 4 * 96 + (96 - size) / 2
    rect.width = size
    rect.height = size
    self.contents.blt(x, y, bitmap, rect, opacity)
    bitmap.dispose
  end
  def draw_actor_face(actor, x, y, size = 96, opacity = 255)
    draw_face(actor.face_name, actor.face_index, x, y, size, opacity)
  end
end


class Window_SpinCommand < Window_Base
   attr_reader   :index                   
   attr_reader   :help_window             
  def initialize(cx, cy, commands, setting = {})
    @radius    = setting.has_key?("R") ? setting["R"] : 40 
    @speed     = setting.has_key?("S") ? setting["S"] : 36 
    @spin_back = setting.has_key?("G") ? setting["G"] : "" 
    @spin_line = setting.has_key?("L") ? setting["L"] : nil
    x, y = cx - @radius - 28, cy - @radius - 28
    width = height = @radius * 2 + 56
    super(x, y, width, height)
    self.opacity = 0
    @index = 0
    @commands = commands                                   
    @spin_right = true
    @spin_count = 0
    update_cursor
  end
  def draw_spin_graphic(i, cx, cy)
    case command_kind(i)
    when "icon"
      draw_icon(command_pull(i), cx - 12, cy - 12, command_enabled?(i))
    end
  end
  def refresh
    set_spin
  end
  def draw_item(index, enabled = true)
    @commands[index][3] = enabled
    set_spin
  end
  def command_name(index = @index)
    return "" if index < 0
    name = @commands[index][0]
    return name != nil ? name : ""
  end
  def command_kind(index)
    result = @commands[index][1]
    return result != nil ? result : ""
  end
  def command_pull(index)
    result = @commands[index][2]
    return result != nil ? result : ""
  end
  def command_enabled?(index)
    result = @commands[index][3]
    return result != nil ? result : true
  end
  def set_index(name)
    n = -1
    for i in 0...@commands.size
      n = i if @commands[i][0] == name
    end
    @index = n if n >= 0
    update_cursor
    call_update_help
    set_spin
  end
  def index=(index)
    @index = index
    update_cursor
    call_update_help
    set_spin
  end
  def center_x
    return contents.width / 2
  end
  def center_y
    return contents.height / 2
  end
  def item_max
    return @commands.size
  end
  def set_background
    return if @spin_back == ""
    bitmap = Cache.system(@spin_back)
    rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(12, 12, bitmap, rect)
  end
  def set_text
    return if @spin_line == nil
    y = center_y - WLH / 2 + @spin_line
    self.contents.draw_text(center_x - 48, y, 96, WLH, command_name, 1)
  end
  def angle_size
    return (Math::PI * 2 / item_max)
  end
  def set_spin_count
    @spin_count = angle_size * 360 / @speed
    set_spin(true)
  end
  def set_spin(spin = false)
    self.contents.clear
    set_background
    angle = spin ? @speed * @spin_count / 360 : 0
    angle = @spin_right ? angle : -angle
    for i in 0...item_max
      n = (i - @index) * angle_size + angle
      cx = @radius * Math.sin(n) + center_x
      cy = - @radius * Math.cos(n) + center_y
      draw_spin_graphic(i, cx, cy)
    end
    set_text
  end
  def update
    super
    update_cursor
    if @spin_count > 0
      @spin_count -= 1
      set_spin(@spin_count >= 1)
      return
    end
    update_command
  end
  def command_movable?
    return false if @spin_count > 0
    return false if (not visible or not active)
    return false if (index < 0 or index > item_max or item_max == 0)
    return false if (@opening or @closing)
    return true
  end
   def command_right
    @index = (@index + 1) % item_max
    @spin_right = true
    set_spin_count
  end
  def command_left
    @index = (@index - 1 + item_max) % item_max
    @spin_right = false
    set_spin_count
  end
  def update_command
    if command_movable?
      if Input.press?(Input::RIGHT)
        Sound.play_cursor
        Zii.turn_normal? ? command_right : command_left
      end
      if Input.press?(Input::LEFT)
        Sound.play_cursor
        Zii.turn_normal? ? command_left : command_right
      end
    end
    call_update_help
  end
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
    else
      rect = Rect.new(0, 0, 24, 24)
      rect.x = center_x - rect.width / 2
      rect.y = center_y - rect.height / 2 - @radius
      self.cursor_rect = rect
    end
  end
  def help_window=(help_window)
    @help_window = help_window
    call_update_help
  end
  def call_update_help
    if self.active and @help_window != nil
       update_help
    end
  end
  def update_help
  end
end

class Window_LineHelp < Window_Base
  def initialize
    super(-16, 0, 576, WLH + 32)
    self.opacity = 0
  end
  def set_text(text, align = 0)
    if text != @text or align != @align
      self.contents.clear
      back_color = Color.new(0, 0, 0, 80)
      self.contents.fill_rect(0, y = 12, contents.width, WLH - y, back_color)
      self.contents.font.color = normal_color
      self.contents.draw_text(20, 0, self.width - 72, WLH, text, align)
      @text = text
      @align = align
    end
  end
end

class Window_PartyCommand < Window_SpinCommand
  def initialize
    s1 = [Vocab::fight,  "icon", Zii::FIGHT,  true]
    s2 = [Vocab::escape, "icon", Zii::ESCAPE, $game_troop.can_escape]
    setting = {"R"=>40, "S"=>52, "G"=>"Spin40", "L"=>-12}
    super(72, 356, [s1, s2], setting)
    self.active = false
    set_spin
  end
end


class Window_ActorCommand < Window_SpinCommand
  def initialize
    s1 = [Vocab::attack, "icon", Zii::ATTACK, true]
    s2 = [Vocab::skill,  "icon", Zii::SKILL,  true]
    s3 = [Vocab::guard,  "icon", Zii::GUARD,  true]
    s4 = [Vocab::item,   "icon", Zii::ITEM,   true]
    setting = {"R"=>40, "S"=>52, "G"=>"Spin40", "L"=>-12}
    super(72, 356, [s1, s2, s3, s4], setting)
    self.active = false
    set_spin
  end
  def setup(actor)
    @commands[0][2] = Zii::ATTACK
    @commands[1][0] = Vocab::skill
    if actor.weapons[0] != nil
      n = actor.weapons[0].icon_index
      @commands[0][2] = n if n > 0
    end
    @commands[1][0] = actor.class.skill_name if actor.class.skill_name_valid
    self.index = 0
    set_spin
  end
end

class Window_BattleStatus < Window_Selectable
   def initialize
    super(128, 288, 416, 128)
    @column_max = 4
    refresh
    self.active = false
    self.opacity = 0
  end
  def draw_neomemo7_back
    @neomemo7_clear = false
    for index in 0...@item_max
      x = index * 96
      self.contents.clear_rect(x + 72, WLH * 3, 24, 24)
      next unless Zii.battle_face?
      actor = $game_party.members[index]
      next if actor.hp <= 0
      bitmap = Cache.face(actor.face_name)
      rect = Rect.new(0, 0, 22, 22)
      rect.x = actor.face_index % 4 * 96 + 72
      rect.y = actor.face_index / 4 * 96 + 72
      self.contents.blt(x + 72, WLH * 3, bitmap, rect, 192)
    end
  end
   def draw_item(index)
    x = index * 96
    rect = Rect.new(x, 0, 96, 96)
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    actor = $game_party.members[index]
    draw_actor_face(actor, x + 2, 2, 92, 192) if actor.hp > 0 and Zii.battle_face?
    draw_actor_state(actor, x + 72, WLH * 3)
    if Zii.line_name?
      self.contents.font.color = hp_color(actor)
      size = Zii::LINE_SIZE
      self.contents.font.size = size
      self.contents.draw_text(x, WLH * 1 + 20 - size, 80, WLH, actor.name)
      self.contents.font.size = 20
    end
    draw_actor_hp(actor, x, WLH * 2, 80)
    draw_actor_mp(actor, x, WLH * 3, 70)
  end
  def update_cursor
    if @index < 0                   
      self.cursor_rect.empty       
    else                           
      rect = Rect.new(index * 96, 0, 96, 96)
      self.cursor_rect = rect       
    end
  end
end

class Scene_Battle < Scene_Base
   alias :neomemo13_create_info_viewport :create_info_viewport
  def create_info_viewport
    neomemo13_create_info_viewport
    @info_viewport.rect.set(0, 0, 544, 416)
    @status_window.x = 128
    @actor_command_window.x = 4
  end
  alias :neomemo13_update_info_viewport :update_info_viewport
  def update_info_viewport
    ox = @info_viewport.ox
    neomemo13_update_info_viewport
    @info_viewport.ox = ox
  end
  alias :neomemo13_start_party_command_selection :start_party_command_selection
  def start_party_command_selection
    if $game_temp.in_battle
      @party_command_window.visible = true
      @actor_command_window.visible = false
    end
    neomemo13_start_party_command_selection
  end
  alias :neomemo13_update_party_command_selection :update_party_command_selection
  def update_party_command_selection
    return unless @party_command_window.command_movable?
    neomemo13_update_party_command_selection
  end
  alias :neomemo13_start_actor_command_selection :start_actor_command_selection
  def start_actor_command_selection
    neomemo13_start_actor_command_selection
    @party_command_window.visible = false
    @actor_command_window.visible = true
  end
  alias :neomemo13_update_actor_command_selection :update_actor_command_selection
  def update_actor_command_selection
    return unless @actor_command_window.command_movable?
    neomemo13_update_actor_command_selection
  end
  alias :neomemo13_start_target_enemy_selection :start_target_enemy_selection
  def start_target_enemy_selection
    x = @info_viewport.rect.x
    ox = @info_viewport.ox
    neomemo13_start_target_enemy_selection
    @info_viewport.rect.x = x
    @info_viewport.ox = ox
    @target_enemy_window.x = 544 - @target_enemy_window.width
    @target_enemy_window.y = 288
    @info_viewport.rect.width -= @target_enemy_window.width
  end
  alias :neomemo13_end_target_enemy_selection :end_target_enemy_selection
  def end_target_enemy_selection
    x = @info_viewport.rect.x
    ox = @info_viewport.ox
    @info_viewport.rect.width += @target_enemy_window.width
    neomemo13_end_target_enemy_selection
    @info_viewport.rect.x = x
    @info_viewport.ox = ox
  end
  alias :neomemo13_start_target_actor_selection :start_target_actor_selection
  def start_target_actor_selection
    x = @info_viewport.rect.x
    ox = @info_viewport.ox
    neomemo13_start_target_actor_selection
    @target_actor_window.y = 288
    @info_viewport.rect.x = x
    @info_viewport.ox = ox
    @info_viewport.rect.width -= @target_actor_window.width
  end
  alias :neomemo13_end_target_actor_selection :end_target_actor_selection
  def end_target_actor_selection
    x = @info_viewport.rect.x
    ox = @info_viewport.ox
    @info_viewport.rect.width += @target_actor_window.width
    neomemo13_end_target_actor_selection

    @info_viewport.rect.x = x
    @info_viewport.ox = ox
  end
  alias :neomemo13_start_skill_selection :start_skill_selection
  def start_skill_selection
    neomemo13_start_skill_selection
    @skill_window.dispose if @skill_window != nil
    @help_window.dispose if @help_window != nil
    @help_window = Window_LineHelp.new
    @skill_window = Window_Skill.new(8, 64, 528, 216, @active_battler)
    @skill_window.help_window = @help_window
  end
  alias :neomemo13_start_item_selection :start_item_selection
  def start_item_selection
    neomemo13_start_item_selection
    @item_window.dispose if @item_window != nil
    @help_window.dispose if @help_window != nil
    @help_window = Window_LineHelp.new
    @item_window = Window_Item.new(8, 64, 528, 216)
    @item_window.help_window = @help_window
  end
end



A oto obrazek trzeba dać go do do folderu Graphics/System
Spoiler:

Spin40.png


bionicl - Czw 04 Lut, 2010 17:19

A! Już wiem: Robi inny interfejs walki, ale nie jest kompatybilny ze skryptem od Ayene, który dodaje też opcje ekwipunku....

PS. Dodam to dla tych,którzy nie wiedzą, że ten obrazek musi nazywać się "spin40"

Ayene - Czw 04 Lut, 2010 21:23

Teraz po korektach skrypt jest bardzo przydatny :-> Tę opcję ekwipunku można spróbować dodać tylko nie wiem, gdzie ten ekwipunek był (bo chyba to było osobne zamówienie tak?)
bionicl - Czw 04 Lut, 2010 22:11

To bodajże ten:
Spoiler:

# ------------------------------------
# www.ultimateam.pl
# Autor: Ayene
# Data: 15.12.2009
# ------------------------------------

class Window_ActorCommand < Window_Command
def initialize
super(128, [], 1, 5)
self.active = false
self.height = [4 * WLH + 32].max
end

def setup(actor)
s1 = Vocab::attack
s2 = Vocab::skill
s3 = Vocab::guard
s4 = Vocab::item
s5 = Vocab::equip # Ekwipunek
if actor.class.skill_name_valid
s2 = actor.class.skill_name
end
@commands = [s1, s2, s3, s4, s5]
@item_max = 5 # odpowiada ilości komend
refresh
self.index = 0
update
end
end


#--------------------------------------------------------------------------
# Scene_Battle
#--------------------------------------------------------------------------
class Scene_Battle < Scene_Base
def update
super
update_basic(true)
update_info_viewport
if $game_message.visible
@info_viewport.visible = false
@message_window.visible = true
end
unless $game_message.visible
return if judge_win_loss
update_scene_change
if @target_enemy_window != nil
update_target_enemy_selection
elsif @target_actor_window != nil
update_target_actor_selection
elsif @skill_window != nil
update_skill_selection
elsif @item_window != nil
update_item_selection
elsif @party_command_window.active
update_party_command_selection
elsif @actor_command_window.active
update_actor_command_selection
elsif @equip_window != nil
update_equip
else
process_battle_event
process_action
process_battle_event
end
end
end

def update_actor_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
prior_actor
elsif Input.trigger?(Input::C)
case @actor_command_window.index
when 0
Sound.play_decision
@active_battler.action.set_attack
start_target_enemy_selection
when 1
Sound.play_decision
start_skill_selection
when 2
Sound.play_decision
@active_battler.action.set_guard
next_actor
when 3
Sound.play_decision
start_item_selection
when 4 # Ekwipunek
Sound.play_decision
start_equip_selection
end
end
end

def start_equip_selection
@help_window = Window_Help.new
@actor_command_window.active = false
@equip_window = Window_Equip.new(208, 56, @active_battler)
@equip_window.help_window = @help_window
@equip_index=0
@equip_window.index = @equip_index
@equip_status_window = Window_EquipStatus.new(0, 56, @active_battler)
@equip_status_window.active = false
@equip_window.refresh
@equip_window.active = true
create_equip_windows
end

def create_equip_windows
@item_windows = []
for i in 0...5
@item_windows[i] = Window_EquipItem.new(0, 208, 544, 80, @active_battler, i)
@item_windows[i].help_window = @help_window
@item_windows[i].visible = (@equip_index == i)
@item_windows[i].y = 208
@item_windows[i].height = 80
@item_windows[i].active = false
@item_windows[i].index = -1
end
end

def update_equip_windows
for i in 0...5
@item_windows[i].visible = (@equip_window.index == i)
@item_windows[i].update
end
@equip_item_window = @item_windows[@equip_window.index]
end

def update_equip_window
@equip_window.update
end

def update_equip_status_window
if @equip_window.active
@equip_status_window.set_new_parameters(nil, nil, nil, nil)
elsif @equip_item_window.active
temp_actor = @active_battler.clone
temp_actor.change_equip(@equip_window.index, @equip_item_window.item, true)
new_atk = temp_actor.atk
new_def = temp_actor.def
new_spi = temp_actor.spi
new_agi = temp_actor.agi
@equip_status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi)
end
@equip_status_window.update
end

def update_equip
@help_window.update
update_equip_window
update_equip_windows
update_equip_status_window
if @equip_window.active
update_equip_selection
elsif @equip_item_window.active
update_equip_item_selection
end
end

def update_equip_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_equip_selection
elsif Input.trigger?(Input::C)
if @active_battler.fix_equipment
Sound.play_buzzer
else
Sound.play_decision
@equip_window.active = false
@equip_item_window.active = true
@equip_item_window.index = 0
end
end
end

def end_equip_selection
if @equip_window != nil
@equip_window.dispose
@equip_window = nil
@equip_status_window.dispose
@equip_status_window = nil
@help_window.dispose
@help_window = nil
@actor_command_window.active = true
for window in @item_windows
window.dispose
end
end
end

def update_equip_item_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@equip_window.active = true
@equip_item_window.index = -1
@equip_item_window.active = false
elsif Input.trigger?(Input::C)
Sound.play_equip
@active_battler.change_equip(@equip_window.index, @equip_item_window.item)
@equip_window.active = true
@equip_window.refresh
@equip_item_window.active = false
@equip_item_window.index = -1
for equip_item_window in @item_windows
equip_item_window.refresh
end
end
end
end


Ayene - Pią 05 Lut, 2010 20:59

Sprawdź czy działa:
Spoiler:

Kod:
#=================================================
# Autor: Ziifee
# Dodatek ze zmianą Ekwipunku: Ayene
#=================================================

module Zii
# ikona (16 + vertical side - 1)
FIGHT = 132 # walka
ESCAPE = 143 # ucieczka
ATTACK = 1 # atak
GUARD = 52 # obrona
SKILL = 137 # umiejętności
ITEM = 144 # przedmiot
EQUIP = 42 # Ekwipunek

# obrót ("positive" / "reverse")
TURN = "positive"

# buźki ("use" / "")
STATUS_FACE = ""

# wyśwetl ustawienia ( "name" / "")
STATUS_LINE = "name"

# wymiar (VX domyślny 20)
LINE_SIZE = 14

def self.turn_normal?
return false if TURN == "reverse"
return true if TURN == "positive"
return true
end
def self.battle_face?
return true if STATUS_FACE == ""
return false
end
def self.line_name?
return true if STATUS_LINE == "name"
return false
end
end

class Window_Base
def draw_face(face_name, face_index, x, y, size = 96, opacity = 255)
bitmap = Cache.face(face_name)
rect = Rect.new(0, 0, 0, 0)
rect.x = face_index % 4 * 96 + (96 - size) / 2
rect.y = face_index / 4 * 96 + (96 - size) / 2
rect.width = size
rect.height = size
self.contents.blt(x, y, bitmap, rect, opacity)
bitmap.dispose
end
def draw_actor_face(actor, x, y, size = 96, opacity = 255)
draw_face(actor.face_name, actor.face_index, x, y, size, opacity)
end
end

class Window_SpinCommand < Window_Base
attr_reader :index
attr_reader :help_window
def initialize(cx, cy, commands, setting = {})
@radius = setting.has_key?("R") ? setting["R"] : 40
@speed = setting.has_key?("S") ? setting["S"] : 36
@spin_back = setting.has_key?("G") ? setting["G"] : ""
@spin_line = setting.has_key?("L") ? setting["L"] : nil
x, y = cx - @radius - 28, cy - @radius - 28
width = height = @radius * 2 + 56
super(x, y, width, height)
self.opacity = 0
@index = 0
@commands = commands
@spin_right = true
@spin_count = 0
update_cursor
end
def draw_spin_graphic(i, cx, cy)
case command_kind(i)
when "icon"
draw_icon(command_pull(i), cx - 12, cy - 12, command_enabled?(i))
end
end
def refresh
set_spin
end
def draw_item(index, enabled = true)
@commands[index][3] = enabled
set_spin
end
def command_name(index = @index)
return "" if index < 0
name = @commands[index][0]
return name != nil ? name : ""
end
def command_kind(index)
result = @commands[index][1]
return result != nil ? result : ""
end
def command_pull(index)
result = @commands[index][2]
return result != nil ? result : ""
end
def command_enabled?(index)
result = @commands[index][3]
return result != nil ? result : true
end
def set_index(name)
n = -1
for i in 0...@commands.size
n = i if @commands[i][0] == name
end
@index = n if n >= 0
update_cursor
call_update_help
set_spin
end
def index=(index)
@index = index
update_cursor
call_update_help
set_spin
end
def center_x
return contents.width / 2
end
def center_y
return contents.height / 2
end
def item_max
return @commands.size
end
def set_background
return if @spin_back == ""
bitmap = Cache.system(@spin_back)
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(12, 12, bitmap, rect)
end
def set_text
return if @spin_line == nil
y = center_y - WLH / 2 + @spin_line
self.contents.draw_text(center_x - 48, y, 96, WLH, command_name, 1)
end
def angle_size
return (Math::PI * 2 / item_max)
end
def set_spin_count
@spin_count = angle_size * 360 / @speed
set_spin(true)
end
def set_spin(spin = false)
self.contents.clear
set_background
angle = spin ? @speed * @spin_count / 360 : 0
angle = @spin_right ? angle : -angle
for i in 0...item_max
n = (i - @index) * angle_size + angle
cx = @radius * Math.sin(n) + center_x
cy = - @radius * Math.cos(n) + center_y
draw_spin_graphic(i, cx, cy)
end
set_text
end
def update
super
update_cursor
if @spin_count > 0
@spin_count -= 1
set_spin(@spin_count >= 1)
return
end
update_command
end
def command_movable?
return false if @spin_count > 0
return false if (not visible or not active)
return false if (index < 0 or index > item_max or item_max == 0)
return false if (@opening or @closing)
return true
end
def command_right
@index = (@index + 1) % item_max
@spin_right = true
set_spin_count
end
def command_left
@index = (@index - 1 + item_max) % item_max
@spin_right = false
set_spin_count
end
def update_command
if command_movable?
if Input.press?(Input::RIGHT)
Sound.play_cursor
Zii.turn_normal? ? command_right : command_left
end
if Input.press?(Input::LEFT)
Sound.play_cursor
Zii.turn_normal? ? command_left : command_right
end
end
call_update_help
end
def update_cursor
if @index < 0
self.cursor_rect.empty
else
rect = Rect.new(0, 0, 24, 24)
rect.x = center_x - rect.width / 2
rect.y = center_y - rect.height / 2 - @radius
self.cursor_rect = rect
end
end
def help_window=(help_window)
@help_window = help_window
call_update_help
end
def call_update_help
if self.active and @help_window != nil
update_help
end
end
def update_help
end
end

class Window_LineHelp < Window_Base
def initialize
super(-16, 0, 576, WLH + 32)
self.opacity = 0
end
def set_text(text, align = 0)
if text != @text or align != @align
self.contents.clear
back_color = Color.new(0, 0, 0, 80)
self.contents.fill_rect(0, y = 12, contents.width, WLH - y, back_color)
self.contents.font.color = normal_color
self.contents.draw_text(20, 0, self.width - 72, WLH, text, align)
@text = text
@align = align
end
end
end

class Window_PartyCommand < Window_SpinCommand
def initialize
s1 = [Vocab::fight, "icon", Zii::FIGHT, true]
s2 = [Vocab::escape, "icon", Zii::ESCAPE, $game_troop.can_escape]
setting = {"R"=>40, "S"=>52, "G"=>"Spin40", "L"=>-12}
super(72, 356, [s1, s2], setting)
self.active = false
set_spin
end
end


class Window_ActorCommand < Window_SpinCommand
def initialize
s1 = [Vocab::attack, "icon", Zii::ATTACK, true]
s2 = [Vocab::skill, "icon", Zii::SKILL, true]
s3 = [Vocab::guard, "icon", Zii::GUARD, true]
s4 = [Vocab::item, "icon", Zii::ITEM, true]

s5 = [Vocab::equip, "icon", Zii::EQUIP, true]

setting = {"R"=>40, "S"=>52, "G"=>"Spin40", "L"=>-12}
super(72, 356, [s1, s2, s3, s4, s5], setting)
self.active = false
set_spin
end
def setup(actor)
@commands[0][2] = Zii::ATTACK
@commands[1][0] = Vocab::skill
if actor.weapons[0] != nil
n = actor.weapons[0].icon_index
@commands[0][2] = n if n > 0
end
@commands[1][0] = actor.class.skill_name if actor.class.skill_name_valid
self.index = 0
set_spin
end
end

class Window_BattleStatus < Window_Selectable
def initialize
super(128, 288, 416, 128)
@column_max = 4
refresh
self.active = false
self.opacity = 0
end
def draw_neomemo7_back
@neomemo7_clear = false
for index in 0...@item_max
x = index * 96
self.contents.clear_rect(x + 72, WLH * 3, 24, 24)
next unless Zii.battle_face?
actor = $game_party.members[index]
next if actor.hp <= 0
bitmap = Cache.face(actor.face_name)
rect = Rect.new(0, 0, 22, 22)
rect.x = actor.face_index % 4 * 96 + 72
rect.y = actor.face_index / 4 * 96 + 72
self.contents.blt(x + 72, WLH * 3, bitmap, rect, 192)
end
end
def draw_item(index)
x = index * 96
rect = Rect.new(x, 0, 96, 96)
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
actor = $game_party.members[index]
draw_actor_face(actor, x + 2, 2, 92, 192) if actor.hp > 0 and Zii.battle_face?
draw_actor_state(actor, x + 72, WLH * 3)
if Zii.line_name?
self.contents.font.color = hp_color(actor)
size = Zii::LINE_SIZE
self.contents.font.size = size
self.contents.draw_text(x, WLH * 1 + 20 - size, 80, WLH, actor.name)
self.contents.font.size = 20
end
draw_actor_hp(actor, x, WLH * 2, 80)
draw_actor_mp(actor, x, WLH * 3, 70)
end
def update_cursor
if @index < 0
self.cursor_rect.empty
else
rect = Rect.new(index * 96, 0, 96, 96)
self.cursor_rect = rect
end
end
end

class Scene_Battle < Scene_Base
 
  def update
super
update_basic(true)
update_info_viewport
if $game_message.visible
@info_viewport.visible = false
@message_window.visible = true
end
unless $game_message.visible
return if judge_win_loss
update_scene_change
if @target_enemy_window != nil
update_target_enemy_selection
elsif @target_actor_window != nil
update_target_actor_selection
elsif @skill_window != nil
update_skill_selection
elsif @item_window != nil
update_item_selection
elsif @party_command_window.active
update_party_command_selection
elsif @actor_command_window.active
update_actor_command_selection
elsif @equip_window != nil
update_equip
else
process_battle_event
process_action
process_battle_event
end
end
end
 
 
alias :neomemo13_create_info_viewport :create_info_viewport
def create_info_viewport
neomemo13_create_info_viewport
@info_viewport.rect.set(0, 0, 544, 416)
@status_window.x = 128
@actor_command_window.x = 4
end
alias :neomemo13_update_info_viewport :update_info_viewport
def update_info_viewport
ox = @info_viewport.ox
neomemo13_update_info_viewport
@info_viewport.ox = ox
end
alias :neomemo13_start_party_command_selection :start_party_command_selection
def start_party_command_selection
if $game_temp.in_battle
@party_command_window.visible = true
@actor_command_window.visible = false
end
neomemo13_start_party_command_selection
end
alias :neomemo13_update_party_command_selection :update_party_command_selection
def update_party_command_selection
return unless @party_command_window.command_movable?
neomemo13_update_party_command_selection
end
alias :neomemo13_start_actor_command_selection :start_actor_command_selection
def start_actor_command_selection
neomemo13_start_actor_command_selection
@party_command_window.visible = false
@actor_command_window.visible = true
end
alias :neomemo13_update_actor_command_selection :update_actor_command_selection
def update_actor_command_selection
 
if Input.trigger?(Input::B)
Sound.play_cancel
prior_actor
elsif Input.trigger?(Input::C)
case @actor_command_window.index
when 0
Sound.play_decision
@active_battler.action.set_attack
start_target_enemy_selection
when 1
Sound.play_decision
start_skill_selection
when 2
Sound.play_decision
@active_battler.action.set_guard
next_actor
when 3
Sound.play_decision
start_item_selection
when 4 # Ekwipunek
Sound.play_decision
start_equip_selection
end
end 
return unless @actor_command_window.command_movable?
neomemo13_update_actor_command_selection
end

alias :neomemo13_start_target_enemy_selection :start_target_enemy_selection
def start_target_enemy_selection
x = @info_viewport.rect.x
ox = @info_viewport.ox
neomemo13_start_target_enemy_selection
@info_viewport.rect.x = x
@info_viewport.ox = ox
@target_enemy_window.x = 544 - @target_enemy_window.width
@target_enemy_window.y = 288
@info_viewport.rect.width -= @target_enemy_window.width
end
alias :neomemo13_end_target_enemy_selection :end_target_enemy_selection
def end_target_enemy_selection
x = @info_viewport.rect.x
ox = @info_viewport.ox
@info_viewport.rect.width += @target_enemy_window.width
neomemo13_end_target_enemy_selection
@info_viewport.rect.x = x
@info_viewport.ox = ox
end
alias :neomemo13_start_target_actor_selection :start_target_actor_selection
def start_target_actor_selection
x = @info_viewport.rect.x
ox = @info_viewport.ox
neomemo13_start_target_actor_selection
@target_actor_window.y = 288
@info_viewport.rect.x = x
@info_viewport.ox = ox
@info_viewport.rect.width -= @target_actor_window.width
end
alias :neomemo13_end_target_actor_selection :end_target_actor_selection
def end_target_actor_selection
x = @info_viewport.rect.x
ox = @info_viewport.ox
@info_viewport.rect.width += @target_actor_window.width
neomemo13_end_target_actor_selection

@info_viewport.rect.x = x
@info_viewport.ox = ox
end
alias :neomemo13_start_skill_selection :start_skill_selection
def start_skill_selection
neomemo13_start_skill_selection
@skill_window.dispose if @skill_window != nil
@help_window.dispose if @help_window != nil
@help_window = Window_LineHelp.new
@skill_window = Window_Skill.new(8, 64, 528, 216, @active_battler)
@skill_window.help_window = @help_window
end
alias :neomemo13_start_item_selection :start_item_selection
def start_item_selection
neomemo13_start_item_selection
@item_window.dispose if @item_window != nil
@help_window.dispose if @help_window != nil
@help_window = Window_LineHelp.new
@item_window = Window_Item.new(8, 64, 528, 216)
@item_window.help_window = @help_window
end

def start_equip_selection
@help_window = Window_Help.new
@actor_command_window.active = false
@equip_window = Window_Equip.new(208, 56, @active_battler)
@equip_window.help_window = @help_window
@equip_index=0
@equip_window.index = @equip_index
@equip_status_window = Window_EquipStatus.new(0, 56, @active_battler)
@equip_status_window.active = false
@equip_window.refresh
@equip_window.active = true
create_equip_windows
end

def create_equip_windows
@item_windows = []
for i in 0...5
@item_windows[i] = Window_EquipItem.new(0, 208, 544, 80, @active_battler, i)
@item_windows[i].help_window = @help_window
@item_windows[i].visible = (@equip_index == i)
@item_windows[i].y = 208
@item_windows[i].height = 80
@item_windows[i].active = false
@item_windows[i].index = -1
end
end

def update_equip_windows
for i in 0...5
@item_windows[i].visible = (@equip_window.index == i)
@item_windows[i].update
end
@equip_item_window = @item_windows[@equip_window.index]
end

def update_equip_window
@equip_window.update
end

def update_equip_status_window
if @equip_window.active
@equip_status_window.set_new_parameters(nil, nil, nil, nil)
elsif @equip_item_window.active
temp_actor = @active_battler.clone
temp_actor.change_equip(@equip_window.index, @equip_item_window.item, true)
new_atk = temp_actor.atk
new_def = temp_actor.def
new_spi = temp_actor.spi
new_agi = temp_actor.agi
@equip_status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi)
end
@equip_status_window.update
end

def update_equip
@help_window.update
update_equip_window
update_equip_windows
update_equip_status_window
if @equip_window.active
update_equip_selection
elsif @equip_item_window.active
update_equip_item_selection
end
end

def update_equip_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_equip_selection
elsif Input.trigger?(Input::C)
if @active_battler.fix_equipment
Sound.play_buzzer
else
Sound.play_decision
@equip_window.active = false
@equip_item_window.active = true
@equip_item_window.index = 0
end
end
end

def end_equip_selection
if @equip_window != nil
@equip_window.dispose
@equip_window = nil
@equip_status_window.dispose
@equip_status_window = nil
@help_window.dispose
@help_window = nil
@actor_command_window.active = true
for window in @item_windows
window.dispose
end
end
end

def update_equip_item_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@equip_window.active = true
@equip_item_window.index = -1
@equip_item_window.active = false
elsif Input.trigger?(Input::C)
Sound.play_equip
@active_battler.change_equip(@equip_window.index, @equip_item_window.item)
@equip_window.active = true
@equip_window.refresh
@equip_item_window.active = false
@equip_item_window.index = -1
for equip_item_window in @item_windows
equip_item_window.refresh
end
end
end
end


bionicl - Pią 05 Lut, 2010 21:13

Działa, dzięki Ayene :-D
Asantos - Nie 21 Lut, 2010 16:06

skrypt działa (choć nie podoba mi się, że wybieramy z koła a potem i ta pojawia się ramka z tekstem trzeba tu jeszcze popracować) ale kiedy zmieniłem ID ikonek to się nie zmieniły w grze - gdzieś w skrypcie trzeba też je zmienić ktoś wskaże gdzie? (bo ja zmieniłem na początku skryptu


EDIT:
już działa, musiałem nie zapisać czy coś, wstawiam screena może się komuś spodoba :D

http://zapodaj.net/1f3cdc7df39a.jpg.html

Czeliosss - Pon 28 Cze, 2010 09:53

Ja mam mały problem. Gdy wybiorę komendy walk to avatar postaci przechodzi na koło. Jak to naprawić?
Angius - Nie 27 Mar, 2011 13:49

A dałoby radę przerobić to pod jednego gracza? Bo z reguły właśnie pojedyńczy bohater występuje w moich grach, a takie wybieranie (jakie wybieranie, tylko jeden bohater jest!) za każdym razem jest mi niepotrzebne.
Angius - Sro 13 Kwi, 2011 14:34

Tak, jak najbardziej aktualny. Zresztą i w sprawie RM przy walce, jak i klasycznego RM (RingMenu).
Ayene - Czw 14 Kwi, 2011 22:41

Żeby wyłączyć opcję wybierania postaci, np. przy używaniu Potiona wystarczy zrobić tak... (jedna z opcji):
Wejdź w 'Scene_Battle" i znajdź:
Kod:
def start_target_actor_selection   
    @target_actor_window = Window_BattleStatus.new
    @target_actor_window.index = 0
    @target_actor_window.active = true
    @target_actor_window.y = @info_viewport.rect.y
    @info_viewport.rect.x += @target_actor_window.width
    @info_viewport.ox += @target_actor_window.width
    @actor_command_window.active = false
  end

zamień na:
Kod:
def start_target_actor_selection
    @active_battler.action.target_index = 0     
    end_skill_selection
    end_item_selection
    next_actor
  end

następnie znajdź i usuń fragment:
Kod:
elsif @target_actor_window != nil
      update_target_actor_selection     # Select target actor

Wejdź w skrypt z RingMenu podczas walki, znajdź i usuń fragment:
Spoiler:

Kod:
alias :neomemo13_start_target_actor_selection :start_target_actor_selection
  def start_target_actor_selection
    x = @info_viewport.rect.x
    ox = @info_viewport.ox
    neomemo13_start_target_actor_selection
    @target_actor_window.y = 288
    @info_viewport.rect.x = x
    @info_viewport.ox = ox
    @info_viewport.rect.width -= @target_actor_window.width
  end
  alias :neomemo13_end_target_actor_selection :end_target_actor_selection
  def end_target_actor_selection
    x = @info_viewport.rect.x
    ox = @info_viewport.ox
    @info_viewport.rect.width += @target_actor_window.width
    neomemo13_end_target_actor_selection

    @info_viewport.rect.x = x
    @info_viewport.ox = ox
  end


Angius - Pią 15 Kwi, 2011 15:22

Wszystko ślicznie działa, dzięki Ayene :)
Czy analogicznie można zrobić ze zwykłym RingMenu?

SilverPresents - Sob 29 Paź, 2011 18:30

dawidos989, wcale ten skrypt nie działa przetestowałem go
Angius - Sob 29 Paź, 2011 18:33

To już drugi temat, w którym piszesz, że skrypt nie działa. Co najciekawsze, ja używam go z powodzeniem. Opisz problem, jeśli nie, potraktujemy to jako prowokację. Następna skończy się nagrodą.
Qpiter13 - Pon 23 Kwi, 2012 21:38

gdzie wkleic te skrypty? napiszcie mi jakos wiadomoscia bardzo pris
Abercjusz - Wto 24 Kwi, 2012 07:47

Qpiter13, wklej je nad main do edytora skryptów.
1.Otwórz edytor.
2.Kliknij prawym przyciskiem myszy na "new materials insert here".
3.Kliknij "wstaw".
4.Tam wklej skrypt.
5.Ciesz się skryptem :->

Aesen - Wto 24 Kwi, 2012 11:55

Tu masz http://www.ultimateam.pl/viewtopic.php?t=1896

Powered by phpBB modified by Przemo © 2003 phpBB Group