-39%
Le deal à ne pas rater :
Pack Home Cinéma Magnat Monitor : Ampli DENON AVR-X2800H, Enceinte ...
1190 € 1950 €
Voir le deal

Aller en bas
fake66
fake66
Membre

Nombre de messages : 61
Age : 37
Localisation : Vendée
Distinction : aucune
Date d'inscription : 17/05/2013

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Sam 18 Mai 2013 - 14:52
Bonjour à tous. J'ai commencé à me faire un a-rpg custom tout en event, pour l'instant tout marche niquel, ce fût un enorme travail. Ils me restes quelques détails de calculs des dégats mais tout roule.

le système marche très bien mais.... je sais pas comment afficher la vie au dessus des enemis (qui sont des events) Sachant que leur vie est inscrit dans des variables. je voulais (avec l'aide d'un script qui affiche le nom de l'event au dessus de celui ci), faire juste afficher \v[x] mais ça ne marche pas. ensuite j'ai tenté de faire afficher du texte en processus parallèle (pour tester) et ca marche mais le temps du texte sa bloque le personnage.

Il me faut un coup de pouce :/ Vous pouvez m'aider?


Dernière édition par fake66 le Sam 25 Mai 2013 - 23:54, édité 1 fois
Lunri
Lunri
Membre

Nombre de messages : 675
Age : 33
Distinction : aucune
Date d'inscription : 31/07/2011

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Sam 18 Mai 2013 - 15:40
Je pense que tu n'as pas d'autre solution que de le faire en image en calculant les cordonnées de tous tes monstres.

Edit : il me semble qu'avec le script l'event extender de Grim tu peux afficher un texte directement sous forme d'image et le manipuler un peu comme tu veux.
fake66
fake66
Membre

Nombre de messages : 61
Age : 37
Localisation : Vendée
Distinction : aucune
Date d'inscription : 17/05/2013

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Sam 18 Mai 2013 - 16:23
je vais essayer ca. En general je me demerde pas mal en event mais la je seche :/
Je tiens au courant dés que j'ai testé

EDIT: J'ai utilisé l'event extender, et j'ai réussi a faire une jauge de vie pour les boss, qui s'affiche en haut au centre de l'écran. Mais je sais pas comment faire suivre ce systeme au dessus d'un event. je vais continuer à chercher, mais si quelqu'un à une piste.

je cherche: sois
-à afficher une mini barre de vie au dessus des enemis qui vont donc bouger partout
-à afficher le nombre de point de vie qu'il leurs restent au dessus de eux aussi.

En tout cas merci pour le coup de main sa me fais avancer.
Lunri
Lunri
Membre

Nombre de messages : 675
Age : 33
Distinction : aucune
Date d'inscription : 31/07/2011

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Sam 18 Mai 2013 - 19:05
Je peux pas faire des tests mais je pensais à cette commande là.

picture_text(id_picture, text, *size=default, *font=default, *c=white, *bold=false, *italic=false, *outline=false, outline_color=black, *shadow=false)

A voir si dans la zone de texte tu peux mettre "\v[X]" pour afficher juste le nombre que tu veux.
Et si tu peux définir l'endroit ou s'affiche l'image avec les cordonnées de la map. C'est possible en évent dans Modifier variable -> autre -> événement. Mais je sais pas si c'est possible directement avec cette commande.
fake66
fake66
Membre

Nombre de messages : 61
Age : 37
Localisation : Vendée
Distinction : aucune
Date d'inscription : 17/05/2013

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Sam 18 Mai 2013 - 19:42
ouais c'est ce que j'ai testé directement mais ca ne marche pas, ca affiche une sorte de carré qui remplace \v puis [8]. (8 est le numeros de ma variable) mais j'ai direct testé avec cette commande. il n'y à pas un petit bout de script à faire pour relier le (\v[]) aux variable de sorte que le script "Event Extendre" reconnaisse la commande \v? de cette manière sa afficherais le numeros de la variable, parceque la il agit comme si il ne connaissais pas la commande. à moins que à la place de "text" je mette en language script l'appel d'une variable. comment on appel une variable en script?
Spytje
Spytje
Administrateur

Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Sam 18 Mai 2013 - 19:59

Peux-tu nous donner les scripts que tu utilises pour que je puisse voir et trouver une soution à ton problème ?
fake66
fake66
Membre

Nombre de messages : 61
Age : 37
Localisation : Vendée
Distinction : aucune
Date d'inscription : 17/05/2013

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Sam 18 Mai 2013 - 20:53
un script qui permet d'afficher le nom des pnj au dessus de leur tête (par tonyryu)
un script tout petit qui permet de mettre les HP/MP sur l'ecran en haut a gauche (sans nom)
et l'Event Extender.
Spytje
Spytje
Administrateur

Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Sam 18 Mai 2013 - 20:56
Ah oui je vois il faut alors modifier celui de Tony essaie de lui envoyer un mp il pourra certainement te faire ça sans difficultés.
fake66
fake66
Membre

Nombre de messages : 61
Age : 37
Localisation : Vendée
Distinction : aucune
Date d'inscription : 17/05/2013

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Sam 18 Mai 2013 - 21:03
ok je vais envoyer ca et je tiens au courant


EDIT: En faite il me faudrais l'affichage d'un texte "avec prise en compte des \v[x]" en parrallèle, donc qui ne coupe pas le jeu, et qui pourrais se placer où je veux.
Spytje
Spytje
Administrateur

Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Mar 21 Mai 2013 - 20:24
Peut être que ce script pourra t'aider :

Code:
#------------------------------------------------------------------------------#
#  Galv's Variable Instance Bars
#------------------------------------------------------------------------------#
#  For: RPGMAKER VX ACE
#  Version 1.1
#------------------------------------------------------------------------------#
#  2012-12-04 - version 1.1 - font issue fixed
#  2012-12-04 - version 1.0 - release
#------------------------------------------------------------------------------#
#  First things first. This script is purely cosmetic. It doesn't control or
#  look after whatever it is you are increasing/decreasing and using the bar
#  to show. Eg. If you're bar reaches full, YOU will need to set up using events
#  what happens after it gets there. (See demo with an example of this)
#  An exception is the variable bar (see below).
#
#  The script can call a bar that will animate decreasing or increasing by
#  certain amounts based on your input and then disappear again afterward.
#  You can call a custom bar or a variable bar.
#
#  The custom bar increases/decreases
#  depending on the settings you give it. (It will not automatically adjust any
#  parameters, experience, etc. for you. You do that manually).
#
#  The variable bar will adjust the chosen variable automatically by the amount
#  you set in the script call.
#
#  These bars only work on the map.
#------------------------------------------------------------------------------#
#  INSTRUCTIONS:
#------------------------------------------------------------------------------#
#
#  Put script under Materials and above Main
#
#  Make your own graphics for the bars or use the dodgy ones I made from the
#  demo. They got in /Graphics/System/ folder.
#
#  There are lots of settings to set up the bar to appear where you want it.
#
#------------------------------------------------------------------------------#
#  SCRIPT CALLS
#------------------------------------------------------------------------------#
#
#  bar_c(current,target,max,min,text)  # Draw a custom bar.
#                                      # current = starting amount
#                                      # target = amount it will raise/lower to
#                                      # max = full bar amount
#                                      # min = empty bar amount
#                                      # text = text with bar
#
#  bar_v(var_id,bonus,max,min,text)  # Draw a bar based on variable change.
#                                    # This automatically changes the variable
#                                    # by the bonus and cannot exceed the max.
#                                    # var_id = ID of the variable
#                                    # bonus = Amount it will increase/decrease
#                                    # max = full bar amount
#                                    # min = empty bar amount
#                                    # text = text with bar
#
#  bar_colors(barcol1,barcol2,text)  # Change the 2 gradient colors of the bar
#                                    # and the text color.
#
#  bar_graphic("FileName")          # file in /Graphics/System to change to
#
#------------------------------------------------------------------------------#
 
($imported ||= {})["Galvs_Variable_Bar"] = true
module Galv_VarBar
 
#------------------------------------------------------------------------------#
#  SCRIPT SETTINGS
#------------------------------------------------------------------------------#
 
  ACTIVE_TIME = 100  # How long the bar takes to fill/change.
 
  POSITION_Y = 210    # Y position
  POSITION_X = 0      # X position. 0 is centered, so to move everything left,
                      # use a negative number. Positive number for right.
  Z_OFFSET = 0        # Z level offset.
 
                     
  TEXT_SIZE = 30          # Size of the text
  TEXT_COLOR = 0          # Color of the text
  TEXT_FONT = "Arial"    # Font of the text
  TEXT_ALIGN = 1          # 0 = left. 1 = center. 2 = right
  TEXT_Y_OFFSET = 10      # Tweak Y position of the text
  TEXT_X_OFFSET = 0      # Tweak X position of the text
 
 
  BAR_WIDTH = 300            # Width of the bar
  BAR_HEIGHT = 30            # Height of the bar
  BAR_IMAGE = "BarCover"    # Image in /Graphics/System/
  BAR_IMAGE_Y = 210          # Bar image Y position (screen relative)
  BAR_IMAGE_X = 0            # Bar image X position offset. 0 is centered.
  BAR_COLOR = [1,9]          # Default gradient colors for the bar
 
 
  INIT_U_SE = ["Up1", 100, 100]      # SE played once when bar appears
  RAISE_SE = ["Cursor2", 100, 100]  # Repeating SE when bar is increasing.
                                    # ["SE Name", Volume, pitch]
 
  INIT_D_SE = ["Down1", 100, 100]    # SE played once when bar appears
  LOWER_SE = ["Cursor2", 100, 70]    # Repeating SE when bar is decreasing.
                                    # ["SE Name", Volume, pitch]
 
  SE_SPEED = 2                      # speed that the repeating SE's repeat
 
#------------------------------------------------------------------------------#
#  END SCRIPT SETTINGS
#------------------------------------------------------------------------------#
 
end
 
 
class Game_Temp
  attr_accessor :varbar
  attr_accessor :vargraphic
 
  alias galv_varbar_temp_initialize initialize
  def initialize
    galv_varbar_temp_initialize
    # @varbar = [current,target,max,x,y,open,text,color1,color2,text_color,variable,min]
    @varbar = [0,0,100,false,"",
      Galv_VarBar::BAR_COLOR[0],
      Galv_VarBar::BAR_COLOR[1],
      Galv_VarBar::TEXT_COLOR,
      0,0]
    @vargraphic = Galv_VarBar::BAR_IMAGE
  end
end # Game_Temp
 
 
class Game_Interpreter
  def bar_c(current,target,max,min,text)
    $game_temp.varbar[0] = current
    $game_temp.varbar[1] = target
    $game_temp.varbar[2] = max
    $game_temp.varbar[3] = true
    $game_temp.varbar[4] = text
    $game_temp.varbar[8] = 0
    $game_temp.varbar[9] = min
  end
 
  def bar_v(var_id,bonus,max,min,text)
    $game_temp.varbar[0] = $game_variables[var_id]
    $game_temp.varbar[1] = $game_variables[var_id] + bonus
    $game_temp.varbar[2] = max
    $game_temp.varbar[3] = true
    $game_temp.varbar[4] = text
    $game_temp.varbar[8] = var_id
    $game_temp.varbar[9] = min
  end
 
  def bar_color(color1,color2,textcol)
    $game_temp.varbar[5] = color1
    $game_temp.varbar[6] = color2
    $game_temp.varbar[7] = textcol
  end
 
  def bar_graphic(file)
    $game_temp.vargraphic = file
  end
end # Game_Interpreter
 
 
class Scene_Map < Scene_Base
 
  alias galv_varbar_map_create_all_windows create_all_windows
  def create_all_windows
    galv_varbar_map_create_all_windows
    create_varbar_window
  end
  alias galv_varbar_map_update update
  def update
    galv_varbar_map_update
    @varbar_window.open if $game_temp.varbar[3]
  end
  def create_varbar_window
    @varbar_window = Window_VarBar.new
  end
 
end # Scene_Map < Scene_Base
 
 
class Window_VarBar < Window_Base
  def initialize
    super(window_x, window_y, window_width, window_height)
    self.opacity = 0
    self.contents_opacity = 0
    self.z = z + Galv_VarBar::Z_OFFSET
    @show_count = 0
    @fill_rate = 0
    refresh
  end
  def window_width
    return Galv_VarBar::BAR_WIDTH
  end
  def window_height
    return 130 #Galv_VarBar::BAR_HEIGHT
  end
  def window_x
    (Graphics.width - window_width) / 2 + Galv_VarBar::POSITION_X
  end
  def window_y
    Galv_VarBar::POSITION_Y
  end
 
  def update
    text_rect
    super
    if @show_count > 0
      refresh
      update_fadein
      @show_count -= 1
    else
      update_fadeout
    end
  end
 
  def update_fadein
    self.contents_opacity += 16
    @cover.opacity = self.contents_opacity if !@cover.nil?
  end
 
  def update_fadeout
    self.contents_opacity -= 16
    @cover.opacity = self.contents_opacity if !@cover.nil?
  end
 
  def open
    direction
    $game_temp.varbar[3] = false
    draw_cover if @cover.nil?
    refresh
    @show_count = Galv_VarBar::ACTIVE_TIME
    @fill_rate = fill_rate
    self.contents_opacity = 0 unless contents_opacity > 0
    self
   
    if $game_temp.varbar[8] > 0
      if @direction == 1
        $game_variables[$game_temp.varbar[8]] = [$game_temp.varbar[1],$game_temp.varbar[2]].min
      else
        $game_variables[$game_temp.varbar[8]] = [$game_temp.varbar[1],$game_temp.varbar[9]].max
      end
    end
  end
 
  def direction
    if $game_temp.varbar[0] < $game_temp.varbar[1]
      @direction = 1
      RPG::SE.new(Galv_VarBar::INIT_U_SE[0], Galv_VarBar::INIT_U_SE[1], Galv_VarBar::INIT_U_SE[2]).play
    else
      @direction = 0
      RPG::SE.new(Galv_VarBar::INIT_D_SE[0], Galv_VarBar::INIT_D_SE[1], Galv_VarBar::INIT_D_SE[2]).play
    end
  end
 
  def dispose
    @show_count = 0
    contents.dispose unless disposed?
    @cover.bitmap.dispose unless disposed? || @cover.nil?
    @cover.dispose unless disposed? || @cover.nil?
    super
  end
 
  def refresh
    contents.clear
    if @cgraphic != $game_temp.vargraphic
      if !@cover.nil?
        @cover.bitmap = Cache.system($game_temp.vargraphic)
        @cgraphic = $game_temp.vargraphic
      end
    end
    draw_varbar(0, 0, window_width)
    draw_heading(@text_rect.x, @text_rect.y, $game_temp.varbar[4]) if !@text_rect.nil?
    if $game_temp.varbar[0] < $game_temp.varbar[1] && @direction == 1
      if @show_count % Galv_VarBar::SE_SPEED == 0 && $game_temp.varbar[0] < $game_temp.varbar[2]
    return 0 if $game_temp.varbar[0] == $game_temp.varbar[9]
        RPG::SE.new(Galv_VarBar::RAISE_SE[0], Galv_VarBar::RAISE_SE[1], Galv_VarBar::RAISE_SE[2]).play
      end
      $game_temp.varbar[0] += @fill_rate
    elsif $game_temp.varbar[0] > $game_temp.varbar[1] && @direction == 0
      if @show_count % Galv_VarBar::SE_SPEED == 0 && $game_temp.varbar[0] > $game_temp.varbar[9]
        RPG::SE.new(Galv_VarBar::LOWER_SE[0], Galv_VarBar::LOWER_SE[1], Galv_VarBar::LOWER_SE[2]).play
      end
      $game_temp.varbar[0] += @fill_rate
    end
  end
 
  def draw_heading(x, y, text)
    contents.font.name = Galv_VarBar::TEXT_FONT
    contents.font.size = Galv_VarBar::TEXT_SIZE
    change_color(text_color($game_temp.varbar[7]))
    contents.font.bold = Font.default_bold
    contents.font.italic = Font.default_italic
    text = convert_escape_characters(text)
    pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
    process_character(text.slice!(0, 1), text, pos) until text.empty?
  end
 
  def text_rect
    @text_rect = Rect.new
    @text_rect.width = text_size($game_temp.varbar[4]).width
    @text_rect.height = Galv_VarBar::TEXT_SIZE
    if Galv_VarBar::TEXT_ALIGN == 0
      @text_rect.x = 0 + Galv_VarBar::TEXT_X_OFFSET
    elsif Galv_VarBar::TEXT_ALIGN == 2
      @text_rect.x = Galv_VarBar::BAR_WIDTH - @text_rect.width + Galv_VarBar::TEXT_X_OFFSET
    else
      @text_rect.x = (Galv_VarBar::BAR_WIDTH - @text_rect.width) / 2 + Galv_VarBar::TEXT_X_OFFSET
    end
    @text_rect.y = 0 + Galv_VarBar::TEXT_Y_OFFSET
    @text_rect
  end
 
  def fill_rate
    ($game_temp.varbar[1] - $game_temp.varbar[0]) / (Galv_VarBar::ACTIVE_TIME * 0.5)
  end
 
  def rate
    $game_temp.varbar[0].to_f / $game_temp.varbar[2].to_f
  end
 
  def draw_varbar(x, y, width = 124)
    draw_gauge(x, y, width, rate, text_color($game_temp.varbar[5]), text_color($game_temp.varbar[6]))
    change_color(system_color)
  end
  def standard_padding
    return 0
  end
 
  def draw_gauge(x, y, width, rate, color1, color2)
    fill_w = (width * rate).to_i
    gauge_y = (contents.height - Galv_VarBar::BAR_HEIGHT) / 2
    contents.fill_rect(x, gauge_y, window_width, Galv_VarBar::BAR_HEIGHT, gauge_back_color)
    contents.gradient_fill_rect(x, gauge_y, fill_w, Galv_VarBar::BAR_HEIGHT, color1, color2)
  end
 
  def draw_cover
    @cover = Sprite.new
    @cover.bitmap = Cache.system($game_temp.vargraphic)
    @cgraphic = $game_temp.vargraphic
    @cover.x = (Graphics.width - @cover.bitmap.width) / 2 + Galv_VarBar::BAR_IMAGE_X
    @cover.y = Galv_VarBar::BAR_IMAGE_Y
    @cover.z = z - 1
    @cover.opacity = 0
  end
 
end # Window_VarBar < Window_Base

Auteur : Galv
fake66
fake66
Membre

Nombre de messages : 61
Age : 37
Localisation : Vendée
Distinction : aucune
Date d'inscription : 17/05/2013

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Jeu 23 Mai 2013 - 18:15
ho, niquel! je peut pas le tester de suite mais de ce que j'ai vus en lisant un peu le script ca doit être ca. Merci ! c'est trop cool.
Korndor
Korndor
Staffeux retraité

Nombre de messages : 4959
Age : 110
Localisation : Erem Vehyx
Distinction : Champion de boxe et au lit ! :O [Wax]
Être Mythique [Mister]
Papi Korndor qui a l'ostéoporose [Skillo]
Soldat Ikéa [Coco']
Un bonhomme, un vrai ! [Neresis]
Vieillard acariâtre [Didier Gustin]
Date d'inscription : 16/12/2007
https://www.rpgmakervx-fr.com/

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

Jeu 23 Mai 2013 - 21:30
Si le problème est résolu, merci d'ajouter [Résolu] dans le titre Smile
Contenu sponsorisé

[resolus] afficher la vie d'un monstre en arpg, besoin d'aide Empty Re: [resolus] afficher la vie d'un monstre en arpg, besoin d'aide

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