Accueil du SiteAccueil du Site  AccueilAccueil  Dernières imagesDernières images  RechercherRechercher  ConnexionConnexion  S'enregistrerS'enregistrer  



-40%
Le deal à ne pas rater :
Tefal Ingenio Emotion – Batterie de cuisine 10 pièces (induction, ...
59.99 € 99.99 €
Voir le deal

Partagez
 

 ● [XP/VX] FileErrorPrevention ●

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
Invité
Invité
Anonymous


● [XP/VX] FileErrorPrevention ●  Empty
MessageSujet: ● [XP/VX] FileErrorPrevention ●    ● [XP/VX] FileErrorPrevention ●  EmptyLun 19 Déc 2011 - 22:44

Description:

Ce script permet de bloquer les éventuelles erreurs qui font planter le jeu. Il vous indiquera un message d'erreur (par exemple: Graphics/Characters/Actor1) en cas de ressource manquante ou autre sans pour autant fermer le projet.

Installation: A placer au-dessus de module, donc oui il faut le mettre en tant que premier script.
Auteur: Woratana

Script:

Code:
#===============================================================
# ● [XP/VX] ◦ 'FILE MISSING ERROR' PREVENTER ◦ □
# * Game won't quit because file missing error anymore~ *
#--------------------------------------------------------------
# ◦ by Woratana [woratana@hotmail.com]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 05/10/2008
# ◦ Version: 1.0
#--------------------------------------------------------------
# * Put this script over everything in your game!
# (Default scripts in Script Editor are not an exception!)
#------------------------------------------------------------------

module Wora_FMEP
  #========================================================
  # * [START] 'FILE MISSING ERROR' PREVENTER SETUP PART *
  #--------------------------------------------------------
  Print_Missing_File = true
  # Print Missing File when error occured
 
  Record_Missing_File = true
  # Record missing file to missing file log?
  Missing_Log_File_Name = 'missing_log.txt'
  # Name of file to store missing file names list
 
  Use_Audio_Replacement = false
  # Use replacement audio file for missing audio?
  Audio_Replacement_File = 'Audio/SE/015-Jump01'
  # Audio file that will play for missing audio
 
  Use_Bitmap_Replacement = false
  # Use replacement image file for missing image?
  Bitmap_Replacement_File = 'Graphics/Fogs/001-Fog01'
  # Image file that will use for missing image
  #--------------------------------------------------------
  # * [END] 'FILE MISSING ERROR' PREVENTER SETUP PART *
  #========================================================
 
  def self.print(type, name)
    if Print_Missing_File
      p 'Missed File: ' + name.to_s
    end
    if Record_Missing_File
      file = File.open(Missing_Log_File_Name, "a+")
      type = type == 0 ? 'Bitmap' : 'Audio'
      text = '*' + type.to_s + '* :' + name.to_s + "\n"
      file.write(text) unless file.readlines.include?(text)
      file.close
    end
  end
end

class << Audio
  AUDME = [:bgm_play, :bgs_play, :me_play, :se_play]
  AUDME.each do |method|
    new_method = 'wora_fmep_aud_' + method.to_s
    alias_method(new_method, method) unless $@
new_def = <<_ALIAS_
def #{method}(*args)
  begin
    #{new_method}(*args)
  rescue
    Wora_FMEP.print(1, args[0])
    #{new_method}(Wora_FMEP::Audio_Replacement_File, args[1], args[2]) if
  Wora_FMEP::Use_Audio_Replacement
  end
end
_ALIAS_
eval(new_def)
  end
end

class Bitmap
  unless $@
    alias wora_fmep_bmp_ini initialize
    def initialize(*args)
      begin
        wora_fmep_bmp_ini(*args)
      rescue
        Wora_FMEP.print(0, args[0])
        if Wora_FMEP::Use_Bitmap_Replacement
          wora_fmep_bmp_ini(Wora_FMEP::Bitmap_Replacement_File)
        else
          wora_fmep_bmp_ini(32, 32)
        end
      end
    end
  end
end
Revenir en haut Aller en bas
Jin
Ancien staffeux
Ancien staffeux
Jin

Masculin
Messages postés : 8557
Date d'inscription : 08/12/2010
Jauge LPC :
● [XP/VX] FileErrorPrevention ●  891527140069 / 10069 / 100● [XP/VX] FileErrorPrevention ●  8915271400

G 1 petit zizi Very Happy
Nn C pa vré Sad
● [XP/VX] FileErrorPrevention ●  Membre15
● [XP/VX] FileErrorPrevention ●  Partag10
● [XP/VX] FileErrorPrevention ●  Travai10
● [XP/VX] FileErrorPrevention ●  Event-10
● [XP/VX] FileErrorPrevention ●  Altrui10
● [XP/VX] FileErrorPrevention ●  Riche_10
● [XP/VX] FileErrorPrevention ●  Couhil10
● [XP/VX] FileErrorPrevention ●  Nain_p11
● [XP/VX] FileErrorPrevention ●  Connar10


● [XP/VX] FileErrorPrevention ●  Empty
MessageSujet: Re: ● [XP/VX] FileErrorPrevention ●    ● [XP/VX] FileErrorPrevention ●  EmptyLun 19 Déc 2011 - 23:05

Ca peut être intéressant. Merci
Revenir en haut Aller en bas
Invité
Invité
Anonymous


● [XP/VX] FileErrorPrevention ●  Empty
MessageSujet: Re: ● [XP/VX] FileErrorPrevention ●    ● [XP/VX] FileErrorPrevention ●  EmptyLun 19 Déc 2011 - 23:39

C'est plus qu'intéressant c'est ultime quoi, faut que tu le voies en action pour comprendre sa principale utilité. ^^
Revenir en haut Aller en bas
Jin
Ancien staffeux
Ancien staffeux
Jin

Masculin
Messages postés : 8557
Date d'inscription : 08/12/2010
Jauge LPC :
● [XP/VX] FileErrorPrevention ●  891527140069 / 10069 / 100● [XP/VX] FileErrorPrevention ●  8915271400

G 1 petit zizi Very Happy
Nn C pa vré Sad
● [XP/VX] FileErrorPrevention ●  Membre15
● [XP/VX] FileErrorPrevention ●  Partag10
● [XP/VX] FileErrorPrevention ●  Travai10
● [XP/VX] FileErrorPrevention ●  Event-10
● [XP/VX] FileErrorPrevention ●  Altrui10
● [XP/VX] FileErrorPrevention ●  Riche_10
● [XP/VX] FileErrorPrevention ●  Couhil10
● [XP/VX] FileErrorPrevention ●  Nain_p11
● [XP/VX] FileErrorPrevention ●  Connar10


● [XP/VX] FileErrorPrevention ●  Empty
MessageSujet: Re: ● [XP/VX] FileErrorPrevention ●    ● [XP/VX] FileErrorPrevention ●  EmptyMar 20 Déc 2011 - 0:26

Oui m'enfin moi j'men branle.

Je vois une erreur => je modifie le script et c'est finit ^^
Je laisse aucune erreur passer.
Revenir en haut Aller en bas
Invité
Invité
Anonymous


● [XP/VX] FileErrorPrevention ●  Empty
MessageSujet: Re: ● [XP/VX] FileErrorPrevention ●    ● [XP/VX] FileErrorPrevention ●  EmptyMar 20 Déc 2011 - 13:29

Nan mais il suffit qu'il te manque une ressource dans ton problème, tu sais les autres ne jouent pas pareil que l'auteur donc c'est assez facile d'oublier un character par exemple.
Je pense pas qu'il gère les scripts.
Revenir en haut Aller en bas
Jin
Ancien staffeux
Ancien staffeux
Jin

Masculin
Messages postés : 8557
Date d'inscription : 08/12/2010
Jauge LPC :
● [XP/VX] FileErrorPrevention ●  891527140069 / 10069 / 100● [XP/VX] FileErrorPrevention ●  8915271400

G 1 petit zizi Very Happy
Nn C pa vré Sad
● [XP/VX] FileErrorPrevention ●  Membre15
● [XP/VX] FileErrorPrevention ●  Partag10
● [XP/VX] FileErrorPrevention ●  Travai10
● [XP/VX] FileErrorPrevention ●  Event-10
● [XP/VX] FileErrorPrevention ●  Altrui10
● [XP/VX] FileErrorPrevention ●  Riche_10
● [XP/VX] FileErrorPrevention ●  Couhil10
● [XP/VX] FileErrorPrevention ●  Nain_p11
● [XP/VX] FileErrorPrevention ●  Connar10


● [XP/VX] FileErrorPrevention ●  Empty
MessageSujet: Re: ● [XP/VX] FileErrorPrevention ●    ● [XP/VX] FileErrorPrevention ●  EmptyMar 20 Déc 2011 - 18:45

Ah ok =)
Revenir en haut Aller en bas
Contenu sponsorisé




● [XP/VX] FileErrorPrevention ●  Empty
MessageSujet: Re: ● [XP/VX] FileErrorPrevention ●    ● [XP/VX] FileErrorPrevention ●  Empty

Revenir en haut Aller en bas
 
● [XP/VX] FileErrorPrevention ●
Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Le Palais Créatif :: ~ PARTAGE ~ :: Ressources :: RPG Maker XP :: Autres-
Sauter vers: