Le Deal du moment : -50%
-50% Baskets Nike Air Huarache
Voir le deal
64.99 €

Aller en bas
Naru'
Naru'
Membre

Nombre de messages : 97
Age : 28
Localisation : Dans le nord
Distinction : Voleur de nounours rose
[Coco']
Date d'inscription : 08/03/2009

[VX] "Stack Level to Deep" : J'en ai marre ! Empty [VX] "Stack Level to Deep" : J'en ai marre !

Jeu 23 Avr 2009 - 11:42
Salut,
Voila mon probleme, c'est dans le script Game_Actor et c'est en rapport avec le script ABS 1.0 de Vlad :

[VX] "Stack Level to Deep" : J'en ai marre ! Scre-1135251004385

[VX] "Stack Level to Deep" : J'en ai marre ! Scre-1135273003933

Merci de votre aide.
Coco'
Coco'
Staffeux retraité

Nombre de messages : 6578
Age : 30
Localisation : Nord/Douai
Distinction : EL DICTATOR COCO'
Coco-Dieu en puissance

[VX] "Stack Level to Deep" : J'en ai marre ! Magikarpe Grand gourou suppléant de la secte des MAGIKARP
Leader charismatique des 2beStaffieux

N°1 du forum
Président, vice-présidents et membres honoraires de la cour suprême du forum
Président de l'association des grosses distinctions CMB
Date d'inscription : 02/07/2008
https://www.rpgmakervx-fr.com

[VX] "Stack Level to Deep" : J'en ai marre ! Empty Re: [VX] "Stack Level to Deep" : J'en ai marre !

Jeu 23 Avr 2009 - 12:55
Mets le script qui pose problème en entier s'il te plaît Smile
Naru'
Naru'
Membre

Nombre de messages : 97
Age : 28
Localisation : Dans le nord
Distinction : Voleur de nounours rose
[Coco']
Date d'inscription : 08/03/2009

[VX] "Stack Level to Deep" : J'en ai marre ! Empty Re: [VX] "Stack Level to Deep" : J'en ai marre !

Jeu 23 Avr 2009 - 13:52
Game_Actor :

Code:
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader  :name                    # name
  attr_reader  :character_name          # character graphic filename
  attr_reader  :character_index          # character graphic index
  attr_reader  :face_name                # face graphic filename
  attr_reader  :face_index              # face graphic index
  attr_reader  :class_id                # class ID
  attr_reader  :weapon_id                # weapon ID
  attr_reader  :armor1_id                # shield ID
  attr_reader  :armor2_id                # helmet ID
  attr_reader  :armor3_id                # body armor ID
  attr_reader  :armor4_id                # accessory ID
  attr_reader  :level                    # level
  attr_reader  :exp                      # experience
  attr_accessor :last_skill_id            # for cursor memory: Skill
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    actor_id : actor ID
  #--------------------------------------------------------------------------
  def initialize(actor_id)
    super()
    setup(actor_id)
    @last_skill_id = 0
  end
  #--------------------------------------------------------------------------
  # * Setup
  #    actor_id : actor ID
  #--------------------------------------------------------------------------
  def setup(actor_id)
    actor = $data_actors[actor_id]
    @actor_id = actor_id
    @name = actor.name
    @character_name = actor.character_name
    @character_index = actor.character_index
    @face_name = actor.face_name
    @face_index = actor.face_index
    @class_id = actor.class_id
    @weapon_id = actor.weapon_id
    @armor1_id = actor.armor1_id
    @armor2_id = actor.armor2_id
    @armor3_id = actor.armor3_id
    @armor4_id = actor.armor4_id
    @level = actor.initial_level
    @exp_list = Array.new(101)
    make_exp_list
    @exp = @exp_list[@level]
    @skills = []
    for i in self.class.learnings
      learn_skill(i.skill_id) if i.level <= @level
    end
    clear_extra_values
    recover_all
  end
  #--------------------------------------------------------------------------
  # * Determine if Actor or Not
  #--------------------------------------------------------------------------
  def actor?
    return true
  end
  #--------------------------------------------------------------------------
  # * Get Actor ID
  #--------------------------------------------------------------------------
  def id
    return @actor_id
  end
  #--------------------------------------------------------------------------
  # * Get Index
  #--------------------------------------------------------------------------
  def index
    return $game_party.members.index(self)
  end
  #--------------------------------------------------------------------------
  # * Get Actor Object
  #--------------------------------------------------------------------------
  def actor
    return $data_actors[@actor_id]
  end
  #--------------------------------------------------------------------------
  # * Get Class Object
  #--------------------------------------------------------------------------
  def class
    return $data_classes[@class_id]
  end
  #--------------------------------------------------------------------------
  # * Get Skill Object Array
  #--------------------------------------------------------------------------
  def skills
    result = []
    for i in @skills
      result.push($data_skills[i])
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Get Weapon Object Array
  #--------------------------------------------------------------------------
  def weapons
    result = []
    result.push($data_weapons[@weapon_id])
    if two_swords_style
      result.push($data_weapons[@armor1_id])
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Get Armor Object Array
  #--------------------------------------------------------------------------
  def armors
    result = []
    unless two_swords_style
      result.push($data_armors[@armor1_id])
    end
    result.push($data_armors[@armor2_id])
    result.push($data_armors[@armor3_id])
    result.push($data_armors[@armor4_id])
    return result
  end
  #--------------------------------------------------------------------------
  # * Get Equipped Item Object Array
  #--------------------------------------------------------------------------
  def equips
    return weapons + armors
  end
  #--------------------------------------------------------------------------
  # * Calculate Experience
  #--------------------------------------------------------------------------
  def make_exp_list
    @exp_list[1] = @exp_list[100] = 0
    m = actor.exp_basis
    n = 0.75 + actor.exp_inflation / 200.0;
    for i in 2..99
      @exp_list[i] = @exp_list[i-1] + Integer(m)
      m *= 1 + n;
      n *= 0.9;
    end
  end
  #--------------------------------------------------------------------------
  # * Get Element Change Value
  #    element_id : element ID
  #--------------------------------------------------------------------------
  def element_rate(element_id)
    rank = self.class.element_ranks[element_id]
    result = [0,200,150,100,50,0,-100][rank]
    for armor in armors.compact
      result /= 2 if armor.element_set.include?(element_id)
    end
    for state in states
      result /= 2 if state.element_set.include?(element_id)
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Get Added State Success Rate
  #    state_id : state ID
  #--------------------------------------------------------------------------
  def state_probability(state_id)
    if $data_states[state_id].nonresistance
      return 100
    else
      rank = self.class.state_ranks[state_id]
      return [0,100,80,60,40,20,0][rank]
    end
  end
  #--------------------------------------------------------------------------
  # * Determine if State is Resisted
  #    state_id : state ID
  #--------------------------------------------------------------------------
  def state_resist?(state_id)
    for armor in armors.compact
      return true if armor.state_set.include?(state_id)
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Get Normal Attack Element
  #--------------------------------------------------------------------------
  def element_set
    result = []
    if weapons.compact == []
      return [1]                  # Unarmed: melee attribute
    end
    for weapon in weapons.compact
      result |= weapon == nil ? [] : weapon.element_set
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Get Additional Effect of Normal Attack (state change)
  #--------------------------------------------------------------------------
  def plus_state_set
    result = []
    for weapon in weapons.compact
      result |= weapon == nil ? [] : weapon.state_set
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Get Maximum HP Limit
  #--------------------------------------------------------------------------
  def maxhp_limit
    return 9999
  end
  #--------------------------------------------------------------------------
  # * Get Basic Maximum HP
  #--------------------------------------------------------------------------
  def base_maxhp
    return actor.parameters[1, @level]
  end
  #--------------------------------------------------------------------------
  # * Get basic Maximum MP
  #--------------------------------------------------------------------------
  def base_maxmp
    return actor.parameters[2, @level]
  end
  #--------------------------------------------------------------------------
  # * Get Basic Attack
  #--------------------------------------------------------------------------
  def base_atk
    n = actor.parameters[2, @level]
    for item in equips.compact do n += item.atk end
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Defense
  #--------------------------------------------------------------------------
  def base_def
    n = actor.parameters[3, @level]
    for item in equips.compact do n += item.def end
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Spirit
  #--------------------------------------------------------------------------
  def base_spi
    n = actor.parameters[4, @level]
    for item in equips.compact do n += item.spi end
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Agility
  #--------------------------------------------------------------------------
  def base_agi
    n = actor.parameters[5, @level]
    for item in equips.compact do n += item.agi end
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Hit Rate
  #--------------------------------------------------------------------------
  def hit
    if two_swords_style
      n1 = weapons[0] == nil ? 95 : weapons[0].hit
      n2 = weapons[1] == nil ? 95 : weapons[1].hit
      n = [n1, n2].min
    else
      n = weapons[0] == nil ? 95 : weapons[0].hit
    end
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Evasion Rate
  #--------------------------------------------------------------------------
  def eva
    n = 5
    for item in armors.compact do n += item.eva end
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Critical Ratio
  #--------------------------------------------------------------------------
  def cri
    n = 4
    n += 4 if actor.critical_bonus
    for weapon in weapons.compact
      n += 4 if weapon.critical_bonus
    end
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Ease of Hitting
  #--------------------------------------------------------------------------
  def odds
    return 4 - self.class.position
  end
  #--------------------------------------------------------------------------
  # * Get [Dual Wield] Option
  #--------------------------------------------------------------------------
  def two_swords_style
    return actor.two_swords_style
  end
  #--------------------------------------------------------------------------
  # * Get [Fixed Equipment] Option
  #--------------------------------------------------------------------------
  def fix_equipment
    return actor.fix_equipment
  end
  #--------------------------------------------------------------------------
  # * Get [Automatic Battle] Option
  #--------------------------------------------------------------------------
  def auto_battle
    return actor.auto_battle
  end
  #--------------------------------------------------------------------------
  # * Get [Super Guard] Option
  #--------------------------------------------------------------------------
  def super_guard
    return actor.super_guard
  end
  #--------------------------------------------------------------------------
  # * Get [Pharmocology] Option
  #--------------------------------------------------------------------------
  def pharmacology
    return actor.pharmacology
  end
  #--------------------------------------------------------------------------
  # * Get [First attack within turn] weapon option
  #--------------------------------------------------------------------------
  def fast_attack
    for weapon in weapons.compact
      return true if weapon.fast_attack
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Get [Chain attack] weapon option
  #--------------------------------------------------------------------------
  def dual_attack
    for weapon in weapons.compact
      return true if weapon.dual_attack
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Get [Prevent critical] armor option
  #--------------------------------------------------------------------------
  def prevent_critical
    for armor in armors.compact
      return true if armor.prevent_critical
    end
    return false
  end


Dernière édition par Naruzozo le Jeu 23 Avr 2009 - 13:54, édité 1 fois
Naru'
Naru'
Membre

Nombre de messages : 97
Age : 28
Localisation : Dans le nord
Distinction : Voleur de nounours rose
[Coco']
Date d'inscription : 08/03/2009

[VX] "Stack Level to Deep" : J'en ai marre ! Empty Re: [VX] "Stack Level to Deep" : J'en ai marre !

Jeu 23 Avr 2009 - 13:53
Game_Actor (2) :

Code:

 #--------------------------------------------------------------------------
  # * Get [half MP cost] armor option
  #--------------------------------------------------------------------------
  def half_mp_cost
    for armor in armors.compact
      return true if armor.half_mp_cost
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Get [Double Experience] Armor Option
  #--------------------------------------------------------------------------
  def double_exp_gain
    for armor in armors.compact
      return true if armor.double_exp_gain
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Get [Auto HP Recovery] Armor Option
  #--------------------------------------------------------------------------
  def auto_hp_recover
    for armor in armors.compact
      return true if armor.auto_hp_recover
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Get Normal Attack Animation ID
  #--------------------------------------------------------------------------
  def atk_animation_id
    if two_swords_style
      return weapons[0].animation_id if weapons[0] != nil
      return weapons[1] == nil ? 1 : 0
    else
      return weapons[0] == nil ? 1 : weapons[0].animation_id
    end
  end
  #--------------------------------------------------------------------------
  # * Get Normal Attack Animation ID (Dual Wield: Weapon 2)
  #--------------------------------------------------------------------------
  def atk_animation_id2
    if two_swords_style
      return weapons[1] == nil ? 0 : weapons[1].animation_id
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # * Get Experience String
  #--------------------------------------------------------------------------
  def exp_s
    return @exp_list[@level+1] > 0 ? @exp : "-------"
  end
  #--------------------------------------------------------------------------
  # * Get String for Next Level Experience
  #--------------------------------------------------------------------------
  def next_exp_s
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] : "-------"
  end
  #--------------------------------------------------------------------------
  # * Get String for Experience to Next Level
  #--------------------------------------------------------------------------
  def next_rest_exp_s
    return @exp_list[@level+1] > 0 ?
      (@exp_list[@level+1] - @exp) : "-------"
  end
  #--------------------------------------------------------------------------
  # * Change Equipment (designate ID)
  #    equip_type : Equip region (0..4)
  #    item_id    : Weapon ID or armor ID
  #    test      : Test flag (for battle test or temporary equipment)
  #    Used by event commands or battle test preparation.
  #--------------------------------------------------------------------------
  def change_equip_by_id(equip_type, item_id, test = false)
    if equip_type == 0 or (equip_type == 1 and two_swords_style)
      change_equip(equip_type, $data_weapons[item_id], test)
    else
      change_equip(equip_type, $data_armors[item_id], test)
    end
  end
  #--------------------------------------------------------------------------
  # * Change Equipment (designate object)
  #    equip_type : Equip region (0..4)
  #    item      : Weapon or armor (nil is used to unequip)
  #    test      : Test flag (for battle test or temporary equipment)
  #--------------------------------------------------------------------------
  def change_equip(equip_type, item, test = false)
    last_item = equips[equip_type]
    unless test
      return if $game_party.item_number(item) == 0 if item != nil
      $game_party.gain_item(last_item, 1)
      $game_party.lose_item(item, 1)
    end
    item_id = item == nil ? 0 : item.id
    case equip_type
    when 0  # Weapon
      @weapon_id = item_id
      unless two_hands_legal?            # If two hands is not allowed
        change_equip(1, nil, test)        # Unequip from other hand
      end
    when 1  # Shield
      @armor1_id = item_id
      unless two_hands_legal?            # If two hands is not allowed
        change_equip(0, nil, test)        # Unequip from other hand
      end
    when 2  # Head
      @armor2_id = item_id
    when 3  # Body
      @armor3_id = item_id
    when 4  # Accessory
      @armor4_id = item_id
    end
  end
  #--------------------------------------------------------------------------
  # * Discard Equipment
  #    item : Weapon or armor to be discarded.
  #    Used when the "Include Equipment" option is enabled.
  #--------------------------------------------------------------------------
  def discard_equip(item)
    if item.is_a?(RPG::Weapon)
      if @weapon_id == item.id
        @weapon_id = 0
      elsif two_swords_style and @armor1_id == item.id
        @armor1_id = 0
      end
    elsif item.is_a?(RPG::Armor)
      if not two_swords_style and @armor1_id == item.id
        @armor1_id = 0
      elsif @armor2_id == item.id
        @armor2_id = 0
      elsif @armor3_id == item.id
        @armor3_id = 0
      elsif @armor4_id == item.id
        @armor4_id = 0
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Determine if Two handed Equipment
  #--------------------------------------------------------------------------
  def two_hands_legal?
    if weapons[0] != nil and weapons[0].two_handed
      return false if @armor1_id != 0
    end
    if weapons[1] != nil and weapons[1].two_handed
      return false if @weapon_id != 0
    end
    return true
  end
  #--------------------------------------------------------------------------
  # * Determine if Equippable
  #    item : item
  #--------------------------------------------------------------------------
  def equippable?(item)
    if item.is_a?(RPG::Weapon)
      return self.class.weapon_set.include?(item.id)
    elsif item.is_a?(RPG::Armor)
      return false if two_swords_style and item.kind == 0
      return self.class.armor_set.include?(item.id)
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Change Experience
  #    exp  : New experience
  #    show : Level up display flag
  #--------------------------------------------------------------------------
  def change_exp(exp, show)
    last_level = @level
    last_skills = skills
    @exp = [[exp, 9999999].min, 0].max
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      level_up
    end
    while @exp < @exp_list[@level]
      level_down
    end
    @hp = [@hp, maxhp].min
    @mp = [@mp, maxmp].min
    if show and @level > last_level
      display_level_up(skills - last_skills)
    end
  end
  #--------------------------------------------------------------------------
  # * Level Up
  #--------------------------------------------------------------------------
  def level_up
    @level += 1
    for learning in self.class.learnings
      learn_skill(learning.skill_id) if learning.level == @level
    end
  end
  #--------------------------------------------------------------------------
  # * Level Down
  #--------------------------------------------------------------------------
  def level_down
    @level -= 1
  end
  #--------------------------------------------------------------------------
  # * Show Level Up Message
  #    new_skills : Array of newly learned skills
  #--------------------------------------------------------------------------
  def display_level_up(new_skills)
    $game_message.new_page
    text = sprintf(Vocab::LevelUp, @name, Vocab::level, @level)
    $game_message.texts.push(text)
    for skill in new_skills
      text = sprintf(Vocab::ObtainSkill, skill.name)
      $game_message.texts.push(text)
    end
  end
  #--------------------------------------------------------------------------
  # * Get Experience (for the double experience point option)
  #    exp  : Amount to increase experience.
  #    show : Level up display flag
  #--------------------------------------------------------------------------
  def gain_exp(exp, show)
    if double_exp_gain
      change_exp(@exp + exp * 2, show)
    else
      change_exp(@exp + exp, show)
    end
  end
  #--------------------------------------------------------------------------
  # * Change Level
  #    level : new level
  #    show  : Level up display flag
  #--------------------------------------------------------------------------
  def change_level(level, show)
    level = [[level, 99].min, 1].max
    change_exp(@exp_list[level], show)
  end
  #--------------------------------------------------------------------------
  # * Learn Skill
  #    skill_id : skill ID
  #--------------------------------------------------------------------------
  def learn_skill(skill_id)
    unless skill_learn?($data_skills[skill_id])
      @skills.push(skill_id)
      @skills.sort!
    end
  end
  #--------------------------------------------------------------------------
  # * Forget Skill
  #    skill_id : skill ID
  #--------------------------------------------------------------------------
  def forget_skill(skill_id)
    @skills.delete(skill_id)
  end
  #--------------------------------------------------------------------------
  # * Determine if Finished Learning Skill
  #    skill : skill
  #--------------------------------------------------------------------------
  def skill_learn?(skill)
    return @skills.include?(skill.id)
  end
  #--------------------------------------------------------------------------
  # * Determine Usable Skills
  #    skill : skill
  #--------------------------------------------------------------------------
  def skill_can_use?(skill)
    return false unless skill_learn?(skill)
    return super
  end
  #--------------------------------------------------------------------------
  # * Change Name
  #    name : new name
  #--------------------------------------------------------------------------
  def name=(name)
    @name = name
  end
  #--------------------------------------------------------------------------
  # * Change Class ID
  #    class_id : New class ID
  #--------------------------------------------------------------------------
  def class_id=(class_id)
    @class_id = class_id
    for i in 0..4    # Remove unequippable items
      change_equip(i, nil) unless equippable?(equips[i])
    end
  end
  #--------------------------------------------------------------------------
  # * Change Graphics
  #    character_name  : new character graphic filename
  #    character_index : new character graphic index
  #    face_name      : new face graphic filename
  #    face_index      : new face graphic index
  #--------------------------------------------------------------------------
  def set_graphic(character_name, character_index, face_name, face_index)
    @character_name = character_name
    @character_index = character_index
    @face_name = face_name
    @face_index = face_index
  end
  #--------------------------------------------------------------------------
  # * Use Sprites?
  #--------------------------------------------------------------------------
  def use_sprite?
    return false
  end
  #--------------------------------------------------------------------------
  # * Perform Collapse
  #--------------------------------------------------------------------------
  def perform_collapse
    if $game_temp.in_battle and dead?
      @collapse = true
      Sound.play_actor_collapse
    end
  end
  #--------------------------------------------------------------------------
  # * Perform Automatic Recovery (called at end of turn)
  #--------------------------------------------------------------------------
  def do_auto_recovery
    if auto_hp_recover and not dead?
      self.hp += maxhp / 20
    end
  end
  #--------------------------------------------------------------------------
  # * Create Battle Action (for automatic battle)
  #--------------------------------------------------------------------------
  def make_action
    @action.clear
    return unless movable?
    action_list = []
    action = Game_BattleAction.new(self)
    action.set_attack
    action.evaluate
    action_list.push(action)
    for skill in skills
      action = Game_BattleAction.new(self)
      action.set_skill(skill.id)
      action.evaluate
      action_list.push(action)
    end
    max_value = 0
    for action in action_list
      if action.value > max_value
        @action = action
        max_value = action.value
      end
    end
  end
end
Naru'
Naru'
Membre

Nombre de messages : 97
Age : 28
Localisation : Dans le nord
Distinction : Voleur de nounours rose
[Coco']
Date d'inscription : 08/03/2009

[VX] "Stack Level to Deep" : J'en ai marre ! Empty Re: [VX] "Stack Level to Deep" : J'en ai marre !

Jeu 23 Avr 2009 - 13:57
ABS :

Code:
#===================================
# Vlad ABS
#===================================
#--------------------------------------------------------------
# Créditos a Vlad
#--------------------------------------------------------------
# Para Crear un Enemigo, coloca las siguientes anotaciones:
# Enemy ID - donde ID es la ID del enemigo en la base de datos.
# Die X - donde X = 1 o 2 (1 borra el evento de enemigo, 2 pasa al interruptor local 'A')
# Follow - Para que el evento siga al personaje automáticamente.
#--------------------------------------------------------------
# Configuración General
#--------------------------------------------------------------
#--------------------------------------------------------------
# Tecla de Ataque, cambia X por la letra que quieras:
Attack_Button = Input::X
#--------------------------------------------------------------
# Tecla de Habilidad, cambia Y por la letra que quieras:
Skill_Button = {Input::Y => 0}
#--------------------------------------------------------------
# Animación cuando el Héroe sube de Nivel:
LevelUp_Ani = 40
#--------------------------------------------------------------
# Animación de ataque del enemigo, copia Enemy_atk_ani[2] = 13
# y cambia el 2 por la ID del enemigo, y el 13 por la ID de animación.
Enemy_atk_ani = {}
Enemy_atk_ani[2] = 13
#--------------------------------------------------------------

#--------------------------------------------------------------
# Game Character
#--------------------------------------------------------------
class Game_Character
  attr_accessor :hp
  attr_accessor :mp
  attr_accessor :damage
  attr_accessor :critical
  attr_accessor :wait_ataque
  attr_accessor :die
  alias vlad_abs_gchar_initialize initialize
  def initialize
    @hp = 0
    @mp = 0
    @die = 0
    $skill_for_use = 0
    @wait_ataque = 0
    @damage = nil
    @critical = false
    vlad_abs_gchar_initialize
  end 
  def recebe_atk(attacker)
    attacker_status = (attacker.is_a?(Game_Event) ? attacker.enemy_status : $game_actors[1])
    receptor_status = (self.is_a?(Game_Event) ? self.enemy_status : $game_actors[1])
    self.damage = attacker_status.atk - receptor_status.def
    self.damage *= attacker_status.elements_max_rate(attacker_status.element_set)
    self.damage /= 100
    self.damage = 0 if self.damage < 0
    self.critical = (rand(100) < 4)
    self.damage *= 2 if self.critical
    if self.is_a?(Game_Player)
    $game_actors[1].hp -= self.damage
    if $game_actors[1].hp <= 0
      $scene = Scene_Gameover.new
    end
    elsif self.is_a?(Game_Event)
      self.hp -= self.damage
      if self.hp <= 0
        self.animation_id = 88
          $game_actors[1].gain_exp(enemy_status.exp, 1)
          if @die == 1
          self.erase
        elsif @die == 2
          key = [$game_map.map_id, self.id, "A"]
          $game_self_switches[key] = true
          end
          refresh
        end
    end
  end
  def recebe_skl(attacker)
    for key in Skill_Button.keys
    sklid = Skill_Button[key]
    attacker_status = (attacker.is_a?(Game_Event) ? attacker.enemy_status : $game_actors[1])
    receptor_status = (self.is_a?(Game_Event) ? self.enemy_status : $game_actors[1])
    self.damage = $data_skills[sklid].atk_f - receptor_status.def
    self.damage *= attacker_status.elements_max_rate(attacker_status.element_set)
    self.damage /= 100
    self.damage = 0 if self.damage < 0
    self.critical = (rand(100) < 4)
    self.damage *= 2 if self.critical
    attacker_status.mp -= $data_skills[sklid].mp_cost
    if self.is_a?(Game_Player)
    $game_actors[1].hp -= self.damage
    $scene = Scene_Gameover.new if $game_actors[1].hp <= 0
    elsif self.is_a?(Game_Event)
      self.hp -= self.damage
      if self.hp <= 0
          $game_actors[1].gain_exp(enemy_status.exp, 1)
          if @die == 1
          self.erase
        elsif @die == 2
          key = [$game_map.map_id, self.id, "A"]
          $game_self_switches[key] = true
          end
          refresh
        end
    end
  end
end
  def follow_hero(dx, dy)
        sx = @x - dx
        sy = @y - dy
        if sx == 0 and sy == 0
          return
        end
        abs_sx = sx.abs
        abs_sy = sy.abs
        if abs_sx == 0
          sy > 0 ? move_up : move_down
          if not moving? and sx != 0
            sx > 0 ? move_left : move_right
          end
          return
        elsif abs_sy == 0
          sx > 0 ? move_left : move_right
          if not moving? and sy != 0
            sy > 0 ? move_up : move_down
          end
          return
        end
        if abs_sx == abs_sy
          rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
        end
        if abs_sx > abs_sy
          sx > 0 ? move_left : move_right
          if not moving? and sy != 0
            sy > 0 ? move_up : move_down
          end
        else
          sy > 0 ? move_up : move_down
          if not moving? and sx != 0
            sx > 0 ? move_left : move_right
          end
        end
      end
      def raio(dx, dy)
        ax = (@x - dx) ** 2
        ay = (@y - dy) ** 2
        return Math.sqrt(ax + ay)
      end
end

#--------------------------------------------------------------
# Game Event
#--------------------------------------------------------------
class Game_Event < Game_Character
  attr_reader :inimigo
  attr_reader :enemy_status
  alias vlad_abs_gevent_initialize initialize
  alias vlad_abs_gevent_update update
  alias vlad_abs_gevent_refresh refresh
  def initialize(map_id, event)
    @inimigo = false
    @automove = false
    vlad_abs_gevent_initialize(map_id, event)
  end
  def check_com(comentario)
    return false if @list.nil? or @list.size <= 0
    for item in @list
      if item.code == 108 or item.code == 408
        if item.parameters[0].downcase.include?(comentario.downcase)
          return true
        end
      end
    end
  end
  def check_comment(comentario)
    com = comentario.downcase
    return 0 if @list.nil? or @list.size <= 0
    for item in @list
      if item.code == 108 or item.code == 408
        if item.parameters[0].downcase =~ /#{com}[ ]?(\d+)?/
          return $1.to_i
        end
      end
    end
    return 0
  end
  def update
    vlad_abs_gevent_update
    if @inimigo
      new_x = (@x + (@direction == 4 ? -1 : @direction == 6 ? 1 : 0))
      new_y = (@y + (@direction == 8 ? -1 : @direction == 2 ? 1 : 0))
      if self.wait_ataque > 0
        self.wait_ataque -= 1
      elsif $game_player.x == new_x and $game_player.y == new_y
        $game_player.recebe_atk(self)
        $game_player.animation_id = self.enemy_atk_animation_id
        $game_player.jump(0,0)
        self.wait_ataque = 60
      end
    end
    if @automove
          unless moving?
            self.follow_hero($game_player.x, $game_player.y)
          end
        end
  end
  def refresh
    vlad_abs_gevent_refresh
    @inimigo = false
    @enemy_id = check_comment("Enemy")
    @automove = true if check_com("Follow") == true
    @die = check_comment("Die")
    if @enemy_id > 0
      @inimigo = true
      @enemy_status = Game_Enemy.new(@enemy_id, @enemy_id)
       self.hp = @enemy_status.maxhp
       self.mp = @enemy_status.maxmp
    end
  end
  def enemy_atk_animation_id
    if Enemy_atk_ani[@enemy_id]
    return (@enemy_status.nil? ? 0 : Enemy_atk_ani[@enemy_id])
  else
    return (@enemy_status.nil? ? 0 : 1)
  end
  end
  def Enemy_atk_ani
    return Enemy_atk_ani
  end
end

#--------------------------------------------------------------
# Game Player
#--------------------------------------------------------------
class Game_Player < Game_Character
  alias vlad_abs_gplayer_update update
  alias vlad_abs_gplayer_refresh refresh
  def update
    vlad_abs_gplayer_update
    if self.wait_ataque > 0
      self.wait_ataque -= 1
    end
  def refresh
    vlad_abs_gplayer_refresh
    self.hp = $game_actors[1].hp
    self.mp = $game_actors[1].mp
  end
    if Input.trigger?(Attack_Button) and self.wait_ataque <= 0
      new_x = (@x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
      new_y = (@y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
      for event in $game_map.events.values
        if event.inimigo
          if event.x == new_x and event.y == new_y
            event.recebe_atk(self)
            event.animation_id = self.player_atk_animation_id
            event.jump(0,0)
            self.wait_ataque = 30
            break
          end
        end
      end
    end
    for key in Skill_Button.keys
    if Input.trigger?(key) and Skill_Button[key] != nil and Skill_Button[key] != 0 and $game_actors[1].mp >= $data_skills[Skill_Button[key]].mp_cost and self.wait_ataque <= 0
      new_x = (@x + ($game_player.direction == 4 ? -1 : $game_player.direction == 6 ? 1 : 0))
      new_y = (@y + ($game_player.direction == 8 ? -1 : $game_player.direction == 2 ? 1 : 0))
      for event in $game_map.events.values
        if event.inimigo
          if event.x == new_x and event.y == new_y
            event.recebe_skl(self)
            event.animation_id = self.player_skl_animation_id
            event.jump(0,0)
            self.wait_ataque = 60
            break
          end
        end
      end
    end
    end
    def player_atk_animation_id
    return ($game_actors[1].nil? ? 0 : $game_actors[1].atk_animation_id)
  end
  def player_skl_animation_id
    for key in Skill_Button.keys
      sklid = Skill_Button[key]
    return ($game_actors[1].nil? ? 0 : $data_skills[sklid].animation_id)
    end
  end
    def Attack_Button
    return Attack_Button
  end
  def Skill_Button
    return Skill_Button
  end
  end
end
Naru'
Naru'
Membre

Nombre de messages : 97
Age : 28
Localisation : Dans le nord
Distinction : Voleur de nounours rose
[Coco']
Date d'inscription : 08/03/2009

[VX] "Stack Level to Deep" : J'en ai marre ! Empty Re: [VX] "Stack Level to Deep" : J'en ai marre !

Jeu 23 Avr 2009 - 13:58
ABS (2) :

Code:

#--------------------------------------------------------------
# Game Actor
#--------------------------------------------------------------
class Game_Actor
  alias vlad_abs_change_exp change_exp
  def change_exp(exp, show)
    last_level = @level
    last_skills = skills
    @exp = [[exp, 9999999].min, 0].max
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      level_up
    end
    while @exp < @exp_list[@level]
      level_down
    end
    @hp = [@hp, maxhp].min
    @mp = [@mp, maxmp].min
    if show and @level > last_level
      show_level_up
    end
    vlad_abs_change_exp(exp,show)
  end
  def show_level_up
    $game_player.animation_id = LevelUp_Ani
    $game_actors[1].hp = $game_actors[1].maxhp
    $game_actors[1].mp = $game_actors[1].maxmp
  end
  def LevelUp_Ani
    return LevelUp_Ani
  end
end

#--------------------------------------------------------------
# Sprite Base
#--------------------------------------------------------------
  class Sprite_Base
  alias animation animation_set_sprites
 def animation_set_sprites(frame)
    cell_data = frame.cell_data
    for i in 0..15
      sprite = @animation_sprites[i]
      next if sprite == nil
      pattern = cell_data[i, 0]
      if pattern == nil or pattern == -1
        sprite.visible = false
        next
      end
      if pattern < 100
        sprite.bitmap = @animation_bitmap1
      else
        sprite.bitmap = @animation_bitmap2
      end
      sprite.visible = true
      sprite.src_rect.set(pattern % 5 * 192,
        pattern % 100 / 5 * 192, 192, 192)
      if @animation_mirror
        sprite.x = @animation_ox - cell_data[i, 1] / 2
        sprite.y = @animation_oy - cell_data[i, 2] / 2
        sprite.angle = (360 - cell_data[i, 4])
        sprite.mirror = (cell_data[i, 5] == 0)
      else
        sprite.x = @animation_ox + cell_data[i, 1] / 2
        sprite.y = @animation_oy + cell_data[i, 2] / 2
        sprite.angle = cell_data[i, 4]
        sprite.mirror = (cell_data[i, 5] == 1)
      end
      sprite.z = self.z + 300
      sprite.ox = 96
      sprite.oy = 96
      sprite.zoom_x = cell_data[i, 3] / 200.0
      sprite.zoom_y = cell_data[i, 3] / 200.0
      sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
      sprite.blend_type = cell_data[i, 7]
    end
  end
end
#--------------------------------------------------------------
# Sprite Character
#--------------------------------------------------------------
class Sprite_Character < Sprite_Base
  alias vlad_abs_spchar_update update
  def initialize(viewport, character = nil)
    super(viewport)
    @character = character
    @balloon_duration = 0
    @_damage_duration = 0
    update
  end
  def update
    super
    if @_damage_duration > 0
      @_damage_duration -=1
        @_damage_sprite.x = self.x
        if @_damage_duration <= 0
          dispose_damage
        end
      end
      if @character != nil and @character.damage != nil
      damage(@character.damage, @character.critical)
      @character.damage = nil
      @character.critical = false
    end
    vlad_abs_spchar_update
  end
def damage(value, critical)
      dispose_damage
      if value.is_a?(Numeric)
        damage_string = value.abs.to_s
      else
        damage_string = value.to_s
      end
      bitmap = Bitmap.new(160, 48)
      bitmap.font.name = "Subtlety"
      bitmap.font.size = 22
      bitmap.font.italic = true
      if value.is_a?(Numeric) and value <= 0
        bitmap.font.color.set(0, 0, 0)
        bitmap.draw_text(1, 13, 160, 36, "Raté", 1)
        bitmap.font.color.set(255, 245, 155)
        bitmap.draw_text(0, 12, 160, 36, "Raté", 1)
      else
        bitmap.font.color.set(0, 0, 0)
        bitmap.draw_text(1, 13, 160, 36, damage_string, 1)
        bitmap.font.color.set(255, 255, 255)
        bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
      end
      if critical
        bitmap.font.color.set(0, 0, 0)
        bitmap.draw_text(1, 6, 160, 20, "Critique !", 1)
        bitmap.font.color.set(255, 245, 155)
        bitmap.draw_text(0, 5, 160, 20, "Critique !", 1)
      end
      @_damage_sprite = ::Sprite.new(self.viewport)
      @_damage_sprite.bitmap = bitmap
      @_damage_sprite.ox = 80
      @_damage_sprite.oy = 20
      @_damage_sprite.x = self.x
      @_damage_sprite.y = self.y - self.oy / 2 - 40
      @_damage_sprite.z += 99999
      @_damage_duration = 30
    end
    def show_text(string, size=16, color=0)
      dispose_damage
      damage_string = string
      if string.is_a?(Array)
        array = true
      else
        array = false
      end
      bitmap = Bitmap.new(160, 48)
      bitmap.font.name = "Subtlety"
      bitmap.font.size = size
      bitmap.font.italic = true
      if array
        for i in 0..string.size
          next if damage_string[i] == nil
          bitmap.font.color.set(96, 96-20, 0) if color == 0
          bitmap.font.color.set(0, 0, 0) if color != 0
          bitmap.draw_text(-1, (12+(16*i)-1)-16, 160, 36, damage_string[i], 1)
          bitmap.draw_text(+1, (12+(16*i)-1)-16, 160, 36, damage_string[i], 1)
          bitmap.draw_text(-1, (12+(16*i)+1)-16, 160, 36, damage_string[i], 1)
          bitmap.draw_text(+1, (12+(16*i)+1)-16, 160, 36, damage_string[i], 1)
          bitmap.font.color.set(255, 245, 155) if color == 0
          bitmap.font.color.set(144, 199, 150) if color == 1
          bitmap.font.color.set(197, 147, 190)if color == 2
          bitmap.font.color.set(138, 204, 198)if color == 3
          bitmap.draw_text(0, (12+(16*i))-16, 160, 36, damage_string[i], 1)
        end
      else
        bitmap.font.color.set(96, 96-20, 0) if color == 0
        bitmap.font.color.set(0, 0, 0) if color != 0
        bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
        bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
        bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
        bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
        bitmap.font.color.set(255, 245, 155) if color == 0
        bitmap.font.color.set(144, 199, 150) if color == 1
        bitmap.font.color.set(197, 147, 190)if color == 2
        bitmap.font.color.set(138, 204, 198)if color == 3
        bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
      end
      @_damage_sprite = ::Sprite.new(self.viewport)
      @_damage_sprite.bitmap = bitmap
      @_damage_sprite.ox = 80
      @_damage_sprite.oy = 20
      @_damage_sprite.x = self.x
      @_damage_sprite.y = self.y - self.oy / 2
      @_damage_sprite.z = 3000
      @_damage_duration = 30
    end
    def dispose_damage
    if @_damage_sprite != nil
      @_damage_sprite.dispose
      @_damage_sprite = nil
    end
  end
end
 
#--------------------------------------------------------------
# Window Skill
#--------------------------------------------------------------
class Scene_Skill
  alias vlad_abs_sskill_initialize initialize
  alias vlad_abs_sskill_update update
  def initialize(actor_index = 0, equip_index = 0)
    @memory = Window_Command.new(150, ["Memorisé !"])
    @memory.active = false
    @memory.visible = false
    @memory.x = (544 - @memory.width) / 2
    @memory.y = (416 - @memory.height) / 2
    @memory.z = 1500
    vlad_abs_sskill_initialize
  end
def update
  update_skill
  @memory.update if @memory.active
  return update_memory if @memory.active
  vlad_abs_sskill_update
end
def update_skill
  for key in Skill_Button.keys
  if Input.trigger?(key)
  Sound.play_decision
  Skill_Button[key] = @skill_window.skill.id
  @memory.active = @memory.visible = true
  @skill_window.active = false
end
end
end
  def update_memory
if Input.trigger?(Input::C)
  Sound.play_decision
  @memory.active = @memory.visible = false
  @skill_window.active = true
end
end
  def Skill_Button
    return Skill_Button
  end
end

#--------------------------------------------------------------
# Fin del ABS
#--------------------------------------------------------------

Désolé pour le quadruple post.
En tout cas, merci beaucoup de m'aider coco-drift.
wilkyo
wilkyo
Membre

Nombre de messages : 316
Age : 32
Localisation : Loiret
Distinction : Sauveur de miches // Chou (l)

[Coco' Smile]

Adepte de Pedobear // Lécheur de lolis

[Mist' Wink]

Personnage Colorée // Instructeur de boulet

[Wax Rolling Eyes]
Date d'inscription : 01/09/2008
http://www.wilkyo.com

[VX] "Stack Level to Deep" : J'en ai marre ! Empty Re: [VX] "Stack Level to Deep" : J'en ai marre !

Jeu 23 Avr 2009 - 14:11
Heu... Je n'ai pas testé tes scripts, mais...
J'ai trouvé quelque chose d'étrange...
Dans ton script de Game_Actor:
Tu as:
Code:
#--------------------------------------------------------------------------
  def base_maxmp
    return actor.parameters[2, @level]
  end
  #--------------------------------------------------------------------------
Alors que dans ton screen, tu as:
Code:
#--------------------------------------------------------------------------
  def base_maxmp
    return actor.parameters[1, @level]
  end
  #--------------------------------------------------------------------------

Le 1 deviens un 2...
Tu ne nous dit pas tout !

Et sinon...
Pourquoi n'essayerais tu pas l'ABS 4.0 (requiem)
Il est beaucoup mieux que celui de vlad...
Peut être que tu n'auras plus de bug avec lui...

Voila le lien.


Dernière édition par wilkyo le Jeu 23 Avr 2009 - 14:15, édité 1 fois
Coco'
Coco'
Staffeux retraité

Nombre de messages : 6578
Age : 30
Localisation : Nord/Douai
Distinction : EL DICTATOR COCO'
Coco-Dieu en puissance

[VX] "Stack Level to Deep" : J'en ai marre ! Magikarpe Grand gourou suppléant de la secte des MAGIKARP
Leader charismatique des 2beStaffieux

N°1 du forum
Président, vice-présidents et membres honoraires de la cour suprême du forum
Président de l'association des grosses distinctions CMB
Date d'inscription : 02/07/2008
https://www.rpgmakervx-fr.com

[VX] "Stack Level to Deep" : J'en ai marre ! Empty Re: [VX] "Stack Level to Deep" : J'en ai marre !

Jeu 23 Avr 2009 - 14:12
Je sais pas si ça vient de là, mais essaye de baisser le nombre de HP de ton héros pour voir (du gars ayant l'ID 1), car stack level too deep veut dire littéralement "Niveau de pile trop profond", sinon je regarde pourquoi ça marche pas Wink

Sinon test le ABS 4.0, il est mieux Wink

EDIT : arg, pwned...
Contenu sponsorisé

[VX] "Stack Level to Deep" : J'en ai marre ! Empty Re: [VX] "Stack Level to Deep" : J'en ai marre !

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum