Alyon93

Veteran
Veteran
Joined
May 19, 2015
Messages
62
Reaction score
2
First Language
Italian
Primarily Uses
N/A
Hi guys,

I'm new here!

My name is Alyon93. I'm Italian and I'm sorry if my English is poor.

I used RPG Maker for a lot of time, yet until now I never adventured in the script section, so I'm not very used to it.

I'm using Crystal Engine Rows script for my project but for visual purposes only I wanted to add/remove a state to indicate the 2 rows.

I would ask him help since the script is his, but I didn't manage to contact him so far.

The help I need is divided into 2 parts:

1)

I managed to add the states while switching the rows in the menù command, but after I add the second one and remove the first and viceversa, none of them seem to add again like you can see from this screenshots:

Initial:

http://imgur.com/JsrChgG

First change:

http://imgur.com/Szys6cU

Second change:

http://imgur.com/c0TqXD3

Third change:

http://imgur.com/sTLXF0y

How can I fix this?

2)

As you can see from the first screenshot the initial case has no state. The script provide the option for initial row, but I didn't manage to add the state there. I get errors like this:

System stack error occured.

Stack level too deep

Can you see the script(under spoiler) and help me understand how to fix it?

#==============================================================================# Crystal Engine - Rows#------------------------------------------------------------------------------# Current Version: 1.03#==============================================================================$imported ||= {}$imported["CE-Rows"] = true=beginThis script allows you to mimic the row system of the final fantasy series were characters in the front take and deal full damage while charcters in the back take and deal reduced physical damage-------------------------------------------------------------------------------Notetags:ROW CHANGE NOTETAGS ONLY WORKS ON ACTORSActor Notes<row: x> # Sets the row of the actor to x (1 = front, 2 = back)Skill Notes<change front> # Makes the actor move to the front.<change back> # Makes the actor move to the back.<change row> # Makes the actor switch rows.<affected by row> # Factors the row into the damage formulaItem Notes<change front> # Makes the actor move to the front.<change back> # Makes the actor move to the back.<change row> # Makes the actor switch rows.=endmodule CRYSTAL module ROWS #-------------------------------------------------------------------------- # * The adjustment factor for Battle Engine Symphony #-------------------------------------------------------------------------- SYMPHONY_ADJUST = ["32 * (@row - 1)", "0"] #-------------------------------------------------------------------------- # * The modifier for the row reduction #-------------------------------------------------------------------------- ROW_DIVISOR = 2 endend#==============================================================================# Editing beyond this point may cause stone, zombie, mist frenzy, and/or toad,# so edit at your own risk.#==============================================================================#==============================================================================# ** DataManager#------------------------------------------------------------------------------# This module manages the database and game objects. Almost all of the # global variables used by the game are initialized by this module.#==============================================================================module DataManager #-------------------------------------------------------------------------- # * Load Database #-------------------------------------------------------------------------- class <<self; alias load_database_ce_rows load_database; end def self.load_database load_database_ce_rows $data_skills.each do |skill| next if skill.nil? skill.damage.skill_id = skill.id end endend#==============================================================================# ** RPG::Actor#------------------------------------------------------------------------------# The data class for actors.#==============================================================================class RPG::Actor < RPG::BaseItem #-------------------------------------------------------------------------- # * Initial Row the Player is in #-------------------------------------------------------------------------- def initial_row if @note =~ /<ROW: (\d+)>/i return [[$1.to_i, 1].max, 2].min else return 1 end endend#==============================================================================# ** RPG::UsableItem#------------------------------------------------------------------------------# The Superclass of Skill and Item.#==============================================================================class RPG::UsableItem < RPG::BaseItem #-------------------------------------------------------------------------- # * Any row changes #-------------------------------------------------------------------------- def row_change if @note =~ /<CHANGE FRONT>/i return :front elsif @note =~ /<CHANGE BACK>/i return :back elsif @note =~ /<CHANGE ROW>/i return :toggle else return :none end endend#==============================================================================# ** RPG::UsableItem::Damage#------------------------------------------------------------------------------# The data class for damage.#==============================================================================class RPG::UsableItem::Damage #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :skill_id # The skill id for the damage #-------------------------------------------------------------------------- # * Evaluate Damage #-------------------------------------------------------------------------- alias eval_ce_rows_rpg_usableitem_damage eval def eval(a, b, v) value = eval_ce_rows_rpg_usableitem_damage(a, b, v) if @skill_id if $data_skills[@skill_id] if $data_skills[@skill_id].affected_by_row? if (a.actor? && b.enemy?) | (a.enemy? && b.actor?) value /= CRYSTAL::ROWS::ROW_DIVISOR if a.row == 2 value /= CRYSTAL::ROWS::ROW_DIVISOR if b.row == 2 end end end end value endend#==============================================================================# ** RPG::Skill#------------------------------------------------------------------------------# This is the data class for skills.#==============================================================================class RPG::Skill < RPG::UsableItem #-------------------------------------------------------------------------- # * Is the skill affected by the user's row #-------------------------------------------------------------------------- def affected_by_row? @note =~ /<AFFECTED BY ROW>/i endend#==============================================================================# ** Game_Battler#------------------------------------------------------------------------------# A battler class with methods for sprites and actions added. This class # is used as a super class of the Game_Actor class and Game_Enemy class.#==============================================================================class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * Apply Effect of Skill/Item #-------------------------------------------------------------------------- alias item_apply_ce_rows item_apply def item_apply(user, item) item_apply_ce_rows(user, item) if @result.hit? && actor? case item.row_change when :front @row = 1 #actor.remove_state(27) #actor.add_state(26) when :back @row = 2 #actor.remove_state(26) #actor.add_state(27) when :toggle @row == 1 ? @row = 2 : @row = 1 # case $game_party.members[index].row # when 1 # $game_party.members[index].row = 2 # actor = $game_party.members[index] # actor.remove_state(26) # actor.add_state(27) #when 2 # $game_party.members[index].row = 1 #actor = $game_party.members[index] #actor.remove_state(27) #actor.add_state(26) #end end end endend#==============================================================================# ** Game_Actor#------------------------------------------------------------------------------# This class handles actors. It is used within the Game_Actors class# ($game_actors) and is also referenced from the Game_Party class ($game_party).#==============================================================================class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :row # The Battler's Row #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias ce_rows_init_game_actor initialize def initialize(actor_id) ce_rows_init_game_actor(actor_id) @row = actor.initial_row actor = $game_actors[actor_id] actor.add_state(25 + @row) end if $imported[:ve_actor_battlers] #-------------------------------------------------------------------------- # * New method: get_frontal_y #-------------------------------------------------------------------------- alias get_frontal_y_ce_rows get_frontal_y def get_frontal_y get_frontal_y_ce_rows + (32 * (@row - 1)) end #-------------------------------------------------------------------------- # * New method: get_sideview_x #-------------------------------------------------------------------------- alias get_sideview_x_ce_rows get_sideview_x def get_sideview_x get_sideview_x_ce_rows + (32 * (@row - 1)) end #-------------------------------------------------------------------------- # * New method: get_isometric_x #-------------------------------------------------------------------------- alias get_isometric_x_ce_rows get_isometric_x def get_isometric_x get_isometric_x_ce_rows - (32 * (@row - 1)) end #-------------------------------------------------------------------------- # * New method: get_isometric_y #-------------------------------------------------------------------------- alias get_isometric_y_ce_rows get_isometric_y def get_isometric_y get_isometric_y_ce_rows - (32 * (@row - 1)) end end if $imported["YES-BattleSymphony"] #-------------------------------------------------------------------------- # new method: set_default_position #-------------------------------------------------------------------------- alias set_default_position_ce_rows set_default_position def set_default_position set_default_position_ce_rows position = CRYSTAL::ROWS::SYMPHONY_ADJUST @origin_x = @screen_x = @destination_x = @screen_x + eval(position[0]) @origin_y = @screen_y = @destination_y = @screen_y + eval(position[1]) end endend#==============================================================================# ** Game_Enemy#------------------------------------------------------------------------------# This class handles enemies. It used within the Game_Troop class # ($game_troop).#==============================================================================class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :row # The Battler's Row #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias ce_rows_init_game_enemy initialize def initialize(index, enemy_id) ce_rows_init_game_enemy(index, enemy_id) @row = 1 endend#==============================================================================# ** Window_MenuStatus#------------------------------------------------------------------------------# This window displays party member status on the menu screen.#==============================================================================class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # * Draw Actor Face Graphic #-------------------------------------------------------------------------- def draw_actor_face(actor, x, y, enabled = true) draw_face(actor.face_name, actor.face_index, x + (actor.row - 1) * 20, y, enabled) end #-------------------------------------------------------------------------- # * Swap Rows #-------------------------------------------------------------------------- def swap_rows case $game_party.members[index].row when 1 $game_party.members[index].row = 2 actor = $game_party.members[index] actor.remove_state(26) actor.add_state(27) when 2 $game_party.members[index].row = 1 actor = $game_party.members[index] actor.remove_state(27) actor.add_state(26) end refresh endend#==============================================================================# ** Scene_Menu#------------------------------------------------------------------------------# This class performs the menu screen processing.#==============================================================================class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # * [OK] Personal Command #-------------------------------------------------------------------------- alias on_personal_ok_ce_rows on_personal_ok def on_personal_ok on_personal_ok_ce_rows case @command_window.current_symbol when :row @status_window.swap_rows @status_window.activate end endend#==============================================================================# # ? End of File# #==============================================================================
Thanks in advance to whoever is going to read this and help me fix it.

Cheers    :)
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,686
Reaction score
9,861
First Language
German
Primarily Uses
RMMV
I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
 
Last edited by a moderator:

Alyon93

Veteran
Veteran
Joined
May 19, 2015
Messages
62
Reaction score
2
First Language
Italian
Primarily Uses
N/A
So guys I've changed the script since I've noticed that Crystal Engine's one didn't actually change the damage done and loss depending on the row.

I've taken this new one by Ceodore:

Code:
=begin================================================================================ CDR - Rows 1.4 ------------------------------------------------------------------------------- Author: Ceodore Mail: ceodore@email.com https://ceodoremaker.wordpress.com===============================Change log=======================================  07/03/2012 - 1.4 release. Added additional check to apply passive modifiers.  06/03/2013 - 1.3 release. The script was split in 3, this main script and two			   plugins for visual battle support.  05/03/2013 - 1.2 release. Added Victor Engine Actors Battlers support.  05/03/2013 - 1.1 release. Corrected compatibility issue.  05/03/2013 - 1.0 release.  ===============================Description======================================  This implementation is meant to introduce the row mechanics, as in Final  Fantasy IV, V and VI. It allows the player to change the row with the  Formation command on the main menu, like this:  1-The player calls the main menu, then selects Formation;  2-The player selects an actor with confirm button;  3-The player confirms again with the cursor above this same actor to toggle    between front and back row.  On Final Fantasy games, an actor in the back row receives less physical   damage, but also deals less physical damage when attacking with melee weapons.  However, with this script, you can assign modifiers for each kind of damage  (normal, physical and magic), when the target is in the back row. Plus, there  are multipliers for evasion, magic evasion and physical hit ratio.=================================License========================================  You may freely use and modify this script as long as you do not change the  original author information. If you use this on your game, include the author  on the credits.=========================Instalation & Compatibility============================     Insert this script above main and below other scripts.===================================Tags=========================================[Tags to change row behaviour per item]  <long_range>    Put this tag in the note field of items, weapons or skills notes when they are   meant to work as long range attacks. Such attacks will have the row mechanic   reversed, since they work better in the back row.    Notice: The long range tag is viral, as explained below:  - When the actor is equiped with a long range weapon and uses a skill or item    with physical damage, this will be considered as a long range attack.  - When the actor is dual-wielding a long range weapon and a melee weapon, the    attack will be considered as a long range attack.  - When the skill or item is tagged as long range, even if the weapon is not,     this skill or item will be considered as long range.      <force_melee>  Put this tag in the note field of skills and items, so they are not affected  by the long range feature of an equipped weapon.    <ignore_rows>  Put this tag in weapons, skills or items to make then ignore the rows.[Tags to move the user between rows]    <toggle_row>  Put this tag in a skill or item that will toggle the target's row.    <advance>  Put this tag in a skill or item that will make the target advance to the front   row.    <retreat>  Put this tag in a skill or item that will make the target retreat to the back  row.    WARNING: Rows will change through skills and items for actors ONLY.  =================================================================================end$imported = {} if $imported.nil?$imported['CDR-Rows'] = truemodule CDR_ROWS  # Damage multiplier that applies when the battler is in the back row  # and the damage is normal.   # Let this value as 1.0 if you don't wish normal attacks to be affected by   # row mechanics.  NORMAL_MULTIPLIER = 1.0    # Damage multiplier that applies when the battler is in the back row  # and the damage is physical.   # Let this value as 1.0 if you don't wish physical attacks to be affected by   # row mechanics.  PHYSICAL_MULTIPLIER = 0.5    # Damage multiplier that applies when the battler is the in back row  # and the damage is physical.   # Let this value as 1.0 if you don't wish magic attacks to be affected by   # row mechanics.  MAGIC_MULTIPLIER = 1.0    # Hit ratio multiplier that applies when the battler is the in back row  # and the damage is physical.   # Let this value as 1.0 if you don't wish hit ratio of physical stuff to be   # affected by row mechanics.  HIT_MULTIPLIER = 0.8    # Evasion multiplier that applies when the target is the in back row  # and the damage is physical.   # Let this value as 1.0 if you don't wish evasion to be affected by   # row mechanics.  EVA_MULTIPLIER = 1.5    # Magic Evasion multiplier that applies when the target is the in back row  # and the damage is magical.   # Let this value as 1.0 if you don't wish magic evasion to be affected by   # row mechanics.  MEV_MULTIPLIER = 1.0    # This defines an imaginary line that separates front and back row for enemy  # battlers. When an enemy has a screen_x value smaller than this - when   # SideView returns true, or a screen_y   # value smaller than this - when SideView returns false,   # it will be considered as being in the back row.  # Let this value set as 0 if you don't wish the enemies to have this feature.  ENEMY_BACK_LINE = 0    # This is added to actor x position - when SideView returns true,   # or to actor y position - when SideView returns false,   # when that actor is in back row.   # This will only be used when you have a visual plugin installed.  BATTLER_OFFSET = 60    # Icon to display in menu status item if the actor is in front row.  # Let as nil if you don't need it.  #            [icon index, x, y]  FRONT_ICON = nil    # Icon to display in menu status item if the actor is in back row.  # Let as nil if you don't need it.  #            [icon index, x, y]  BACK_ICON =  nil    # FOR ADVANCED USERS  # This value is added to rect.x item position when the the actor is in the   # back row. Needs some menu customization to fully use it, since you will   # need to make the item rect.width smaller than the overall   # status_window.width value plus some cleaning adjustments.  # Let as 0 if you don't need or don't know how to use it.  STATUS_WINDOW_OFFSET = 0              module REGEXP    # DO NOT CHANGE (unless you know what you're doing)    # This defines the regular expression used to identify long range items    LONG_RANGE = /<(?:long_range)>/i        # DO NOT CHANGE (unless you know what you're doing)    # This defines the regular expression used to force melee behaviour on items    FORCE_MELEE = /<(?:force_melee)>/i        # DO NOT CHANGE (unless you know what you're doing)    # This defines the regular expression used to make the item ignore rows    IGNORE_ROWS = /<(?:ignore_rows)>/i        # DO NOT CHANGE (unless you know what you're doing)    # This defines the regular expression used to identify toggle row items    TOGGLE_ROW = /<(?:toggle_row)>/i        # DO NOT CHANGE (unless you know what you're doing)    # This defines the regular expression used to identify front row items    ADVANCE = /<(?:advance)>/i        # DO NOT CHANGE (unless you know what you're doing)    # This defines the regular expression used to identify back row items    RETREAT = /<(?:retreat)>/i  end    # This method searches for the battle side view orientation. Returns false  # by default, change to true if the battle is side view.  def self.SideView        return false  end  end#==============================================================================# DO NOT CHANGE beyond this point, unless you know what you're doing.#==============================================================================#==============================================================================# ** RPG::BaseItem#==============================================================================class RPG::UsableItem  #--------------------------------------------------------------------------  # * new method: long range check  #--------------------------------------------------------------------------  def long_range?    return !(note =~ CDR_ROWS::REGEXP::LONG_RANGE).nil?  end    #--------------------------------------------------------------------------  # * new method: force melee check  #--------------------------------------------------------------------------  def force_melee?    return !(note =~ CDR_ROWS::REGEXP::FORCE_MELEE).nil?  end    #--------------------------------------------------------------------------  # * new method: long range check  #--------------------------------------------------------------------------  def ignore_rows?    return !(note =~ CDR_ROWS::REGEXP::IGNORE_ROWS).nil?  end    #--------------------------------------------------------------------------  # * new method: toggle row check  #--------------------------------------------------------------------------  def toggle_row?    return !(note =~ CDR_ROWS::REGEXP::TOGGLE_ROW).nil?  end    #--------------------------------------------------------------------------  # * new method: toggle row check  #--------------------------------------------------------------------------  def advance?    return !(note =~ CDR_ROWS::REGEXP::ADVANCE).nil?  end    #--------------------------------------------------------------------------  # * new method: toggle row check  #--------------------------------------------------------------------------  def retreat?    return !(note =~ CDR_ROWS::REGEXP::RETREAT).nil?  endend#==============================================================================# ** RPG::BaseItem#==============================================================================class RPG::Weapon  #--------------------------------------------------------------------------  # * new method: long range check  #--------------------------------------------------------------------------  def long_range?    return !(note =~ CDR_ROWS::REGEXP::LONG_RANGE).nil?  end    #--------------------------------------------------------------------------  # * new method: ignore rows check  #--------------------------------------------------------------------------  def ignore_rows?    return !(note =~ CDR_ROWS::REGEXP::IGNORE_ROWS).nil?  endend#==============================================================================# ** Game_Battler#==============================================================================class Game_Battler < Game_BattlerBase  #--------------------------------------------------------------------------  # * new method: checks if back row modifier applies for damage  #--------------------------------------------------------------------------  def multiply_active?(user, item)    ignore_rows = item.ignore_rows?     reverse_effect = item.long_range?    if user.actor?      user.weapons.each{ |w|        reverse_effect = (reverse_effect || w.long_range?)        ignore_rows = (ignore_rows || w.ignore_rows?)      }    end    reverse_effect = false if item.force_melee?        modifier_applies = false    modifier_applies = true if (self.back? or user.back?) and !reverse_effect    modifier_applies = true if (!user.back? and reverse_effect)     modifier_applies = false if ignore_rows    return modifier_applies  end    #--------------------------------------------------------------------------  # * new method: checks if back row modifier applies for passive features  #--------------------------------------------------------------------------  def multiply_passive?(user, item)    multiply_passive = true if (back? or multiply_active?(user, item))    multiply_passive = false  end    #--------------------------------------------------------------------------  # * alias: applies damage multiplier when needed  #--------------------------------------------------------------------------  alias cdr_rows_make_damage_value make_damage_value  def make_damage_value(user, item)      cdr_rows_make_damage_value(user, item)    value = @result.hp_damage    if item.physical?      multiplier = CDR_ROWS::PHYSICAL_MULTIPLIER    elsif item.magical?      multiplier = CDR_ROWS::MAGIC_MULTIPLIER    else      multiplier = CDR_ROWS::NORMAL_MULTIPLIER    end       @result.hp_damage = (value*multiplier).ceil if multiply_active?(user, item)     end    #--------------------------------------------------------------------------  # alias: applies hit modifier when needed  #--------------------------------------------------------------------------  alias cdr_rows_item_hit item_hit  def item_hit(user, item)    rate = cdr_rows_item_hit(user, item)        modifier = CDR_ROWS::HIT_MULTIPLIER    rate *= modifier if item.physical? and multiply_passive?(user, item)    return rate                end  #--------------------------------------------------------------------------  # alias: applies evasion modifier when needed  #--------------------------------------------------------------------------  alias cdr_rows_item_eva item_eva  def item_eva(user, item)    value = cdr_rows_item_eva(user, item)    m = CDR_ROWS::EVA_MULTIPLIER    return value*m if item.physical? and multiply_passive?(user, item)             m = CDR_ROWS::MEV_MULTIPLIER    return value*m if item.magical? and multiply_passive?(user, item)               return value  endend#==============================================================================# ** Game_Actor#==============================================================================class Game_Actor < Game_Battler  #--------------------------------------------------------------------------  # * alias: initializes back variable  #--------------------------------------------------------------------------  alias cdr_rows_initialize initialize  def initialize(actor)    cdr_rows_initialize(actor)    @back = false    $game_party.members[actor].add_state(26)  end    #--------------------------------------------------------------------------  # * new method: changes row  #--------------------------------------------------------------------------  def toggle_row    @back = !back?  #  if @back == true then   #    $game_party.members[actor].remove_state(27)   #    $game_party.members[actor].add_state(26)  # else   #    $game_party.members[actor].remove_state(26)  #    $game_party.members[actor].add_state(27)  #  end  end    #--------------------------------------------------------------------------  # * new method: moves to front row  #--------------------------------------------------------------------------  def advance    @back = false    #$game_party.members[actor].remove_state(27)     #$game_party.members[actor].add_state(26)  end    #--------------------------------------------------------------------------  # * new method: moves to back row  #--------------------------------------------------------------------------  def retreat    @back = true    #$game_party.members[actor].remove_state(26)    #$game_party.members[actor].add_state(27)  end       #--------------------------------------------------------------------------  # * new method: checks for back row flag  #--------------------------------------------------------------------------  def back?    @back  endend#==============================================================================# ** Game_Enemy#==============================================================================class Game_Enemy < Game_Battler  #--------------------------------------------------------------------------  # * new method: checks if the enemy is in back row  #--------------------------------------------------------------------------  def back?        if CDR_ROWS.SideView         back = screen_x < CDR_ROWS::ENEMY_BACK_LINE    else        back = screen_y < CDR_ROWS::ENEMY_BACK_LINE    end    return back    endend#==============================================================================# ** Window_MenuCommand#==============================================================================class Window_MenuCommand < Window_Command  #--------------------------------------------------------------------------  # * method rewrite: let the formation command aways enabled  #--------------------------------------------------------------------------  def add_formation_command    add_command(Vocab::formation, :formation, true)  endend#==============================================================================# ** Scene_Menu#==============================================================================class Scene_Menu < Scene_MenuBase  #--------------------------------------------------------------------------  # * alias: adds the row toggling logic  #--------------------------------------------------------------------------  alias cdr_rows_on_formation_ok on_formation_ok  def on_formation_ok        pi = @status_window.pending_index    if pi >= 0 and pi == @status_window.index           $game_party.menu_actor.toggle_row      @status_window.pending_index = -1      @status_window.redraw_item(@status_window.index)      @status_window.activate    else      cdr_rows_on_formation_ok    end      endend#==============================================================================# ** Window_MenuStatus#==============================================================================class Window_MenuStatus < Window_Selectable  #--------------------------------------------------------------------------  # * alias: changes the item rect conditionally  #--------------------------------------------------------------------------  alias cdr_rows_item_rect item_rect  def item_rect(index, to_clear=false)        actor = $game_party.members[index]    rect = cdr_rows_item_rect(index)        rect.x += CDR_ROWS::STATUS_WINDOW_OFFSET if (actor.back? and !to_clear)    return rect  end    #--------------------------------------------------------------------------  # * method rewrite: inputs additional flag  #--------------------------------------------------------------------------  def clear_item(index)    contents.clear_rect(item_rect(index, true))  end    #--------------------------------------------------------------------------  # * alias: draw respective row icon if needed  #--------------------------------------------------------------------------  alias cdr_rows_draw_item draw_item  def draw_item(index)    cdr_rows_draw_item(index)    rect = item_rect(index)    actor = $game_party.members[index]    icon = CDR_ROWS::FRONT_ICON if (!CDR_ROWS::FRONT_ICON.nil? and !actor.back?)    icon = CDR_ROWS::BACK_ICON if (!CDR_ROWS::BACK_ICON.nil? and actor.back?)    draw_icon(icon[0], rect.x+icon[1], rect.y+icon[2]) if !icon.nil?  endendclass Scene_Battle < Scene_Base  #--------------------------------------------------------------------------  # alias: enables row changing skills and items  #--------------------------------------------------------------------------  alias cdr_rows_apply_item_effects apply_item_effects  def apply_item_effects(target, item)    cdr_rows_apply_item_effects(target, item)    apply_row_change(:toggle)  if item.toggle_row?    apply_row_change(:advance) if item.advance?    apply_row_change(:retreat) if item.retreat?  end    #--------------------------------------------------------------------------  # new method: process row change on during battle  #--------------------------------------------------------------------------  def apply_row_change(type)      targets = @subject.current_action.make_targets      targets = [@subject] if targets.empty?    targets = targets.compact    targets.each{|target|      if target.is_a?(Game_Actor)        case type          when :toggle            target.toggle_row          when :advance            target.advance          when :retreat            target.retreat        end              end    }  endend 
 

Also this one need those changes, at least for my project, so I tried add them by myself, but the Stack Error too Deep keeps showing(line 346, but I guess also the ones after it which now are under comment).

So now the question is, can you help me fix it?
 

Alyon93

Veteran
Veteran
Joined
May 19, 2015
Messages
62
Reaction score
2
First Language
Italian
Primarily Uses
N/A

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,686
Reaction score
9,861
First Language
German
Primarily Uses
RMMV
Stack error too deep means you have either a script two times added (check your empty slots if you have forgotten to name a slot), or you have two scripts that change the same functions in a similiar way and are incompatible to each other, and you'll need to remove one of those two scripts.
 

Jachan

Veteran
Veteran
Joined
May 23, 2015
Messages
94
Reaction score
4
First Language
Sign Language
Primarily Uses
RMMV
Stack error too deep means you have either a script two times added (check your empty slots if you have forgotten to name a slot), or you have two scripts that change the same functions in a similiar way and are incompatible to each other, and you'll need to remove one of those two scripts.
I have that same problem and knew the problem which Yanfly's Barehand Trait is one of them... but the problem, i can't find the function that had been twiced to compare from many scripts i had added for my big project. Is there a quick way to detect the matched functions? Kinda like CTRL + Shift + F (which i did tried but too many lines to check...)?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,686
Reaction score
9,861
First Language
German
Primarily Uses
RMMV
unfortunately no


That is because there are several ways to create such a stack overflow.


One halfway decent option (still a lot of work) is to go to a script, hit crtl-A to select it entirely, then hit crtl-q to completely comment it out.


Then test if the error is solved, if not go to next script and disable it in the same way.


That procedure can be tiresome in case of dependent scripts - the core script have to be disabled last in that case or it would create more errors.


And after you have identified the problematic scripts, you can go to all scripts and ctrl-A ctrl-Q them again.


It's easier than deleting/removing scripts, but still a lot of work.
 

Jachan

Veteran
Veteran
Joined
May 23, 2015
Messages
94
Reaction score
4
First Language
Sign Language
Primarily Uses
RMMV
Oh okay. good idea!

I never thought there is a shortcut to turn script into comment-style... All I did before was just remove and re-run repeatly while if it's not the issue which I re-add that script back in.

Thanks for the shortcut. :D
 

Alyon93

Veteran
Veteran
Joined
May 19, 2015
Messages
62
Reaction score
2
First Language
Italian
Primarily Uses
N/A
But I call the same method in another part of the script and I don't get the error!

That's why I think it's a problem with the way I call it rather than a script conflict.

What would be the standard call for the add_state command? I mean to call it anywhere in any script.
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
651
Reaction score
361
First Language
German
Primarily Uses
Hi,

The system stack error occurs because of this line

actor = $game_actors[actor_id]

within the Game_Actor initialize method.

The initialize method is usually only called during object creation. At this point, the only way to access the object is usually self because it has not been assigned to a variable yet. In this particular case, since the creation process was not yet completed, calling  $game_actors[actor_id]  again causes the game to create yet another instance of this actor and call the initialize method for it.

To access the actor you are already working on, you can simply use the keyword  self .

In this particular case, adding a state in the initialize method does not have any effect because actors are set up after their creation by calling its  setup  method. This method will also reset the actors states. You should therefore add the state during the  setup  method rather than  initialize .

States are automatically removed when they are resisted, the battler dies, flees from battle or is fully recovered ("Recover All" event command).

To automatically add/remove the states after the battler died/revived or a state resistance feature faded you should also extend the battlers  refresh  method and add/remove the particular row states there. This method is called whenever the battlers feature set was changed (exceptions are the "Recover All" event command and single battler flight from battle, which you have to handle separately).

(to be continued tonight - in about 6 hours)
 

Alyon93

Veteran
Veteran
Joined
May 19, 2015
Messages
62
Reaction score
2
First Language
Italian
Primarily Uses
N/A
Wow thanks for those explainations.

Yet I really hope the second part would solve my problems once and for all.

Right now thanks to your tips I was able to add state when switching from the menù, yet I have the same problem (1) that I explained in my first post.

How can I prevent the game to stop adding and removing those states after the first iteration?
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
651
Reaction score
361
First Language
German
Primarily Uses
About the first issue:
The VXAce introduces a feature that states, once they are removed, can't be added again during the same action. To make a state addable again, you have to partially clear the actors current result by calling  actor.result.clear  (clear the result completely) or  actor.result.clear_status_effects  (does only clear state/buff information). Replace the term actor with your actual actor object.

The feature is unique to the VXAce and I'd not be surprised if you could somehow provoke a glitch because the developers forgot about it somewhere themselves. At least after looking around a bit, it seems you actually can:

- Create an event that kills Eric (by reducing his HP by 9999 or add the death state directly)

- Trigger the event to kill Eric

- Go to the menu and revive Eric using a skill or item

- Trigger the event again

- Eric lives :D

By the way: If you want to add the state only because of the visual effect, an alternative would be to extend the actors  state_icons  method and add the index of the icon you want for the current row to the result. Advantages would be that the icon would be displayed even if the actor is dead and you won't have to ensure that the state is reapplied correctly.
 
Last edited by a moderator:

Alyon93

Veteran
Veteran
Joined
May 19, 2015
Messages
62
Reaction score
2
First Language
Italian
Primarily Uses
N/A
Well now this might be much better.

I didn't thought of it.

I'll try this out and let you know.

Thanks for the tips :)

EDIT:Can you write down a simple example on how it should be implemented?

I really don't have any idea right now and I couldn't find a state_icons method...
 
Last edited by a moderator:

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
651
Reaction score
361
First Language
German
Primarily Uses
Thought of something like this:

class Game_Actor  def state_icons    [back? ? 24 : 26] + super  endendThis example should prepend icon 24/26 before the actual state icon list.
 

Alyon93

Veteran
Veteran
Joined
May 19, 2015
Messages
62
Reaction score
2
First Language
Italian
Primarily Uses
N/A
It works!!!

Awesome Another Fen!
Thanks a lot for that!
 

Latest Threads

Latest Posts

Latest Profile Posts

The game's opening, now fully polished! :LZScheeze:





Aaand, here's me working on it in today's "Game Making Every Day" video! :LZSooo:

Hello! Can anyone help me? I followed making cooking tutorial for RPG Maker MV. But for some reason buff state that food gives doesn't work in overworld. It disappears. What am I supposed to do?
A shotgun is not a rifle. Huh.
SIGH its so hard to convince my friend that making a game for fun and making one to sell takes different planning. I don't care about weird bothersome ways of doing things in a game made for fun, but when you are planning to market it, there is some stuff that you just have to streamline or cut out.
It might be a little bit boring and tedious, but building that database of armor, items, weapons and skills are super important.

Forum statistics

Threads
124,399
Messages
1,163,348
Members
163,198
Latest member
Oneesama
Top