RPG Creator : créez votre MMORPG ou RPG sans aucune connaissance en programmation


Disponible le 4 Juin !




- Jouez à votre jeu sur tablettes tactiles, Smartphones et navigateurs Web
- Personnalisez vos menus
- Dessinez facilement et rapidement vos cartes
- Créez des actions pour le combat A-RPG


www.rpgcreator.net


Heures au format UTC + 1 heure [ Heure d’été ]


Règles du forum


Consultez la liste des Scripts : cliquez ici



Publier un nouveau sujet Répondre au sujet  [ 7 messages ] 
Auteur Message
 Sujet du message: Barres dans le menu et les combats
MessagePublié: 11 Juin 2008, 16:01 
Membre VIP
Membre VIP
Avatar de l’utilisateur

Inscrit le: 14 Avr 2007, 00:00
Messages: 1738
Localisation: ENS Rennes
Niveau RPG Maker: +∞
Point(s) Fort(s): Ruby
Sexe: Masculin
Points d'aide: 60/60

Créations :

Voir ses créations

[]Barres dans le menu et les combats



Auteur : Clive
D'après les scripts de Cogwheel et SephirothSpawn


Sommaire :
1. Script
2. Explications
3. Screenshots

_________________
Image
Projets
> ORAGE (Alternative 2D library) (#=> voir sur Github)
> &Co (#=> http://darkleo.alwaysdata.net/)


Haut
 Profil  
 
 Sujet du message: Re: Barres dans le menu et les combats
MessagePublié: 12 Juin 2008, 10:28 
Membre VIP
Membre VIP
Avatar de l’utilisateur

Inscrit le: 14 Avr 2007, 00:00
Messages: 1738
Localisation: ENS Rennes
Niveau RPG Maker: +∞
Point(s) Fort(s): Ruby
Sexe: Masculin
Points d'aide: 60/60

Créations :

Voir ses créations

[]1. Script

Code: Tout sélectionner
#===========================================================================
# *** HP/MP/ATB/LimitBreak bar Slanted Style Compatible with RTAB ***
# *** Version 2.1
#---------------------------------------------------------------------------
# Par Clive
#====================================================================
# Basé sur les scripts de barres de Cogwheel et de Sephiroth Spawn
#---------------------------------------------------------------------------
# --- Merci beaucoup à DerVVulfman pour le problème de lag
#====================================================================
#  Si vous utilisez le script de 'Limit Break', mettez ce script juste en dessous.
#  Sinon cela causera une erreur...
#====================================================================

#====================================================================
# ** Game_Actor
#====================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  def now_exp
    return @exp - @exp_list[@level]
  end
  #--------------------------------------------------------------------------
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
  #--------------------------------------------------------------------------
end
#====================================================================


#====================================================================
# ** Window_Base
#====================================================================
class Window_Base < Window
 
  #--------------------------------------------------------------------------
  # * Draw Slant Bar (by SephirothSpawn)
  #--------------------------------------------------------------------------
  def draw_slant_bar(x, y, min, max, width = 152, height = 6,
      bar_color = Color.new(150, 0, 0, 255),
      end_color = Color.new(255, 255, 60, 255))
    # Draw Border
    for i in 0..height
      self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
    end
    # Draw Background
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
    end
    # Draws Bar
    for i in 1..( (min.to_f / max.to_f) * width - 1)
      for j in 1..(height - 1)
        r = bar_color.red * (width - i) / width + end_color.red * i / width
        g = bar_color.green * (width - i) / width + end_color.green * i / width
        b = bar_color.blue * (width - i) / width + end_color.blue * i / width
        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
        self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
      end
    end
  end
 
  #--------------------------------------------------------------------------
  # * Draw HP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  alias :draw_actor_hp_hpsp :draw_actor_hp
  def draw_actor_hp(actor, x, y, width = 144)  
    draw_slant_bar(x, y + 12, actor.hp, actor.maxhp, width, 6,
      bar_color = Color.new(150, 0, 0, 255),
      end_color = Color.new(255, 255, 60, 255))
    draw_actor_hp_hpsp(actor, x, y, width)
   end
  #--------------------------------------------------------------------------
  # * Draw SP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  alias :draw_actor_sp_hpsp :draw_actor_sp
  def draw_actor_sp(actor, x, y, width = 144)
    draw_slant_bar(x, y + 12, actor.sp, actor.maxsp, width, 6,
      bar_color = Color.new(0, 0, 155, 255),
      end_color = Color.new(255, 255, 255, 255))
    draw_actor_sp_hpsp(actor, x, y, width)
  end
  #--------------------------------------------------------------------------
  # * Draw EXP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  alias raz_bars_base_exp draw_actor_exp
  def draw_actor_exp(actor, x, y)
    if actor.level == 99
      draw_slant_bar(x, y + 18, 1, 1, 190, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(0, 255, 0, 255))
    else
      draw_slant_bar(x, y + 18, actor.now_exp, actor.next_exp, 190, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(255, 255, 255, 255))
    end
    raz_bars_base_exp(actor, x, y)
  end
  #--------------------------------------------------------------------------
  # * Draw Parameter
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     type  : parameter type (0-6)
  #--------------------------------------------------------------------------
  alias raz_bars_base_parameter draw_actor_parameter
  def draw_actor_parameter(actor, x, y, type)
    case type
    when 0
      para_color1 = Color.new(100,0,0)
      para_color2 = Color.new(255,0,0)
      para_begin = actor.atk
    when 1
      para_color1 = Color.new(100,100,0)
      para_color2 = Color.new(255,255,0)
      para_begin = actor.pdef
    when 2
      para_color1 = Color.new(100,0,100)
      para_color2 = Color.new(255,0,255)
      para_begin = actor.mdef
    when 3
      para_color1 = Color.new(50,0,100)
      para_color2 = Color.new(50,0,255)
      para_begin = actor.str
    when 4
      para_color1 = Color.new(0,100,0)
      para_color2 = Color.new(0,255,0)
      para_begin = actor.dex
    when 5
      para_color1 = Color.new(50,0,50)
      para_color2 = Color.new(255,0,255)
      para_begin = actor.agi
    when 6
      para_color1 = Color.new(0,100,100)
      para_color2 = Color.new(0,255,255)
      para_begin = actor.int
    end
    draw_slant_bar(x, y + 18, para_begin, 999, 155, 4, bar_color = para_color1,
      end_color = para_color2)
    raz_bars_base_parameter(actor, x, y, type)
  end
  #--------------------------------------------------------------------------
  # * Draw Actor ATG
  #     actor : Actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_atg(actor, x, y, width = 144, height = 6)
    if @at_gauge == nil
      # plus_x:     revised x-coordinate
      # rate_x:     revised X-coordinate as (%)
      # plus_y:     revised y-coordinate
      # plus_width: revised width
      # rate_width: revised width as (%)
      # height:     Vertical width
      # align1: Type 1 ( 0: left justify  1: center justify 2: right justify )
      # align2: Type 2 ( 0: Upper stuffing 1: Central arranging  2:Lower stuffing )
      # align3: Gauge type 0:Left justify 1: Right justify
      @plus_x = 0
      @rate_x = 0
      @plus_y = 16
      @plus_width = 0
      @rate_width = 100
      @width = @plus_width + width * @rate_width / 100
      @height = 6
      @align1 = 0
      @align2 = 1
      @align3 = 0
      # Gradation settings:  grade1: Empty gauge   grade2:Actual gauge
      # (0:On side gradation   1:Vertically gradation    2: Slantedly gradation)
      grade1 = 1
      grade2 = 0
      # Color setting. color1: Outermost framework, color2: Medium framework
      # color3: Empty framework dark color, color4: Empty framework light/write color
      color1 = Color.new(0, 0, 0)
      color2 = Color.new(255, 255, 192)
      color3 = Color.new(0, 0, 0, 192)
      color4 = Color.new(0, 0, 64, 192)
      # Color setting of gauge
      # Usually color setting of the time
      color5 = Color.new(0, 64, 80)
      color6 = Color.new(255, 255, 255)#(0, 128, 160)
      # When gauge is MAX, color setting
      color7 = Color.new(80, 0, 0)
      color8 = Color.new(255, 255,255) #(240,0,0)
      # Color setting at time of cooperation skill use
      color9 = Color.new(80, 64, 32)
      color10 = Color.new(255, 255, 255) #(240, 192, 96)
      # Color setting at time of skill permanent residence
      color11 = Color.new(80, 0, 64)
      color12 = Color.new(255,255, 255) #(240, 0, 192)
      # Drawing of gauge
      gauge_rect_at(@width, @height, @align3, color1, color2, color3, color4,
          color5, color6, color7, color8, color9, color10, color11, color12,
          grade1, grade2)
    end
    # Variable at substituting the width of the gauge which is drawn
    if actor.rtp == 0
      at = (width + @plus_width) * actor.atp * @rate_width / 10000
    else
      at = (width + @plus_width) * actor.rt * @rate_width / actor.rtp / 100
    end
    # AT Width Check
    if at > width
      at = width
    end
    # Revision such as the left stuffing central posture of gauge
    case @align1
    when 1
      x += (@rect_width - width) / 2
    when 2
      x += @rect_width - width
    end
    case @align2
    when 1
      y -= @height / 2
    when 2
      y -= @height
    end
    # Draw Border
    for i in 0..height
      self.contents.fill_rect(x + 1.5 + i, y + 12 + height - i, width - 2 , 3,
        Color.new(50, 50, 50, 255))
    end
    # Draw Background
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.contents.fill_rect(x + 1.5 + i, y + 12 + height - i, width - 3, 3,
        Color.new(r, b, g, a))
    end
    # Rect_X control
    if @align3 == 0
      rect_x = 0
    else
      x += @width - at - 1
      rect_x = @width - at - 1
    end

    # Color setting of gauge
    if at == width
    #Gauge drawing at the time of MAX
      for i in 0..height
        self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y -i +
        @plus_y, @at_gauge, Rect.new(rect_x, @height * 2, at, @height))
      end
    else
      if actor.rtp == 0
        for i in 0..height
          # Usually gauge drawing of the time
          self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y- i +
            @plus_y, @at_gauge,Rect.new(rect_x, @height, at, @height))
        end
      else
        if actor.spell == true
          for i in 0..height
            #Gauge drawing at time of cooperation skill use
            self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y - i +
              @plus_y, @at_gauge, Rect.new(rect_x, @height * 3, at, @height))
          end
        else
          for i in 0..height            
            # Gauge drawing at time of skill permanent residence
            self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y - i +
              @plus_y, @at_gauge, Rect.new(rect_x, @height * 4, at, @height))
          end
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Actor Limit Break Bar
  #     actor : Actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_lb(actor, x, y, width = 144)
    rate = actor.limitbreak.to_f / LB_MAX
    plus_x = 0
    rate_x = 0
    plus_y = 15
    plus_width = 0
    rate_width = 100
    height = 7
    lb = (width + plus_width) * actor.limitbreak * rate_width / 100 / LB_MAX
    # Drawing of gauge
    if actor.limitbreak == LB_MAX
      # Draw Silver Blue Bar
      draw_slant_bar(x + plus_x + width * rate_x / 100, y + plus_y, lb, width,
        width, height, od_color1 = Color.new(0,80,200,192),
        od_color2 = Color.new(255,255,255,192))
    else
      # Draw Green Bar
      draw_slant_bar(x + plus_x + width * rate_x / 100, y + plus_y, lb, width,
        width, height, od_color1 = Color.new(31, 128, 0, 128),
        od_color2 = Color.new(255, 255, 191))
    end
  end
  #--------------------------------------------------------------------------
end
#====================================================================

_________________
Image
Projets
> ORAGE (Alternative 2D library) (#=> voir sur Github)
> &Co (#=> http://darkleo.alwaysdata.net/)


Haut
 Profil  
 
 Sujet du message: Re: Barres dans le menu et les combats
MessagePublié: 12 Juin 2008, 10:30 
Membre VIP
Membre VIP
Avatar de l’utilisateur

Inscrit le: 14 Avr 2007, 00:00
Messages: 1738
Localisation: ENS Rennes
Niveau RPG Maker: +∞
Point(s) Fort(s): Ruby
Sexe: Masculin
Points d'aide: 60/60

Créations :

Voir ses créations

2. Explications :
Ce script affiche dans le menu et les combats des barres pour la vie, le mana, etc...
Les barres sont remplies proportionnellement aux valeurs.

_________________
Image
Projets
> ORAGE (Alternative 2D library) (#=> voir sur Github)
> &Co (#=> http://darkleo.alwaysdata.net/)


Haut
 Profil  
 
 Sujet du message: Re: Barres dans le menu et les combats
MessagePublié: 12 Juin 2008, 10:32 
Membre VIP
Membre VIP
Avatar de l’utilisateur

Inscrit le: 14 Avr 2007, 00:00
Messages: 1738
Localisation: ENS Rennes
Niveau RPG Maker: +∞
Point(s) Fort(s): Ruby
Sexe: Masculin
Points d'aide: 60/60

Créations :

Voir ses créations

3. Screenshots :

Dans le menu :
Image

Dans les combats :
Image

_________________
Image
Projets
> ORAGE (Alternative 2D library) (#=> voir sur Github)
> &Co (#=> http://darkleo.alwaysdata.net/)


Haut
 Profil  
 
 Sujet du message: Re: Barres dans le menu et les combats
MessagePublié: 27 Juil 2010, 20:09 
Villageois (Nv 2)
Avatar de l’utilisateur

Inscrit le: 09 Fév 2010, 20:17
Messages: 37
Niveau RPG Maker: Débutant
Logiciel(s) préféré(s): RMXP
Point(s) Fort(s): Graphique système et event-making
Sexe: Masculin
Points d'aide: 0/60

Créations :

Voir ses créations

Est-ce possible de changer la couleur du HP en vert en gardant le dégradé et les points expériences en jaune uni. SVP.
Merci pour la réponse!

_________________
Image
Site Web: http://www.damonpower.zzl.org
La page facebook de mon site: http://www.facebook.com/damonpowerzone
Mon blog: http://damonpower.skyrock.com
Ma chaîne Youtube: http://www.youtube.com/user/demonpowertm
Affiliation: KHDownloads


Haut
 Profil  
 
 Sujet du message: Re: Barres dans le menu et les combats
MessagePublié: 27 Juil 2010, 20:36 
Garde
Garde
Avatar de l’utilisateur

Inscrit le: 12 Avr 2009, 00:00
Messages: 372
Logiciel(s) préféré(s): RMXP
Point(s) Fort(s): Ruby
Sexe: Masculin
Points d'aide: Illimité

Créations :

Voir ses créations

Bonjour Larknight,

Pour changer le dégradé de couleur des HP, c'est lignes 77 à 78 :
Code: Tout sélectionner
      bar_color = Color.new(150, 0, 0, 255),
      end_color = Color.new(255, 255, 60, 255))

"bar_color" est la couleur du début du dégradé.
"end_color" est la couleur de la fin du dégradé.
La couleur se modifie en RVBO (ou RGBA en anglais pour Red Green Blue Alpha)
Ainsi, on a :
Code: Tout sélectionner
Color.new(R, V, B, O)

R : Le taux de rouge.
V : Le taux de vert.
B : Le taux de bleu.
O : Le taux d'opacité.
Les taux peuvent être modifier entre 0 et 255.

Donc, si tu veut tes barres d'hp verte uniquement, avec un léger dégradé, les lignes 77 et 78 seront :
Code: Tout sélectionner
      bar_color = Color.new(0, 255, 0, 255),
      end_color = Color.new(0, 150, 0, 255))

Bien sur, a toi de faire varier pour que les couleur soit a ton gout.

Si tu souhaite modifier d'autre couleur de barre :
Pour les SP, lignes 91 et 92.
Pour l'exp, lignes 104 et 106 (104 quand le level du joueur est de 99 et 106 sinon. Aussi, ces lignes diffèrent un peu, mais sur chacune d'elle tu devrait retrouver "bar_color = Color.new(R, V, B, O)" et end_color = Color.new(R, V, B, O)", et bien tu leur applique exactement les même modif que j'a indiquer plus haut.)
Comme ceci pour du jaune :
Code: Tout sélectionner
    if actor.level == 99
      draw_slant_bar(x, y + 18, 1, 1, 190, 6, bar_color = Color.new(255, 255, 0, 255), end_color = Color.new(255, 255, 0, 255))
    else
      draw_slant_bar(x, y + 18, actor.now_exp, actor.next_exp, 190, 6, bar_color = Color.new(255, 255, 0, 255), end_color = Color.new(255, 255, 0, 255))
    end


Bonne Chance ;)


Haut
 Profil  
 
 Sujet du message: Re: Barres dans le menu et les combats
MessagePublié: 28 Juil 2010, 03:41 
Villageois (Nv 2)
Avatar de l’utilisateur

Inscrit le: 09 Fév 2010, 20:17
Messages: 37
Niveau RPG Maker: Débutant
Logiciel(s) préféré(s): RMXP
Point(s) Fort(s): Graphique système et event-making
Sexe: Masculin
Points d'aide: 0/60

Créations :

Voir ses créations

Ça parait que ton point forte est le ruby, c'est beaucoup d'information et c'est parfait :D . Je vais donc l'essayer quand cela sera possible, de plus c'est un script que je vais l'utiliser dans tout mes jeux. S'il y a quelque chose, tu peux me demander de l'aide, au niveaux site web, artwork et probablement je peux te donner une idée de scénario, si tu voudrais commencer un projet. Si ça t'intéresse, tu pourras utilisé mes bd pour en faire des adaptations, excepté Nolight End (Mes BD sont dans mon site, pas tous, et le lien pour mon site est sur ma signature).

Encore merci beaucoup!

Albavor : franchement, il y a les MP pour ça.

_________________
Image
Site Web: http://www.damonpower.zzl.org
La page facebook de mon site: http://www.facebook.com/damonpowerzone
Mon blog: http://damonpower.skyrock.com
Ma chaîne Youtube: http://www.youtube.com/user/demonpowertm
Affiliation: KHDownloads


Haut
 Profil  
 
Afficher les messages depuis:  Trier par  
Publier un nouveau sujet Répondre au sujet  [ 7 messages ] 

Heures au format UTC + 1 heure [ Heure d’été ]


Qui est en ligne ?

Utilisateurs parcourant actuellement ce forum : Aucun utilisateur inscrit et 1 invité


Vous ne pouvez pas publier de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas insérer de pièces jointes dans ce forum

Rechercher pour:
Sauter vers:  
cron
RPG Creative Forum version 5 ; Tous droits réservés
phpBB Group (Traduit par Xaphos)
Optimisé pour une résolution 1024*728