Le deal à ne pas rater :
Réassort du coffret Pokémon 151 Électhor-ex : où l’acheter ?
Voir le deal

Aller en bas
cirmson974
cirmson974
Membre

Nombre de messages : 18
Age : 31
Localisation : ile de la reunion
Distinction : aucune
Date d'inscription : 07/07/2009
http://new-crimson.skyrock.com

problème script "brouillard" Empty problème script "brouillard"

Sam 28 Nov 2009 - 19:50
bonsoir, j'utilise le script qui permet d'ajouter un brouillard dans rpg maker vx (celui ci)
lorsque j'execute le jeux, le brouillard a le temps d'apparaitre un petit instant puis hop message d'erreur
script "brouillard" line 78 :NoMethodError occured undefined method `[]' for nil:NilClass
pourrez vous m'aider s'il vous plait
ZangtherOld
ZangtherOld
Membre

Nombre de messages : 1711
Date d'inscription : 07/08/2009

problème script "brouillard" Empty Re: problème script "brouillard"

Sam 28 Nov 2009 - 19:56
Tu peux copier coller ton script ici?
Parce que tu as fait des modifs pour l'adapter a tes maps et tu as surement fait une erreur.
cirmson974
cirmson974
Membre

Nombre de messages : 18
Age : 31
Localisation : ile de la reunion
Distinction : aucune
Date d'inscription : 07/07/2009
http://new-crimson.skyrock.com

problème script "brouillard" Empty Re: problème script "brouillard"

Sam 28 Nov 2009 - 20:00
Code:

#==============================================================================
# ** Brouillard d'RMXP  pou RMVX
#------------------------------------------------------------------------------
# Ce script crée un effet de brouillard comme dans RPG maker XP. Utiliser les brouillard proposés dans 
# RPG Maker XP.
# 08-03-2008 (dd-mm-aaaa) ©️ Hevendor de rmxp.org
# 09-03-2008 Edits/additions by Jirbytaylor
# 09-03-2008 (dd-mm-aaaa) Edité par Hevendor
# 31/07/2008 (dd-mm-aaaa) Traduit par Blockade
# Version 1.2.3
#==============================================================================

module Fog_Map_Settings
  #============================================================================
  # * Comfigure le lien vers le(s) fichier(s) de brouillard.  Format:
  # {numéro_du_brouillard => 'nom_du_fichier.extension', ...}
  # Ou nom_du_fichier.extension doit être un fichier de brouillard et son extention
  # DANS le dossier pictures du jeu.
  #============================================================================
  Fog_names = {1 => 'fog1.png',
                              2 => '001-Fog01.png',
                              3 => '001-Fog01.png' }
  #============================================================================
  # * Les maps ou vous voulez afficher le brouillard. Format:
  # Fog_maps = {mapID => numéro_du_brouillard , mapID2 => numéro_du_brouillard, ...}
  #============================================================================
  Fog_maps = {4 => 1,
                            2 => 2,
                            3 => 3}
  #============================================================================
  # * Options d'affichage du brouillard. Utiliser (numéro_du_brouillard => paramètre , ...) format
  # - Opacity - Opacitée du brouillard, comprise entre 0 (invisible) et 255 (opaque)
  # - Zoom - Taille du brouillard '1' est normal, pas '100'
  # - Blend - Si  : 0 - Normal
  #                        1 - Clair
  #                        2 - Sombre
  # - SxSy - Paramètre des défilements  (numéro_du_brouillard => [sx,sy], ...)
  #============================================================================
  Fog_opacity = {1 => 100,
                              2 => 100,
                              3 => 100}
  Fog_zoom = {1 => 1,
                          2 => 3,
                          3 => 3}
  Fog_blend = {1 => 2,
                          2  => 2,
                          3 => 0}
  Fog_sxsy = {1 => [0, 0],
                        2 => [6, 6],
                        3 => [4,4]}
end

class Game_Map
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :map_id                    # map ID
  attr_reader :fog_ox                    # fog oX
  attr_reader :fog_oy                    # fog oY
  #--------------------------------------------------------------------------
  # * Alias Definitions
  #--------------------------------------------------------------------------
  alias hev_fog_feature_map_update update
  alias hev_fog_feature_map_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @fog_ox = 0
    @fog_oy = 0
    hev_fog_feature_map_initialize
  end
  #--------------------------------------------------------------------------
  # * Update Fog
  #-------------------------------------------------------------------------- 
  def update_fog
    if Fog_Map_Settings::Fog_maps.include?($game_map.map_id)
      @fog_ox -= Fog_Map_Settings::Fog_sxsy[Fog_Map_Settings::Fog_maps[@map_id]][0] / 8.0
      @fog_oy -= Fog_Map_Settings::Fog_sxsy[Fog_Map_Settings::Fog_maps[@map_id]][1] / 8.0
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    hev_fog_feature_map_update
    update_fog
  end
end

class Spriteset_Map
  #--------------------------------------------------------------------------
  # * Alias Definitions
  #--------------------------------------------------------------------------
  alias hev_fog_feature_initialize initialize
  alias hev_fog_feature_create_viewports create_viewports
  alias hev_fog_feature_dispose dispose
  alias hev_fog_feature_update_viewports update_viewports
  alias hev_fog_feature_update update
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    hev_fog_feature_initialize
    create_fog
  end
  #--------------------------------------------------------------------------
  # * Create Viewport
  #--------------------------------------------------------------------------
  def create_viewports
    @viewport4 = Viewport.new(0, 0, 544, 416)
    @viewport4.z = 9
    hev_fog_feature_create_viewports
  end
  #--------------------------------------------------------------------------
  # * Create Fog
  #--------------------------------------------------------------------------
  def create_fog
    @fog = Plane.new(@viewport4)
    if Fog_Map_Settings::Fog_maps.include?($game_map.map_id)
      fog_number = Fog_Map_Settings::Fog_maps[$game_map.map_id]
      update_fog
      @fog.bitmap = Cache.picture(Fog_Map_Settings::Fog_names[fog_number])
      @fog.opacity = Fog_Map_Settings::Fog_opacity[fog_number]
      @fog.zoom_x = @fog.zoom_y = Fog_Map_Settings::Fog_zoom[fog_number]
      @fog.blend_type = Fog_Map_Settings::Fog_blend[fog_number]
    end     
  end
  #--------------------------------------------------------------------------
  # * Update Fog Sprite
  #--------------------------------------------------------------------------
  def update_fog
    if @fog != nil
      @fog.ox = $game_map.display_x / 8 + $game_map.fog_ox
      @fog.oy = $game_map.display_y / 8 + $game_map.fog_oy
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    hev_fog_feature_update
    update_fog
  end
  #--------------------------------------------------------------------------
  # * Dispose of Fog Sprite
  #--------------------------------------------------------------------------
  def dispose_fog
    @fog.dispose
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    dispose_fog
    hev_fog_feature_dispose
  end
end
Berka
Berka
Staffeux retraité

Nombre de messages : 1832
Age : 33
Localisation : Paris
Distinction : rubyste déglingué
9ème dan en scripting-no-jutsu

Nouveau Justine Beber ;P
Date d'inscription : 16/12/2007
http://rpgruby.olympe-network.com

problème script "brouillard" Empty Re: problème script "brouillard"

Sam 28 Nov 2009 - 20:01
C'est quoi ce problème ? T'as posté cinq fois de suite le meme sujet... ca mérite un avertissement.

berka
cirmson974
cirmson974
Membre

Nombre de messages : 18
Age : 31
Localisation : ile de la reunion
Distinction : aucune
Date d'inscription : 07/07/2009
http://new-crimson.skyrock.com

problème script "brouillard" Empty Re: problème script "brouillard"

Sam 28 Nov 2009 - 20:03
désolé je crois que le forum à subis un bug car j'ai posté qu'une seule fois mon message
cirmson974
cirmson974
Membre

Nombre de messages : 18
Age : 31
Localisation : ile de la reunion
Distinction : aucune
Date d'inscription : 07/07/2009
http://new-crimson.skyrock.com

problème script "brouillard" Empty Re: problème script "brouillard"

Lun 7 Déc 2009 - 15:13
UP!
Berka
Berka
Staffeux retraité

Nombre de messages : 1832
Age : 33
Localisation : Paris
Distinction : rubyste déglingué
9ème dan en scripting-no-jutsu

Nouveau Justine Beber ;P
Date d'inscription : 16/12/2007
http://rpgruby.olympe-network.com

problème script "brouillard" Empty Re: problème script "brouillard"

Lun 7 Déc 2009 - 18:51
je pense que cette erreur vient du fait que tu n'as pas correctement rempli les réglages au début du script.

bonne soirée,
berka
Contenu sponsorisé

problème script "brouillard" Empty Re: problème script "brouillard"

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