Le Deal du moment : -29%
PC portable Gamer ERAZER DEPUTY P60 – ...
Voir le deal
999.99 €

Aller en bas
Nihan78
Nihan78
Membre

Nombre de messages : 33
Distinction : aucune
Date d'inscription : 02/03/2010

Afficher barre HP des monstres au combat (sur le coté) [ résolu ] Empty Afficher barre HP des monstres au combat (sur le coté) [ résolu ]

Mar 30 Mar 2010 - 16:55
Bonjour à tous!

Je voudrai savoir s'il y a ( enfin, il y en a surement^^ ) des scripts permettant d'afficher les PV des monstres pendant le combat. Les combats dans mon projets sont fait sur le coté, c'est à dire que le héro est à droite, et les monstres à gauche. Quelqu'un peut m'aider?


Dernière édition par Nihan78 le Ven 30 Avr 2010 - 21:33, édité 1 fois
Naël
Naël
Membre

Nombre de messages : 558
Age : 27
Localisation : n.f. : repérage, dans l'espace ou dans le temps.
Distinction : aucune
Date d'inscription : 07/02/2010

Afficher barre HP des monstres au combat (sur le coté) [ résolu ] Empty Re: Afficher barre HP des monstres au combat (sur le coté) [ résolu ]

Mar 30 Mar 2010 - 16:59
Il y a des scripts d'affichage des PV de l'ennemi, mais sont-ils compatibles avec le vu de côté ? je n'en sais rien ...

Par contre, ici, les scripts sont en déplacement, il va falloir attendre, je pense ^^
Elphealer
Elphealer
Membre

Nombre de messages : 52
Age : 34
Localisation : Lyon
Distinction : aucune
Date d'inscription : 07/12/2009

Afficher barre HP des monstres au combat (sur le coté) [ résolu ] Empty Re: Afficher barre HP des monstres au combat (sur le coté) [ résolu ]

Jeu 1 Avr 2010 - 16:47
Tiens voilà le script dont je me sers. je sais pas si ça sera compatible.

Code:
#======================================================================
# Jens009's Enemy Hp Window                                         
# Version 1.2                                                       
# Log: July 29, 2008                                               
#    - Version 1.0: Show Enemy Hp Bars
#      August 5, 2008
#    - Version 1.1: Enable On/Off feature Using a $game_system instance
#                  : Enable On/Off feature using an in-game switch
#      August 8, 2008
#    - Version 1.2: Add New Options
#                  : Change Default Window Size
#                  : Add Enemy States
# Rant: [Code Geass ftw]                                           
#  C.C. Still loves Pizza <3                                       
#  Be nice to her Lulu.                                       
#  Oh.. I haven't done my summer homework yet. T_T
#                                                                     
# Credits to:                                                       
#  Jens009 (Translation and Modification)                                           
#  Puppeto4 (Alias tutorial and for bugging me to create a script) 
#      just kidding puppeto =p                                     
# Author's Note:                                                     
# 9 Methods were aliased. Refer to lines 110-118                   
#  4 Were not necessary but was needed so that Enemy Window       
#    was not present during item/skill selections.                 
#                                                                   
#                                                                   
# Modification:                                                     
#  If you want to modify the bars, look @lines 42-72.You can see that
#    I simply took draw_actor_hp and turned it into draw_enemy_hp   
#    This means you can use any bars you desire so long as you define
#    it correctly. =]                                               
#         
#-----------------------------------------------------------------------------
# CONFIG:
#
# I. Turning the Window On of Off during In-Game:
#
#    There are two kinds of switches you can use depending
#    upon your liking. I made it so that you either have a
#    game switch or a script switch that handles the enemy window flag.
#
#  If you want to use a script switch
#    -set USE_GSWITCH to false
#    -Use a call script, $game_system.enemy_window = true/false
#        True = Window Shows up, False = No Enemy Window
#
#  If you want to use a game switch
#    -Set USE_GSWITCH to true
#    -Decide what Game Switch ID you want to use
#        in ENEMY_WINDOW_SWITCH
#    -Use that game switch to check for showing the Enemy Hp Window
#        True = Window Shows up, False = No enemy window.
#
#
#  BY DEFAULT, USE_GSWITCH is false.
#    So you are using a script Switch
#
#  II.  ALWAYS_UPDATE
#        can either be set to true or false.
#        if true, the enemy window always update for every action
#            but the battle system will have more lag.
#        if false, the enemy window only updates at the end of each turn
#            and everytime the battle selection begins.
#        Setting it to false will lower compatibility but should still work
#        for most systems regardless.
#
# III. Spacing X and Y change
#    SPACING_X = Changing this number will change the X spacing of the windows
#    SPACING_Y = Changing this number will change the Y spacing of the windows
# IV. COLUMNS
#    COLUMNS = Draw enemy information by creating 4 columns.
# V. SHOW_STATES
#    if set to true, enemies state will be shown.
#======================================================================
module JCONFIG
  USE_GSWITCH = true      # Setting it to false will use the script
                            #  switch $game_system.enemy_hp instead.
                            # Setting it to true will use an in-game switch
                            #  using the switch ID below.
  ENEMY_WINDOW_SWITCH = 15 # Switch ID that will be used to check
                          # Enemy Window is only ON, when Switch is ON
  ALWAYS_UPDATE = true    # True = window always updates
                            # False = window updates at end of turn
  SPACING_X = 90          # X spacing per enemy info
  SPACING_Y = 44          # Y spacing per enemy info
  COLUMNS = 4            # By default, Do 4 Columns.
  SHOW_STATES = true      # true will show enemies states
                          # false will not show states
                         
end
                     
#======================================================================
# Start Game_System Edit
#======================================================================
class Game_System
  attr_accessor :enemy_hp      # Show enemy HP on battle
 
  alias jens009_system_initialize_enemy_hp initialize
#=============================================
# Initialize Values
#=============================================
  def initialize
    # Initialize enemy hp window to true
    @enemy_hp = true
    # Call previous methods
    jens009_system_initialize_enemy_hp
  end
 
end # END Game system Edit
 

class Window_Base
#====================================
# Define Enemy Name               
#====================================
  def draw_enemy_name(enemy, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text (x, y, 120, 32, enemy.name)
  end
 
#==========================
# Define Enemy State
#========================
  def draw_enemy_state(enemy, x, y)
    count = 0
    for state in enemy.states
      draw_icon(state.icon_index, x + 24 * count, y)
      count += 1
      break if (24 * count > width - 24)
    end
  end
#--------------------------------------------------------------------------
# * Draw Enemy HP
#    actor : actor
#    x    : draw spot x-coordinate
#    y    : draw spot y-coordinate
#    width : Width
#--------------------------------------------------------------------------
  def draw_enemy_hp(enemy, x, y, width = 120)
    draw_enemy_hp_gauge(enemy, x, y, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, enemy.hp, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, enemy.hp, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 44, y, 44, WLH, enemy.maxhp, 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw HP gauge
  #    actor : actor
  #    x    : draw spot x-coordinate
  #    y    : draw spot y-coordinate
  #    width : Width
  #--------------------------------------------------------------------------
  def draw_enemy_hp_gauge(enemy, x, y, width = 120)
    gw = width * enemy.hp / enemy.maxhp
    gc1 = hp_gauge_color1
    gc2 = hp_gauge_color2
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end
 
end #End of Window_Base Class


#=====================================#
# Window_EnemyHP                      #
# Class handles window for Enemy's HP #
#=====================================#
class Window_EnemyHP < Window_Selectable
  def initialize
    super ( 0, 0, 545, 300)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    @column_max = JCONFIG::COLUMNS
    refresh
  end
 
  def refresh
    self.contents.clear
    for i in 0...$game_troop.members.size
      enemy = $game_troop.members[i]
      x = i % @column_max * (JCONFIG::SPACING_X + @spacing)
    if JCONFIG::SHOW_STATES
      y = (i / @column_max * (JCONFIG::SPACING_Y + WLH) )
    else
      y = (i / @column_max * ((JCONFIG::SPACING_Y - 34) + WLH) )
    end
 
      #========================================
      # If Using Game_Switch
      #=========================================
      if JCONFIG::USE_GSWITCH and $game_switches[JCONFIG::ENEMY_WINDOW_SWITCH]
        draw_enemy_hp(enemy, x, y+20, 90)
        draw_enemy_name(enemy, x, y)
        if JCONFIG::SHOW_STATES
        draw_enemy_state(enemy, x, y +44)
        end
      end
      #==========================================
      # If Using script Switch
      #==========================================
      if JCONFIG::USE_GSWITCH == false
        if $game_system.enemy_hp == true # Start check if Window Flag is On
          draw_enemy_hp(enemy, x, y+20, 90)
          draw_enemy_name(enemy, x, y)
          if JCONFIG::SHOW_STATES
          draw_enemy_state(enemy, x, y +44)
          end # END CHECK
        end #End flag check
      end # END game switche check
   
    end
  end #End Refresh

end #End of Window_EnemyHP Class


#====================================#
# Scene_Battle                      #
# New methods that were aliased:    #
#====================================#
class Scene_Battle
 
alias jens009_create_info_viewport create_info_viewport
alias jens009_dispose_info_viewport dispose_info_viewport
alias jens009_start_item_selection start_item_selection
alias jens009_start_skill_selection start_skill_selection
alias jens009_end_item_selection end_item_selection
alias jens009_end_skill_selection end_skill_selection
alias jens009_process_victory process_victory

alias jens009_update_info_viewport update_info_viewport

alias jens009_start_party_command_selection start_party_command_selection
alias jens009_execute_action execute_action
alias jens009_turn_end turn_end

# Create Information
def create_info_viewport
  jens009_create_info_viewport
  @enemy_window = Window_EnemyHP.new
end
# Dispose Information
def dispose_info_viewport
  jens009_dispose_info_viewport
  @enemy_window.dispose
end

#=============================================
# Always Update Window
#============================================
def update_info_viewport
  if JCONFIG::ALWAYS_UPDATE == true
    @enemy_window.refresh
    jens009_update_info_viewport
  else
    jens009_update_info_viewport
  end
end

#=============================================
# Update Only When Turn starts and ends
#============================================
def start_party_command_selection
  if JCONFIG::ALWAYS_UPDATE == true
    jens009_start_party_command_selection
    else
    @enemy_window.visible = true
    @enemy_window.refresh
    jens009_start_party_command_selection
  end
end

def execute_action
  if JCONFIG::ALWAYS_UPDATE == true
    jens009_execute_action
  else
    @enemy_window.visible = false
    jens009_execute_action
  end
end

def turn_end
  if JCONFIG::ALWAYS_UPDATE == true
    jens009_turn_end
  else
    @enemy_window.refresh
    jens009_turn_end
  end
end
#============================================
# END OF UPDATE CHECK
#===========================================

#=====================================
# Remove Window During Selection
def start_item_selection
  @enemy_window.visible = false
  jens009_start_item_selection
end
# Remove Window During Selection
def start_skill_selection
  @enemy_window.visible = false
  jens009_start_skill_selection
end
# True Visibility after slection
def end_item_selection
  jens009_end_item_selection
  @enemy_window.visible = true
end
# True Visibility after selection
def end_skill_selection
  jens009_end_skill_selection
  @enemy_window.visible = true
end
# Refresh When Victorious
def process_victory
  @enemy_window.refresh
  jens009_process_victory
  end

#=====================================#
# End of Scene_Battle Method Edits    #
#=====================================#

end
Nihan78
Nihan78
Membre

Nombre de messages : 33
Distinction : aucune
Date d'inscription : 02/03/2010

Afficher barre HP des monstres au combat (sur le coté) [ résolu ] Empty Re: Afficher barre HP des monstres au combat (sur le coté) [ résolu ]

Sam 3 Avr 2010 - 22:12
Merci beaucoup.
Cependant cela ne fonctionne pas ^^ Ou peut être que je l'ai mal fait, je ne sais pas.

Cela serait dommage de ne pas pouvoir afficher la vie, personne ne peut m'aider?
Elphealer
Elphealer
Membre

Nombre de messages : 52
Age : 34
Localisation : Lyon
Distinction : aucune
Date d'inscription : 07/12/2009

Afficher barre HP des monstres au combat (sur le coté) [ résolu ] Empty Re: Afficher barre HP des monstres au combat (sur le coté) [ résolu ]

Sam 3 Avr 2010 - 22:18
Qu'est ce tu veux dire par ça ne marche pas?

Il affiche rien en plus, ou bien le jeu plante et affiche un message d'erreur?
Djidane
Djidane
Membre

Nombre de messages : 1444
Age : 30
Localisation : Paris
Distinction : Héritier d'Alexdream (mais on l'aime quand même).
Lèche cul professionnel
et il aime ça!!!
Date d'inscription : 30/12/2008

Afficher barre HP des monstres au combat (sur le coté) [ résolu ] Empty Re: Afficher barre HP des monstres au combat (sur le coté) [ résolu ]

Sam 3 Avr 2010 - 22:34
Ta version du SBS est surment trop vieille .

Laquelle version utilise-tu ? Car la mienne afficher les PV des monstres ...
Balbereith
Balbereith
Staffeux retraité

Nombre de messages : 4129
Age : 31
Localisation : dans l'ombre...
Distinction : Péripatéticienne à temps perdu
Helly n°666 [Coco' ;D]
mon ptit balbounet p'tit jardinier en herbe(les râteaux ça le connait) [tonton Adurna]
Cultivateur professionnel de la commu' (il a de bons outils en de nombreux exemplaires Afficher barre HP des monstres au combat (sur le coté) [ résolu ] 522164 ) [Coco' Smile]
Date d'inscription : 13/05/2009

Afficher barre HP des monstres au combat (sur le coté) [ résolu ] Empty Re: Afficher barre HP des monstres au combat (sur le coté) [ résolu ]

Mer 28 Avr 2010 - 18:38
si c'est résolu merci de le mettre dans le titre sinon up ta demande
merci d'avance
Nihan78
Nihan78
Membre

Nombre de messages : 33
Distinction : aucune
Date d'inscription : 02/03/2010

Afficher barre HP des monstres au combat (sur le coté) [ résolu ] Empty Re: Afficher barre HP des monstres au combat (sur le coté) [ résolu ]

Ven 30 Avr 2010 - 21:32
Ok, Je pense que le sujet est résolu maintenant: j'ai pensé à de nouvelles choses^^

Merci.
Balbereith
Balbereith
Staffeux retraité

Nombre de messages : 4129
Age : 31
Localisation : dans l'ombre...
Distinction : Péripatéticienne à temps perdu
Helly n°666 [Coco' ;D]
mon ptit balbounet p'tit jardinier en herbe(les râteaux ça le connait) [tonton Adurna]
Cultivateur professionnel de la commu' (il a de bons outils en de nombreux exemplaires Afficher barre HP des monstres au combat (sur le coté) [ résolu ] 522164 ) [Coco' Smile]
Date d'inscription : 13/05/2009

Afficher barre HP des monstres au combat (sur le coté) [ résolu ] Empty Re: Afficher barre HP des monstres au combat (sur le coté) [ résolu ]

Ven 30 Avr 2010 - 21:34
c'est résolu-> locké et déplacé
Contenu sponsorisé

Afficher barre HP des monstres au combat (sur le coté) [ résolu ] Empty Re: Afficher barre HP des monstres au combat (sur le coté) [ résolu ]

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