Conflicting Scripts Yanfly ATB and Mogs Picture CM

Kwerty

Veteran
Veteran
Joined
Feb 22, 2014
Messages
385
Reaction score
616
First Language
English
Primarily Uses
RMMV
I have a problem with what seems to be a script conflict,

Now I'll do my best to describe the problem here.

To sum up in one sentence

"Actor portraits' sits in the middle of the screen while their ATB gauge fills."

-

It is worth noting that at the start of battle, no pictures are shown as the ATB gauges fill up.

-

But once a first picture (bust) has been shown, they should disappear once that actor has taken their turn.

-

While gauges are filling, a picture should not be displayed if the script is working as intended.

-

When the enemy attacks, the picture will slide off the screen to the left and then slide back on following the enemies

move, even if the actor is not ready for a turn according to their ATB gauge.

-

I have tried moving the MH Script to be above the ATB System.

If I move the Moghunter script to be above the Yanfly ATB system in Materials list, then the Mog Hunter CM Script

seems to break completely, it stops showing busts.

I would very much appreciate some help with this,

Here are the scripts and links to them, if you would like to test, please use the scripts in the spoilers

as these are taken direct from my game.

(link to script = http://cobbtocs.co.uk/wp/?p=64 )

This spoiler reveals Fomars ATB/stamina system script designed for compatability with Yanfly ACE Battle system.

=begin
YanFly Compatible Customisable ATB/Stamina Based Battle System Script
by Fomar0153
Version 1.2
----------------------
Notes
----------------------
Requires Yanfly Engine Ace - Ace Battle Engine
Customises the battle system to be similar to
ATB or Stamina based battle systems.
----------------------
Instructions
----------------------
Edit variables in CBS to suit your needs.
The guard status should be set to 2~2 turns.
----------------------
Change Log
----------------------
1.0 -> 1.1 Added CTB related options
           Added the ability to pass a turn
           Added options for turn functionality to be based on time
           or number of actions
           Added the ability to change the bar colours based on states
1.1 -> 1.2 Fixed a bug when escaping using CTB mode
----------------------
Known bugs
----------------------
None
=end

$imported = {} if $imported.nil?
$imported["Fomar0153-CBS"] = true

module CBS

  MAX_STAMINA = 1000
  RESET_STAMINA = true
 
  # If ATB is set to false then the bars won't appear and
  # the pauses where the bars would be filling up are removed
  # effectively turning this into a CTB system
  ATB = true
  SAMINA_GAUGE_NAME = "ATB"
  ENABLE_PASSING = true
  PASSING_COST = 200

  # If TURN_LENGTH is set to 0 then a turn length will be
  # decided on number of actions
  # TURN_LENGTH is number of seconds per turn
  TURN_LENGTH = 3
 
  ESCAPE_COST = 0
  # If reset stamina is set to true then all characters
  # will start with a random amount of stamina capped at
  # the percentage you set.
  # If reset stamina is set to false then this just
  # affects enemies.
  STAMINA_START_PERCENT = 20

  # Default skill cost
  # If you want to customise skill costs do it like this
  # SKILL_COST[skill_id] = cost
  SKILL_COST = []
  SKILL_COST[0] = 1000
  # Attack
  SKILL_COST[1] = 1000
  # Guard
  SKILL_COST[2] = 500
  ITEM_COST = 1000

  # If you prefer to have states handle agility buffs then set STATES_HANDLE_AGI to true
  STATES_HANDLE_AGI = false
  # In the following section mult means the amount you multiply stamina gains by
  # if STATES_HANDLE_AGI is set to true then it is only used to determine bar color
  # with debuffs taking precedence over buffs
  STAMINA_STATES = []
  # Default colour
  STAMINA_STATES[0] = [1,31,32]
  # in the form
  # STAMINA_STATES[sTATE_ID] = [MULT,FILL_COLOUR,EMPTY_COLOR]
  # e.g. Haste
  STAMINA_STATES[10] = [2,4,32]
  # e.g. Stop  
  STAMINA_STATES[11] = [0,8,32]
  # e.g. Slow  
  STAMINA_STATES[12] = [0.5,8,32]

  #--------------------------------------------------------------------------
  # ● New Method stamina_gain
  #--------------------------------------------------------------------------
  def self.stamina_gain(battler)
    return ((2 + [0, battler.agi / 10].max) * self.stamina_mult(battler)).to_i
  end
  #--------------------------------------------------------------------------
  # ● New Method stamina_gain
  #--------------------------------------------------------------------------
  def self.stamina_mult(battler)
    return 1 if STATES_HANDLE_AGI
    mult = STAMINA_STATES[0][0]
    for state in battler.states
      unless STAMINA_STATES[state.id].nil?
        mult *= STAMINA_STATES[state.id][0]
      end
    end
    return mult
  end
  #--------------------------------------------------------------------------
  # ● New Method stamina_gain
  #--------------------------------------------------------------------------
  def self.stamina_colors(battler)
    colors = STAMINA_STATES[0]
    for state in battler.states
      unless STAMINA_STATES[state.id].nil?
        if STAMINA_STATES[state.id][0] < colors[0] or colors[0] == 1
          colors = STAMINA_STATES[state.id]
        end
      end
    end
    return colors
  end
  #--------------------------------------------------------------------------
  # ● New Method stamina_start
  #--------------------------------------------------------------------------
  def self.stamina_start(battler)
    battler.stamina = rand(MAX_STAMINA * STAMINA_START_PERCENT / 100)
  end
end

class Game_BattlerBase
  #--------------------------------------------------------------------------
  # ● New attr_accessor
  #--------------------------------------------------------------------------
  attr_accessor :stamina
  #--------------------------------------------------------------------------
  # ● Aliases initialize
  #--------------------------------------------------------------------------
  alias yf_fomar_cbs_initialize initialize
  def initialize
    yf_fomar_cbs_initialize
    @stamina = 0
  end
  #--------------------------------------------------------------------------
  # ● New Method stamina_rate
  #--------------------------------------------------------------------------
  def stamina_rate
    @stamina.to_f / CBS::MAX_STAMINA
  end
  #--------------------------------------------------------------------------
  # ● New Method stamina_rate
  #--------------------------------------------------------------------------
  def stamina_gain
    return if not movable?
    @stamina = [CBS::MAX_STAMINA, @stamina + CBS.stamina_gain(self)].min
  end
  #--------------------------------------------------------------------------
  # ● New Method stamina_color
  #--------------------------------------------------------------------------
  def stamina_color
    for state in @states
      unless CBS::STAMINA_STATES[state].nil?
        return STAMINA_STATES[state]
      end
    end
    return STAMINA_STATES[0]
  end
end

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ● Rewrote update
  #--------------------------------------------------------------------------
  def update
    super
    if (CBS::ENABLE_PASSING and @actor_command_window.active) and Input.press?:)A)
      command_pass
    end
    if BattleManager.in_turn? and !inputting?
      while @subject.nil? and !CBS::ATB
        process_stamina
      end
      if CBS::ATB
        process_stamina
      end
      process_event
      process_action
    end
    BattleManager.judge_win_loss
  end
  #--------------------------------------------------------------------------
  # ● Rewrote Method update_info_viewport
  #--------------------------------------------------------------------------
  def update_info_viewport
    move_info_viewport(0)   if @party_command_window.active
    move_info_viewport(128) if @actor_command_window.active
    move_info_viewport(64)  if BattleManager.in_turn? and !inputting?
  end
  #--------------------------------------------------------------------------
  # ● New Method inputting?
  #--------------------------------------------------------------------------
  def inputting?
    return @actor_command_window.active || @skill_window.active ||
      @item_window.active || @actor_window.active || @enemy_window.active
  end
  #--------------------------------------------------------------------------
  # ● New Method process_stamina
  #--------------------------------------------------------------------------
  def process_stamina
    @actor_command_window.close
    return if @subject
    BattleManager.advance_turn
    all_battle_members.each do |battler|
      battler.stamina_gain
    end
    @status_window.refresh_stamina
    if @status_window.close?
      @status_window.open
     end
    if BattleManager.escaping?
      $game_party.battle_members.each do |battler|
        if battler.stamina < CBS::MAX_STAMINA
          $game_troop.members.each do |enemy|
            if enemy.stamina == CBS::MAX_STAMINA
              enemy.make_actions
              @subject = enemy
            end
          end
          return
        end
      end
      unless BattleManager.process_escape
        $game_party.battle_members.each do |actor|
          actor.stamina -= CBS::ESCAPE_COST
        end
        BattleManager.set_escaping(false) unless CBS::ATB
      end
    end
    all_battle_members.each do |battler|
      if battler.stamina == CBS::MAX_STAMINA
        battler.make_actions
        @subject = battler
        if @subject.inputable? and battler.is_a?(Game_Actor)
          @actor_command_window.setup(@subject)
          @status_window.index = @subject.index
          BattleManager.set_actor(battler)
        end
        return
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● Rewrote start_party_command_selection Yanfly version
  #--------------------------------------------------------------------------
  def start_party_command_selection
    unless scene_changing?
      refresh_status
      @status_window.unselect
      @status_window.open
      if BattleManager.input_start
        @actor_command_window.close
        @party_command_window.setup
      else
        @party_command_window.deactivate
        turn_start
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● Rewrote start_actor_command_selection
  #--------------------------------------------------------------------------
  def start_actor_command_selection
    @party_command_window.close
    BattleManager.set_escaping(false)
    turn_start
  end
  #--------------------------------------------------------------------------
  # ● Rewrote prior_command Yanfly version
  #--------------------------------------------------------------------------
  def prior_command
    redraw_current_status
    start_party_command_selection
  end
  #--------------------------------------------------------------------------
  # ● Rewrote process_action
  #--------------------------------------------------------------------------
  def process_action
    return if scene_changing?
    if !@subject || !@subject.current_action
      @subject = BattleManager.next_subject
    end
    if Input.trigger?:) B) and (@subject == nil)
      start_party_command_selection
    end
    return unless @subject
    if @subject.current_action
      @subject.current_action.prepare
      if @subject.current_action.valid?
        @status_window.open
        execute_action
      end
      @subject.remove_current_action
      refresh_status
      @log_window.display_auto_affected_status(@subject)
      @log_window.wait_and_clear
    end
    process_action_end unless @subject.current_action
  end
  #--------------------------------------------------------------------------
  # ● Aliases use_item
  #--------------------------------------------------------------------------
  alias cbs_use_item use_item
  def use_item
    cbs_use_item
    @subject.stamina_loss
  end
  #--------------------------------------------------------------------------
  # ● Rewrote turn_end
  #--------------------------------------------------------------------------
  def turn_end
    all_battle_members.each do |battler|
      battler.on_turn_end
      refresh_status
      @log_window.display_auto_affected_status(battler)
      @log_window.wait_and_clear
    end
    #BattleManager.turn_end
    #process_event
    #start_party_command_selection
  end
  #--------------------------------------------------------------------------
  # ● Rewrote command_fight
  #--------------------------------------------------------------------------
  def command_fight
    BattleManager.next_command
    start_actor_command_selection
  end
  #--------------------------------------------------------------------------
  # ● Rewrote command_escape
  #--------------------------------------------------------------------------
  def command_escape
    @party_command_window.close
    BattleManager.set_escaping(true)
    turn_start
  end
  #--------------------------------------------------------------------------
  # ● New method command_pass
  #--------------------------------------------------------------------------
  def command_pass
    BattleManager.actor.stamina -= CBS::pASSING_COST
    BattleManager.clear_actor
    @subject = nil
    turn_start
    @actor_command_window.active = false
    @actor_command_window.close
  end
  #--------------------------------------------------------------------------
  # ● Destroyed next_command
  #--------------------------------------------------------------------------
  def next_command
    @status_window.show
    @actor_command_window.show
    @status_aid_window.hide
  end
end




module BattleManager
  #--------------------------------------------------------------------------
  # ● Rewrote setup
  #--------------------------------------------------------------------------
  def self.setup(troop_id, can_escape = true, can_lose = false)
    init_members
    $game_troop.setup(troop_id)
    @can_escape = can_escape
    @can_lose = can_lose
    make_escape_ratio
    @escaping = false
    @turn_counter = 0
    @actions_per_turn = $game_party.members.size + $game_troop.members.size
    ($game_party.members + $game_troop.members).each do |battler|
      if battler.is_a?(Game_Enemy) or CBS::RESET_STAMINA
        CBS.stamina_start(battler)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● New Method set_escaping
  #--------------------------------------------------------------------------
  def self.set_escaping(escaping)
    @escaping = escaping
  end
  #--------------------------------------------------------------------------
  # ● New Method escaping?
  #--------------------------------------------------------------------------
  def self.escaping?
    return @escaping
  end
  #--------------------------------------------------------------------------
  # ● Rewrote turn_start Yanfly version
  #--------------------------------------------------------------------------
  def self.turn_start
    @phase = :turn
    clear_actor
    $game_troop.increase_turn if $game_troop.turn_count == 0
    @performed_battlers = []
  end
  #--------------------------------------------------------------------------
  # ● New Method set_actor
  #--------------------------------------------------------------------------
  def self.set_actor(actor)
    @actor_index = actor.index
  end
  #--------------------------------------------------------------------------
  # ● New Increase action counter
  #--------------------------------------------------------------------------
  def self.add_action
    return if @actions_per_turn.nil?
    @turn_counter += 1
    if @turn_counter == @actions_per_turn and CBS::TURN_LENGTH == 0
      $game_troop.increase_turn
      SceneManager.scene.turn_end
      @turn_counter = 0
    end
  end
  #--------------------------------------------------------------------------
  # ● New Method advance_turn
  #--------------------------------------------------------------------------
  def self.advance_turn
    return if CBS::TURN_LENGTH == 0
    @turn_counter += 1
    if @turn_counter == 60 * CBS::TURN_LENGTH
      $game_troop.increase_turn
      SceneManager.scene.turn_end
      @turn_counter = 0
    end
  end
end

class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # ● Rewrote on_turn_end
  #--------------------------------------------------------------------------
  def on_turn_end
    @result.clear
    regenerate_all
    update_state_turns
    update_buff_turns
    remove_states_auto(2)
  end
  #--------------------------------------------------------------------------
  # ● New Method on_turn_end
  #--------------------------------------------------------------------------
  def stamina_loss
    if self.actor?
      @stamina -= input.stamina_cost
    else
      @stamina -= @actions[0].stamina_cost
    end
    BattleManager.add_action
  end
end

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● Rewrote input
  #--------------------------------------------------------------------------
  def input
    if @actions[@action_input_index] == nil
      @actions[@action_input_index] = Game_Action.new(self)
    end
    return @actions[@action_input_index]
  end
end

class Game_Action
  #--------------------------------------------------------------------------
  # ● New Method stamina_cost
  #--------------------------------------------------------------------------
  def stamina_cost
    if @item.is_skill?
      return CBS::SKILL_COST[item.id] if CBS::SKILL_COST[item.id]
      return CBS::SKILL_COST[0]
    end
    return CBS::ITEM_COST if @item.is_item?
    return CBS::MAX_STAMINA
  end
end

class Window_BattleStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # Aliases method: draw_item yanfly version
  #--------------------------------------------------------------------------
  alias prefomar_draw_item draw_item
  def draw_item(index)
    unless CBS::ATB
      prefomar_draw_item(index)
      return
    end
    return if index.nil?
    clear_item(index)
    actor = battle_members[index]
    rect = item_rect(index)
    return if actor.nil?
    draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
    draw_actor_name(actor, rect.x, rect.y, rect.width-8)
    draw_actor_action(actor, rect.x, rect.y)
    draw_actor_icons(actor, rect.x, line_height*1, rect.width)
    gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
    contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
    draw_actor_hp(actor, rect.x+2, line_height*2, rect.width-4)
    if draw_tp?(actor) && draw_mp?(actor)
      dw = rect.width/2-2
      dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
      draw_actor_tp(actor, rect.x+2, line_height*2+gx, dw)
      dw = rect.width - rect.width/2 - 2
      draw_actor_mp(actor, rect.x+rect.width/2, line_height*2+gx, dw)
    elsif draw_tp?(actor) && !draw_mp?(actor)
      draw_actor_tp(actor, rect.x+2, line_height*2+gx, rect.width-4)
    else
      draw_actor_mp(actor, rect.x+2, line_height*2+gx, rect.width-4)
    end
    draw_actor_stamina(actor, rect.x+2, line_height*3, rect.width-4)
  end
  #--------------------------------------------------------------------------
  # overwrite method: draw_item yanfly version
  #--------------------------------------------------------------------------
  def draw_item_stamina(index)
    return if index.nil?
    actor = battle_members[index]
    rect = item_rect(index)
    return if actor.nil?
    gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
    contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
    draw_actor_stamina(actor, rect.x+2, line_height*3, rect.width-4)
  end
  #--------------------------------------------------------------------------
  # new method: refresh_stamina
  #--------------------------------------------------------------------------
  def refresh_stamina
    return unless CBS::ATB
    item_max.times {|i| draw_item_stamina(i) }
  end
  #--------------------------------------------------------------------------
  # new method: draw_actor_stamina
  #--------------------------------------------------------------------------
  def draw_actor_stamina(actor, dx, dy, width = 124)
    draw_gauge(dx, dy, width, actor.stamina_rate, text_color(CBS.stamina_colors(actor)[2]),text_color(CBS.stamina_colors(actor)[1]))
    change_color(system_color)
    cy = (Font.default_size - contents.font.size) / 2 + 1
    draw_text(dx+2, dy+cy, 30, line_height, CBS::SAMINA_GAUGE_NAME)
  end
end

I'm also using this fix as the ATB system seemed to have a bug that did not allow the escape ability (leading to crash)

I'll include this snippet although i am 99% sure this is not the issue.

# ATB - Fix for enemy fleeing
class Game_Battler < Game_BattlerBase
  #OVERWRITE
  def stamina_loss
    if self.actor?
      @stamina -= input.stamina_cost
    else
      return if !@actions || !@actions[0]
      @stamina -= @actions[0].stamina_cost
    end
    BattleManager.add_action
  end
end

This second spoiler contains Mog Hunters Picture CM Script and link is here too.

Mog Hunters Picture CM

(link to script http://www.atelier-rgss.com/RGSS/Battle/ACE_BAT09.html)

#==============================================================================
# +++ MOG - ACTOR PICTURE CM  (v1.3) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# Apresenta a imagem do personagem durante a seleção de comandos, com efeitos
# animados.
#==============================================================================
# ● Definindo o nome das imagens dos battlers.
#==============================================================================
# 1 - As imagens devem ser gravadas na pasta
#
# GRAPHICS/PICTURES
#
# 2 - Nomeie os  arquivos de imagens da seguinte forma.
#
#
# ACTOR + ID
#
# EG
#
# ACTOR1.png
#
#==============================================================================

#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 1.3 - Melhoria na codificação.
# v 1.2 - Ajuste automático da imagem do battler.
# v 1.1 - Correção do bug de não apagar a imagem quando o battler usa
#         ações de que acertam todos os alvos.
#==============================================================================

module MOG_ACTOR_PICTURE_CM
  #Posição da imagem do battler. (Para fazer ajustes)
  PICTURE_POSITION = [0, 0]  
 
  #Definição da opacidade da imagem.
  PICTURE_OPACITY = 255
 
  #Velocidade de deslize
  SLIDE_SPEED = 30  
 
  #Ativar o efeito da imagem respirando.
  BREATH_EFFECT = true
 
  #Definição da prioridade  da imagem na tela.
  PICTURE_PRIORITY_Z = 103
end

#===============================================================================
# ■ Sprite_Battler_CM
#===============================================================================
class Sprite_Battler_CM < Sprite
  include MOG_ACTOR_PICTURE_CM
 
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------  
  def initialize(viewport = nil,battler_id = -1)
      super(viewport)
      filename = "Actor" + battler_id.to_s
      self.bitmap = Cache.picture(filename) rescue nil
      self.bitmap = Cache.picture("") if self.bitmap == nil
      sc = (544 / 2)  - (self.bitmap.width / 2) + PICTURE_POSITION[0]
      @size = [self.bitmap.width + PICTURE_POSITION[0] ,sc]      
      self.visible = false
      self.opacity = 0
      self.z = PICTURE_PRIORITY_Z
      self.ox = 0
      self.oy = self.bitmap.height
      self.x = -@size[0]
      self.y = (Graphics.height + -110) + PICTURE_POSITION[1]      
      @breach_effect = [1.0,0]
      @battler_id = battler_id
      @active =  false
      @cm_visible = false
  end  
 
  #--------------------------------------------------------------------------
  # ● Dispose
  #--------------------------------------------------------------------------  
  def dispose
      super
      self.bitmap.dispose
  end
 
  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------  
  def update
      super
      update_slide
  end  
 
  #--------------------------------------------------------------------------
  # ● Active Battler
  #--------------------------------------------------------------------------      
  def active_battler(battler_id)
      @active = @battler_id == battler_id ? true : false
      self.visible = true if @active
      @cm_visible = false if !@active
  end
 
  #--------------------------------------------------------------------------
  # ● Refresh Battler CM
  #--------------------------------------------------------------------------        
  def refresh_battler(cm_visible, battler_index)
      @cm_visible = cm_visible
      active_battler(battler_index)
  end  
 
  #--------------------------------------------------------------------------
  # ● Update Slide
  #--------------------------------------------------------------------------  
  def update_slide
      if !@cm_visible
           self.x -= SLIDE_SPEED if self.x > -@size[0]
           self.opacity -= 25
           if self.x <= -@size[0] or self.opacity == 0
              self.visible = false
              self.opacity = 0
              self.x = -@size[0]
           end   
        else
           self.x += SLIDE_SPEED if self.x < @size[1]
           self.x = @size[1] if self.x > @size[1]
           self.opacity += 10 if self.opacity < PICTURE_OPACITY
           self.opacity = PICTURE_OPACITY if self.opacity > PICTURE_OPACITY
           update_breath_effect
      end         
  end
 
  #--------------------------------------------------------------------------
  # ● Update Breath Effect
  #--------------------------------------------------------------------------    
  def update_breath_effect
      return if !BREATH_EFFECT
      @breach_effect[1] += 1
      case @breach_effect[1]
         when 0..30
             @breach_effect[0] += 0.0004
         when 31..50
             @breach_effect[0] -= 0.0004
         else  
         @breach_effect[1] = 0
         @breach_effect[0] = 1.truncate
      end
      self.zoom_y = @breach_effect[0]
  end  
 
end

#===============================================================================
# ■ Spriteset_Battle
#===============================================================================
class Spriteset_Battle
 
  #--------------------------------------------------------------------------
  # ● Create Actors
  #--------------------------------------------------------------------------    
  alias mog_battler_cm_create_actors create_actors
  def create_actors
      mog_battler_cm_create_actors
      create_battler_pictures
  end
 
  #--------------------------------------------------------------------------
  # ● Dispose
  #--------------------------------------------------------------------------    
  alias mog_battler_cm_dispose dispose
  def dispose
      mog_battler_cm_dispose
      dispose_battler_cm
  end  

  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------    
  alias mog_battler_cm_update update
  def update
      mog_battler_cm_update
      update_battler_cm
  end    

  #--------------------------------------------------------------------------
  # ● Create Battler Pictures
  #--------------------------------------------------------------------------    
  def create_battler_pictures
      @battler_pictures = []
      for i in $game_party.battle_members
          @battler_pictures.push(Sprite_Battler_CM.new(@viewport1,i.id))
      end    
  end   
 
  #--------------------------------------------------------------------------
  # ● Dispose Battler CM
  #--------------------------------------------------------------------------    
  def dispose_battler_cm
      return if @battler_pictures == nil
      @battler_pictures.each {|sprite| sprite.dispose }
  end  
 
  #--------------------------------------------------------------------------
  # ● Update Battler CM
  #--------------------------------------------------------------------------    
  def update_battler_cm
      return if @battler_pictures == nil
      @battler_pictures.each {|sprite| sprite.update }
  end    
     
  #--------------------------------------------------------------------------
  # ● Update CM Pictures
  #--------------------------------------------------------------------------      
  def update_cm_picture(cm_visible, battler_index)
      return if @battler_pictures == nil
      @battler_pictures.each {|sprite| sprite.refresh_battler(cm_visible, battler_index) }
  end  
 
end

#===============================================================================
# ■ Scene_Battle
#===============================================================================
class Scene_Battle < Scene_Base
 
  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------        
  alias mog_cm_picture_update update
  def update
      mog_cm_picture_update  
      update_picture_visible
  end  
 
  #--------------------------------------------------------------------------
  # ● Update Battler CM Active
  #--------------------------------------------------------------------------      
  def update_picture_visible
      return if @actor_command_window == nil
      cm_visible = can_cm_picture_visible?      
      cm_id = BattleManager.actor.id rescue -1
      @spriteset.update_cm_picture(cm_visible, cm_id)
  end  
 
  #--------------------------------------------------------------------------
  # ● Can CM Picture Visible
  #--------------------------------------------------------------------------        
  def can_cm_picture_visible?
      return false if (@actor_window.active or @enemy_window.active) rescue return
      return false if BattleManager.actor == nil      
      return true
  end  
 
  #--------------------------------------------------------------------------
  # ● Execute Action
  #--------------------------------------------------------------------------        
  alias mog_cm_picture_execute_action execute_action
  def execute_action
      @spriteset.update_cm_picture(false, -1) if @spriteset != nil
      mog_cm_picture_execute_action
  end
 
end

$mog_rgss3_actor_picture_cm = true
 

I really want these two scripts to work together, they provide a nice effect for the game!

If you need more info, just request in the post and any help would be greatly appreciated!

Many thanks!
 
Last edited by a moderator:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
first avoid to put the script just past the link

secondly wich battle system did you use a batle system? or just a picture CM

if you don't use picture cm use Moghunter AT system (is a atb)
 

Kwerty

Veteran
Veteran
Joined
Feb 22, 2014
Messages
385
Reaction score
616
First Language
English
Primarily Uses
RMMV
first avoid to put the script just past the link

secondly wich battle system did you use a batle system? or just a picture CM

if you don't use picture cm use Moghunter AT system (is a atb)
Placed my script in spoilers because they are from my project (if i made changes too).

Added the links for ease of use.

Secondly the battle system I'm using is Yanfly Ace Battle Engine.

( Link  )
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
Hum if you the new script of moghunter Battle hud ex it can do the job~ If i remember the script is totally compatible with yanfly
 

Kwerty

Veteran
Veteran
Joined
Feb 22, 2014
Messages
385
Reaction score
616
First Language
English
Primarily Uses
RMMV
Hum if you the new script of moghunter Battle hud ex it can do the job~ If i remember the script is totally compatible with yanfly
Well, would that compatability include the Yanfly ATB system created by Fomar? as this is what i am using.

I didn't want to use the whole Moghunter Battle Hud.

I only wanted to use the Picture CM script.

I'm testing these scripts in a fresh project but hoping someone spots something in one of the codes above that might

be conflicting.
 

Kwerty

Veteran
Veteran
Joined
Feb 22, 2014
Messages
385
Reaction score
616
First Language
English
Primarily Uses
RMMV
Started investigating this script..

Maybe the two scripts are aliasing the same thing?

I've tried moving the scripts around, top to bottom.

When I place the Mog Hunter Picture CM script above the Yanfly ATB System, I lose busts in battle altogether.
 

Kwerty

Veteran
Veteran
Joined
Feb 22, 2014
Messages
385
Reaction score
616
First Language
English
Primarily Uses
RMMV
Adding an unencrypted test version to better emote what the problem is. (see attached)

Essentially actor busts are remaining in-front of enemies, kinda blocking them and only moving to the side

when their turn has been replaced with another Actors turn.

Any help on this one would be awesome!

If you move the MH Bust script to be above the ATB script, you will see that the MH Script breaks,

so I assume there is some conflict between the two, possibly sharing aliases if that makes sense.

Also you will see that the screen is resized to 640x480, please ignore this..

I have included 3 busts for you to review the problem in full.

testing.zip
 

Attachments

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top