AccueilAccueil  PortailPortail  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  ConnexionConnexion  



Le Deal du moment : -21%
LEGO® Icons 10329 Les Plantes Miniatures, ...
Voir le deal
39.59 €

Partagez
 

 Problème de script : Mog Location Map [Résolu]

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
Zerox
Maire Lv.9
Maire Lv.9
avatar


Masculin Age : 32
Avertissements : 2
Inscrit le : 20/07/2008
Messages : 353

Problème de script : Mog Location Map [Résolu] Empty
MessageSujet: Problème de script : Mog Location Map [Résolu]   Problème de script : Mog Location Map [Résolu] Icon_minitimeMar 19 Aoû 2008 - 10:45

Bonjour a tous j'ai "intaller" se script :

Code:

#_______________________________________________________________________________
# MOG_Location_Name_VX V1.0           
#_______________________________________________________________________________
# By Moghunter     
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Apresenta uma janela com o nome do map.
# É necessário ter uma imagem com o nome de  MAPNAME
# dentro da pasta Graphics/System.
#_______________________________________________________________________________
module MOG
#Font Name.
MPFONT = "Georgia"
#Fade ON/OFF(True - False).
MPNMFD = true
#Fade Time.
MPNMTM = 30
#Window Position.
# 0 = Upper Left.
# 1 = Lower Left.
# 2 = Upper Right.
# 3 = Lower Right.
MPNMPS = 2
# Disable Switch(ID).
WM_SWITCH_VIS_DISABLE = 15
end
#_________________________________________________
###############
# Game_System #
###############
class Game_System
attr_accessor :fdtm
attr_accessor :mpnm_x
attr_accessor :mpnm_y
alias mog_vx06_initialize initialize
def initialize
mog_vx06_initialize
@fdtm = 255 + 40 * MOG::MPNMTM
if MOG::MPNMPS == 0
@mpnm_x = -300
@mpnm_y = 0
elsif MOG::MPNMPS == 1
@mpnm_x = -300
@mpnm_y = 320
elsif MOG::MPNMPS == 2
@mpnm_x = 640
@mpnm_y = 0
else
@mpnm_x = 640
@mpnm_y = 320
end 
end
def mpnm_x
return @mpnm_x
end
def mpnm_y
return @mpnm_y
end
def fdtm
if @fdtm <= 0
@fdtm = 0
end
return @fdtm
end
end
############
# Game_Map #
############
class Game_Map
attr_reader  :map_id 
def mpname
$mpname = load_data("Data/MapInfos.rvdata")
$mpname[@map_id].name
end
end
###############
# Window Base #
###############
class Window_Base < Window
def nd_mapic
mapic = Cache.system("")   
end 
def draw_mpname(x,y)
mapic = Cache.system("Mpname") rescue nd_mapic 
cw = mapic.width 
ch = mapic.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch + 65, mapic, src_rect)
self.contents.font.name = MOG::MPFONT
self.contents.font.size = 22
self.contents.font.bold = true
self.contents.font.shadow = true
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 76, y + 27, 110, 32, $game_map.mpname.to_s,1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 75, y + 26, 110, 32, $game_map.mpname.to_s,1)
end
end
##########
# Mpname #
##########
class Mpname < Window_Base
def initialize(x , y)
super($game_system.mpnm_x, $game_system.mpnm_y, 250, WLH + 70)
self.opacity = 0
refresh
end
def refresh
self.contents.clear
draw_mpname(10,0)   
end
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog_vx06_start start
def start
@mpnm = Mpname.new($game_system.mpnm_x, $game_system.mpnm_y)
@mpnm.contents_opacity = $game_system.fdtm
if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == false
@mpnm.visible = true
else
@mpnm.visible = false 
end 
mog_vx06_start 
end 
alias mog_vx06_terminate terminate
def terminate
mog_vx06_terminate
@mpnm.dispose
end
alias mog_vx06_update update
def update
mog_vx06_update 
location_name_update
end
def location_name_update
$game_system.mpnm_x = @mpnm.x
$game_system.mpnm_y = @mpnm.y
if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == true or $game_system.fdtm <= 0
@mpnm.visible = false 
else
@mpnm.visible = true
end
if MOG::MPNMPS == 0 or MOG::MPNMPS == 1
if @mpnm.x < 0
@mpnm.x += 5
elsif @mpnm.x >= 0
@mpnm.x = 0
end 
else
if @mpnm.x > 300
@mpnm.x -= 5
elsif @mpnm.x <= 300
@mpnm.x = 300
end   
end
@mpnm.contents_opacity = $game_system.fdtm
if MOG::MPNMFD == true
$game_system.fdtm -= 3
end
end
alias mog_vx06_update_transfer_player update_transfer_player
def update_transfer_player
return unless $game_player.transfer?
@mpnm.contents_opacity = 0
mog_vx06_update_transfer_player
if MOG::MPNMPS == 0
$game_system.mpnm_x = -340
$game_system.mpnm_y = 0
elsif MOG::MPNMPS == 1
$game_system.mpnm_x = -340
$game_system.mpnm_y = 320
elsif MOG::MPNMPS == 2
$game_system.mpnm_x = 640
$game_system.mpnm_y = 0
else
$game_system.mpnm_x = 640
$game_system.mpnm_y = 320
end 
@mpnm.y = $game_system.mpnm_y
@mpnm.x = $game_system.mpnm_x
$game_system.fdtm = 255 + 60 * MOG::MPNMTM
@mpnm.refresh
end
end
$mogscript = {} if $mogscript == nil
$mogscript["location_name_vx"] = true


Mais j'aimerai qu'il ne s'affiche pas pour les 7 premiere map qui sont mon intro ...
Revenir en haut Aller en bas
Invité
Invité
avatar



Problème de script : Mog Location Map [Résolu] Empty
MessageSujet: Re: Problème de script : Mog Location Map [Résolu]   Problème de script : Mog Location Map [Résolu] Icon_minitimeMar 19 Aoû 2008 - 16:37

le seul trucs que tu peut faire est de trouver quelqun qui s'y connait en script ou de le corrigé en fesant un scripts qui déclenche le scripts que tu as comme avec le bestiaire vx
Revenir en haut Aller en bas
doubler78
Noble Lv.8
Noble Lv.8
doubler78


Féminin Age : 80
Inscrit le : 24/04/2008
Messages : 290

Problème de script : Mog Location Map [Résolu] Empty
MessageSujet: Re: Problème de script : Mog Location Map [Résolu]   Problème de script : Mog Location Map [Résolu] Icon_minitimeVen 29 Aoû 2008 - 11:47

10 jours sans réponse , mais je peut dire au caou , tu peut très bien nommé la map " " (espace ou encore un point)
Revenir en haut Aller en bas
Invité
Invité
avatar



Problème de script : Mog Location Map [Résolu] Empty
MessageSujet: Re: Problème de script : Mog Location Map [Résolu]   Problème de script : Mog Location Map [Résolu] Icon_minitimeVen 29 Aoû 2008 - 12:15

Oui ou faire une copie de cette map (donc il y aura 2* la même)

La premiere servira pour l'intro tu la nomme " " et apres l'intro tu téléporte sur l'autre: avec le nom que tu veux
Revenir en haut Aller en bas
Blockade
Ex-Admin Cruelle
Ex-Admin Cruelle
Blockade


Féminin Age : 32
Inscrit le : 03/07/2008
Messages : 2441

Problème de script : Mog Location Map [Résolu] Empty
MessageSujet: Re: Problème de script : Mog Location Map [Résolu]   Problème de script : Mog Location Map [Résolu] Icon_minitimeVen 29 Aoû 2008 - 12:49

Ou changer de script.

Code:

#==============================================================================
# ** Map Name Popup
#------------------------------------------------------------------------------
©️ Dargor, 2008
#  11/05/08
#  Version 1.5
#------------------------------------------------------------------------------
#  VERSION HISTORY:
#  - 1.0 (06/03/08), Initial release
#  - 1.1 (19/03/08), Added support for areas
#  - 1.2 (26/04/08), Added revert exclusion option
#  - 1.3 (11/05/08), Script restructuration
#  - 1.4 (11/05/08), Added support for enabling/disabling popups
#  - 1.5 (11/05/08), Added 'show' functions
#------------------------------------------------------------------------------
#  INSTRUCTIONS:
#  - Paste this above main
#  - Edit the Exclude_Maps array in the Map_Name_Popup module
#  - Edit the Exclude_Areas array in the Map_Name_Popup module
#==============================================================================

#==============================================================================
#  ** Map Name Popup Configuration
#==============================================================================

module Map_Name_Popup
  # These maps will not popup the name window
  Exclude_Maps = [1,2]
  # These areas will not popup the name window
  Exclude_Areas = []
  # Revert exclusion
  Revert_Exclusion = false
end

#==============================================================================
# ** RPG::Area
#------------------------------------------------------------------------------
#  Data class for areas.
#==============================================================================

class RPG::Area
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :show_name
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_area_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    dargor_vx_area_initialize
    @show_name = false
  end
end

#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :map_name_disabled
  attr_accessor :area_name_disabled
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_map_name_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    dargor_vx_map_name_initialize
    @map_name_disabled = false
    @area_name_disabled = false
  end
end

#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
#  This class handles maps. It includes event starting determinants and map
# scrolling functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Area ID
  #--------------------------------------------------------------------------
  def area_id
    for area in $data_areas.values
      return area.id if in_area?(area)
    end
  end
end

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :show_name
  #--------------------------------------------------------------------------
  # Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_map_name_window_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #    map_id : map ID
  #--------------------------------------------------------------------------
  def setup(map_id)
    dargor_map_name_window_setup(map_id)
    @show_name = true
  end
  #--------------------------------------------------------------------------
  # * Get Map ID
  #--------------------------------------------------------------------------
  def name
    map_infos = load_data("Data/MapInfos.rvdata")
    name = map_infos[@map_id].name
    name.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
    return name
  end
end

class Scene_Map < Scene_Base
  def show_map_name(forced=false)
    $game_map.show_name = true
    @spriteset.show_map_name(forced=false)
  end
  def show_area_name(forced=false)
    @spriteset.show_area_name(forced=false)
  end
end

#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
#  This class brings together map screen sprites, tilemaps, etc. It's used
# within the Scene_Map class.
#==============================================================================

class Spriteset_Map
  #--------------------------------------------------------------------------
  # Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_spriteset_name_window_initialize initialize
  alias dargor_spriteset_name_window_update update
  alias dargor_spriteset_name_window_dispose dispose
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    create_windows
    dargor_spriteset_name_window_initialize
    update
  end
  #--------------------------------------------------------------------------
  # * Create Windows
  #--------------------------------------------------------------------------
  def create_windows
    @map_name_window = Window_MapName.new
    @area_name_window = Window_MapName.new
  end
  #--------------------------------------------------------------------------
  # * Show Map Name
  #--------------------------------------------------------------------------
  def show_map_name(forced=false)
    unless forced
      return if $game_system.map_name_disabled
    end
    if $game_map.show_name
      @map_name_window.show_name($game_map.name, 128)
    end
  end
=> la suite dans la deuxième partie
Revenir en haut Aller en bas
Blockade
Ex-Admin Cruelle
Ex-Admin Cruelle
Blockade


Féminin Age : 32
Inscrit le : 03/07/2008
Messages : 2441

Problème de script : Mog Location Map [Résolu] Empty
MessageSujet: Re: Problème de script : Mog Location Map [Résolu]   Problème de script : Mog Location Map [Résolu] Icon_minitimeVen 29 Aoû 2008 - 12:51

Code:
#--------------------------------------------------------------------------
  # * Show Area Name
  #--------------------------------------------------------------------------
  def show_area_name(forced=false)
    unless forced
      return if $game_system.area_name_disabled
    end
    for area in $data_areas.values
      if $game_player.in_area?(area) and area.show_name
        if Map_Name_Popup::Revert_Exclusion
          return unless Map_Name_Popup::Exclude_Areas.include?(area.id)
        else
          return if Map_Name_Popup::Exclude_Areas.include?(area.id)
        end
        @area_name_window.show_name(area.name, 128, true)
        area.show_name = false
      else
        area.show_name = true unless $game_player.in_area?(area)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    dargor_spriteset_name_window_update
    show_map_name
    show_area_name
    @map_name_window.update
    @area_name_window.update
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    dargor_spriteset_name_window_dispose
    @map_name_window.dispose
    @area_name_window.dispose
  end
end

#==============================================================================
# ** Window_MapName
#------------------------------------------------------------------------------
#  This window shows the map name when the player is transfered.
#==============================================================================

class Window_MapName < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(name="", count=128)
    super(0, 0, 544, 64)
    self.visible = false
    self.openness = 0
    @name = name
    @count = count
    @in_area = false
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    #return unless $game_map.display_name
    self.visible = true
    self.contents.clear
    self.contents.font.color = normal_color
    align = @in_area ? 0 : 1
    self.contents.draw_text(0,0,504,32,@name,align)
    gw = contents.text_size(@name).width
    gc1 = Color.new(255,255,255)
    gc2 = Color.new(0,0,0,0)
    self.contents.gradient_fill_rect(0, WLH, gw, 2, gc1, gc2) if @in_area
    $game_map.show_name = false
  end
  #--------------------------------------------------------------------------
  # * Show Name
  #--------------------------------------------------------------------------
  def show_name(name=@name, count=@count, in_area=false)
    unless in_area
      return if $game_map.show_name == false
    end
    if Map_Name_Popup::Revert_Exclusion
      return unless Map_Name_Popup::Exclude_Maps.include?($game_map.map_id)
    else
      return if Map_Name_Popup::Exclude_Maps.include?($game_map.map_id)
    end
    @name = name
    @count = count
    @in_area = in_area
    if @in_area
      self.openness = 255
      self.opacity = 0
      self.contents_opacity = 0
      self.y = 352
    else
      self.openness = 0
      self.opacity = 255
      self.contents_opacity = 255
      self.y = 0
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    unless $scene.is_a?(Scene_Map)
      self.visible = false
      return
    end
    if self.visible
      if @count == 0
        if @in_area
          self.contents_opacity -= 24
          self.visible = false if self.contents_opacity == 0
          return
        else
          self.openness -= 24
          self.visible = false if self.openness == 0
          return
        end
      end
      if @in_area
        self.contents_opacity += 24
      else
        self.openness += 24
      end
      @count -= 1
    end
  end
end

Colle les 2 script a la suite, c'est celui qu'on utilise pour somnia. Dans le module de configuration, tu as Exclude_Maps = [1,2] Complète ta liste avec l'ID des maps pour lesquelles tu ne veut pas que le nom apparaisse. Ce script affiche auss ile nom des zones, si tu veux pas les afficher, procéde de la même façon sauf avec Exclude_Areas = [] Voila ^^
Revenir en haut Aller en bas
doubler78
Noble Lv.8
Noble Lv.8
doubler78


Féminin Age : 80
Inscrit le : 24/04/2008
Messages : 290

Problème de script : Mog Location Map [Résolu] Empty
MessageSujet: Re: Problème de script : Mog Location Map [Résolu]   Problème de script : Mog Location Map [Résolu] Icon_minitimeVen 29 Aoû 2008 - 14:55

Oh sa a l'air bien merci
Revenir en haut Aller en bas
Invité
Invité
avatar



Problème de script : Mog Location Map [Résolu] Empty
MessageSujet: Re: Problème de script : Mog Location Map [Résolu]   Problème de script : Mog Location Map [Résolu] Icon_minitimeVen 29 Aoû 2008 - 23:15

Ton 1er script:

# Disable Switch(ID).
WM_SWITCH_VIS_DISABLE = 15
end
#_

CE qui veux dire que celace joue avec l'interrutpeur numéro 15.

Je ne sais pas si le script fonctionne si l'interrupteur 15 est activé ou l'inverse a toi de voir. Tu peux changer le numéros d'interrupteur.

Donc tu actives ou désactive l'interrupteur à ta 1er map. Et une fois la fin des 7 maps tu fais l'inverse.

Et c'est Buenos.
Revenir en haut Aller en bas
Contenu sponsorisé




Problème de script : Mog Location Map [Résolu] Empty
MessageSujet: Re: Problème de script : Mog Location Map [Résolu]   Problème de script : Mog Location Map [Résolu] Icon_minitime

Revenir en haut Aller en bas
 

Problème de script : Mog Location Map [Résolu]

Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

 Sujets similaires

-
» [Script] Recherche d'un problème face à la modification d'un script [Résolu]
» [Résolu] Problème de script ..
» [Résolu] Problème script(?)
» Problème : script SBS 3.3a [RESOLU]
» Probleme de script ![résolu]

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Maker VX :: Entraide :: Problèmes et Solutions :: Résolu-
Créer un forum | ©phpBB | Forum gratuit d'entraide | Signaler un abus | Forum gratuit