Astro86 Posted March 4, 2012 Share Posted March 4, 2012 Ciao a tutti.. dopo svariati tentativi ho scoperto quale script va in conflitto con un'altra script e volevo vedere se si può far andare d'accordo le 2 script La Script è la Item Popup #==============================================================================# Chest Item Pop-Up#------------------------------------------------------------------------------# Original Author : OriginalWij# Version : 1.0#==============================================================================# Game_Interpreter#==============================================================================class Game_Event < Game_Characteralias chest_update updatedef updatechest_update$event = @eventendendclass Game_Interpreter #-------------------------------------------------------------------------- # Get X #-------------------------------------------------------------------------- def get_x events = $game_map.events x_coord = events[@event_id] return x_coord.screen_x end #-------------------------------------------------------------------------- # Get Y #-------------------------------------------------------------------------- def get_y events = $game_map.events y_coord = events[@event_id] return y_coord.screen_y end #-------------------------------------------------------------------------- # Change Gold #-------------------------------------------------------------------------- def command_125 value = operate_value(@params[0], @params[1], @params[2]) $game_party.gain_gold(value) x_value = get_x y_value = get_y for i in 0...@list.size $scene = Chest_Popup.new(x_value, y_value, 0, value, 1) if @list.code == 108 and @list.parameters == [CHEST_WORD] end return true end #-------------------------------------------------------------------------- # Change Items #-------------------------------------------------------------------------- def command_126 value = operate_value(@params[1], @params[2], @params[3]) $game_party.gain_item($data_items[@params[0]], value) $game_map.need_refresh = true x_value = get_x y_value = get_y for i in 0...@list.size $scene = Chest_Popup.new(x_value, y_value, 1, value, @params[0]) if @list.code == 108 and @list.parameters == [CHEST_WORD] end return true end #-------------------------------------------------------------------------- # Change Weapons #-------------------------------------------------------------------------- def command_127 value = operate_value(@params[1], @params[2], @params[3]) $game_party.gain_item($data_weapons[@params[0]], value, @params[4]) x_value = get_x y_value = get_y for i in 0...@list.size $scene = Chest_Popup.new(x_value, y_value, 2, value, @params[0]) if @list.code == 108 and @list.parameters == [CHEST_WORD] end return true end #-------------------------------------------------------------------------- # Change Armor #-------------------------------------------------------------------------- def command_128 value = operate_value(@params[1], @params[2], @params[3]) $game_party.gain_item($data_armors[@params[0]], value, @params[4]) x_value = get_x y_value = get_y for i in 0...@list.size $scene = Chest_Popup.new(x_value, y_value, 3, value, @params[0]) if @list.code == 108 and @list.parameters == [CHEST_WORD] end return true end #-------------------------------------------------------------------------- # Empty Chest #-------------------------------------------------------------------------- alias empty_chest_execute_command execute_command def execute_command for i in 0...@list.size chest(-1,0,0,false) if @list.code == 108 and @list.parameters == [EMPTY_CHEST_WORD] end empty_chest_execute_command endend#==============================================================================# Item Popup Window#==============================================================================class Item_Popup_Window < Window_Base #-------------------------------------------------------------------------- # Initialize #-------------------------------------------------------------------------- def initialize(x, y) super(0, 0, 544, 416) self.opacity = 0 @x = x - 26 @y = y - 56 end #-------------------------------------------------------------------------- # Pop-Up #-------------------------------------------------------------------------- def pop_up(icon_index, x, y) self.contents.clear draw_icon(icon_index, x, y, true) endend#==============================================================================# Chest_Popup#==============================================================================class Chest_Popup < Scene_Base #-------------------------------------------------------------------------- # Initialize #-------------------------------------------------------------------------- def initialize(x, y, type, amount, index) @x = x @y = y @amount = amount $iftype=type;$ifamount=amount;$ifindex=index case type when 0 # gold @amount = 1 @icon_index = GOLD_ICON when 1 # items @icon_index = $data_items[index].icon_index when 2 # weapons @icon_index = $data_weapons[index].icon_index when 3 # armors @icon_index = $data_armors[index].icon_index end end #-------------------------------------------------------------------------- # Start #-------------------------------------------------------------------------- def start create_background @popup_window = Item_Popup_Window.new(@x, @y) end #-------------------------------------------------------------------------- # Terminate #-------------------------------------------------------------------------- def terminate @popup_window.dispose @menuback_sprite.dispose end #-------------------------------------------------------------------------- # Return Scene #-------------------------------------------------------------------------- def return_scene(type,index,amount,popup) $scene = Scene_Map.new if USE_ITEM_FOUND;chest(type,index,amount,popup);end end #-------------------------------------------------------------------------- # Update #-------------------------------------------------------------------------- def update super @popup_window.update @menuback_sprite.update if USE_ITEM_POPUP;do_popup;else;return_scene($iftype,$ifindex,$ifamount,false);end end #-------------------------------------------------------------------------- # Update Basic #-------------------------------------------------------------------------- def update_basic Graphics.update Input.update $game_map.update end #-------------------------------------------------------------------------- # Wait #-------------------------------------------------------------------------- def wait(duration) for i in 0...duration update_basic end end #-------------------------------------------------------------------------- # Create Background #-------------------------------------------------------------------------- def create_background @menuback_sprite = Sprite.new @menuback_sprite.bitmap = $game_temp.background_bitmap @menuback_sprite.update end #-------------------------------------------------------------------------- # Do Pop-Up #-------------------------------------------------------------------------- def do_popup Audio.se_play("Audio/SE/#{POPUP_SOUND}", POPUP_SOUND_VOLUME, POPUP_SOUND_PITCH) if PLAY_POP_UP_SOUND if MULTIPLE_ITEMS for i in 1..@amount for i in 0..4 @popup_window.pop_up(@icon_index, @x - 26, @y - (i * 4) - 48) @popup_window.update wait(2) end wait(5) if i != @amount end else for i in 0..4 @popup_window.pop_up(@icon_index, @x - 26, @y - (i * 4) - 48) @popup_window.update wait(2) end wait(5) if i != @amount end return_scene($iftype,$ifindex,$ifamount,false) endend#==============================================================================#------------------------------------------------------------------------------#==============================================================================# Item_Found#------------------------------------------------------------------------------# Original Author : Khai(http://ktbanh.wordpress.com/)# Version : 1.3#==============================================================================class Chest_Window_Base < Window_Base def initialize super(0, 0, CHEST_DATA[0], WLH + 32) self.windowskin = Cache.system(MSG_WINDOWSKIN) end#------------------------------------------------------------------------------ def set_text(text, align = 1) if text != @text @text = text self.contents.clear self.contents.font.color = text_color(MSG_COLOR) self.contents.draw_text(0, 0, self.width - 32, WLH, text, align) end endend#------------------------------------------------------------------------------class Chest_Window_Addon < Window_Base def initialize(index,type) super(0, 0, CHEST_DATA[1], WLH + 32) self.windowskin = Cache.system(MSG_WINDOWSKIN) if USE_GOLD_ICON and type==3;type=4;end self.draw_icon($data_items[index].icon_index, 0, 0, true)if type == 0 self.draw_icon($data_armors[index].icon_index, 0, 0, true)if type == 1 self.draw_icon($data_weapons[index].icon_index, 0, 0, true)if type == 2 self.draw_icon(GOLD_ICON, 0, 0, true) if type == 4 self.contents.font.color = text_color(MSG_COLOR) self.contents.draw_text(6, 0, CHEST_DATA[1], WLH, $data_system.terms.gold) if type == 3 endend#------------------------------------------------------------------------------def chest(type,index,value,mapcall)case type;when 0;type=3;when 1;type=0;when 2;type=2;when 3;type=1;endif mapcall==true;case type;when 0;$game_party.gain_item($data_items[index],value)when 1;$game_party.gain_item($data_armors[index],value)when 2;$game_party.gain_item($data_weapons[index],value)when 3;$game_party.gain_gold(value);end;end$scene = Scene_Chest.new(type,index,value)end#------------------------------------------------------------------------------class Scene_Chest < Scene_Base def initialize(type,index,num) @index = index;@setting = type;@num = num;@spriteset = Spriteset_Map.new CHEST_DATA[1] = 56 if USE_GOLD_ICON;if type == 3; CHEST_DATA[1] = 56;end else;if type == 3; CHEST_DATA[1] = width_set($data_system.terms.gold);end;end @khai_icon_window = Chest_Window_Addon.new(index, type) case type;when 0;@type=$data_items[@index].name when 1;@type=$data_armors[@index].name when 2;@type=$data_weapons[@index].name when 3;@type=Vocab::gold;else;@text=MSG_EMPTY;@khai_icon_window.width=0;end #Add Type(0-2) item/armors/weapons @text = "#{num} #{@type}s #{MSG_ADD}" if type<3&&type>-1&&num>=0 #Add Type(3) gold @text = "#{num} #{@type} #{MSG_ADD}" if type==3&&num>=0 #Remove Type(0-2) item/armors/weapons @text = "#{num*-1} #{@type}s #{MSG_REMOVE}" if type<3&&type>-1&&num<0&&num!=-1 #Remove Type(3) Gold @text = "#{num*-1} #{@type} #{MSG_REMOVE}" if type==3&&num<0 #Remove Single @text = "#{@type} #{MSG_REMOVE}" if type<3&&type>-1&&num==-1 #Add Single @text = "#{@type} #{MSG_ADD}" if type<3&&type>-1&&num==1 CHEST_DATA[0] = width_set(@text) #Window Properties @khai_icon_window.width=0 if NO_ICON_WINDOW @khai_info_window=Chest_Window_Base.new @khai_info_window.width=width_set(@text) @khai_info_window.set_text(@text) @khai_info_window.x=(544-(@khai_info_window.width-@khai_icon_window.width))/2 @khai_icon_window.x=(544-(@khai_info_window.width+@khai_icon_window.width))/2 @khai_icon_window.y=(416-@khai_icon_window.height)/2 @khai_info_window.y=(416-@khai_info_window.height)/2 play_se end#------------------------------------------------------------------------------ def width_set(n) self.width_set_bitmap.text_size(n).width + 42 end#------------------------------------------------------------------------------ def width_set_bitmap Bitmap.new(32,32) end#------------------------------------------------------------------------------ def play_se #Item Gain SE Audio.se_play("Audio/SE/#{ITEM_GAIN}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting<3&&@setting>-1&&@num>0&&ITEM_GAIN != "" if PLAY_FOUND_WINDOW_SOUND #Gold Gain SE Audio.se_play("Audio/SE/#{GOLD_GAIN}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting==3&&@num>=0&&GOLD_GAIN != "" if PLAY_FOUND_WINDOW_SOUND #Item Remove SE Audio.se_play("Audio/SE/#{ITEM_REMOVE}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting<3&&@setting>-1&&@num<0&&ITEM_REMOVE != "" if PLAY_FOUND_WINDOW_SOUND #Gold Remove SE Audio.se_play("Audio/SE/#{GOLD_REMOVE}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting==3&&@num<0&&GOLD_REMOVE != "" if PLAY_FOUND_WINDOW_SOUND end#------------------------------------------------------------------------------ def terminate @spriteset.dispose @khai_icon_window.dispose @khai_info_window.dispose end#------------------------------------------------------------------------------ def update @khai_info_window.update @khai_icon_window.update @spriteset.update # enables sprite update (weather) $game_map.update # enables event update (event movement) $scene = Scene_Map.new if Input.trigger?(Input::B) or Input.trigger?(Input::C) end#------------------------------------------------------------------------------end#============================================================================== seconda script sempre del Pop-UP #==============================================================================# Script : Item Popup / Item Found#------------------------------------------------------------------------------# Authors : OriginalWij - Item Pop-Up# : Khai - Item Found (http://ktbanh.wordpress.com/)# : Eccid - Item Popup/Item Found Integration and Modification#------------------------------------------------------------------------------# Versions : 1.0 - Item Pop-Up (Inital Release)# : 1.3 - Item Found (Final Release of Version Used)# : 1.0 - Item Popup/Item Found Integration and Modification# (Initial Release)#==============================================================================# Description :# - This script (when both scripts are activated) makes the item icon pop out# from the chest and calls a box containing the item icon (when activated)# along with the number recieved and name of an item, when a chest is# specified by a comment box containing the "CHEST_WORD"#------------------------------------------------------------------------------# Features :# - Easy to use# - No call scripts needed to add items, uses the program default commands# - Customizable call word used to specify chests# - Almost completely customizable# - Works when adding or subtracting items#------------------------------------------------------------------------------# How to Install :# - Place both parts of the script in the "Materials" section above main# - If you already have either script, it is reccomended you delete them# or they could cause compatability issues#------------------------------------------------------------------------------# How to Use :# - Make a comment at the beginning of your chest event containing what is# set as the CHEST_WORD without the quotations around it ("CHEST" by# default)# - Use the add item, weapon, armor or gold commands from the event commands# menu in the editor# - When adding multiple items, insert a WAIT(1) between them# - To make a message stating the chest is empty, make a comment containing# the EMPTY_CHEST_WORD ("EMPTY" by default)# NOTE: This is useful to put in the last page of a chest event (after# the chest has been opened)#------------------------------------------------------------------------------# - As well, you may use the item found window on its own by using the# script command "chest(type, index, amount, true)" (without quotations)# - type (0-3)# 0 = Gold# 1 = Item# 2 = Weapon# 3 = Armor## - index (Item Number)## - amount (Number Recieved)## - true (leave it true, it specifies the script called by an event)## - Note: Using the call script also puts the item in your inventory,# so there is no need to add it manually#------------------------------------------------------------------------------# Compatability Issues :# - Anaryu's Particle Engine VX no longer seems to be affected by nor affects# either of these script#------------------------------------------------------------------------------# Terms and Conditions :# - Free to use as long as authors are credited#------------------------------------------------------------------------------# Credits :# - OriginalWij (Item Pop-Up)# - Khai (Item Found)(http://ktbanh.wordpress.com/)# - Eccid (Item Popup/Item Found Integration and Modification)#==============================================================================# - PM me if you can think of more ways to make this customizable#==============================================================================#------------------------------------------------------------------------------#==============================================================================# ▼ CUSTOMIZATION AREA ▼#------------------------------------------------------------------------------# Which scripts to useUSE_ITEM_POPUP = trueUSE_ITEM_FOUND = true # You could set them both to false... but why?#------------------------------------------------------------------------------#------------------------------------------------------------------------------#[iTEM POPUP DEFINITIONS]# "Gold" icon indexGOLD_ICON = 205# Word used in a comment to specify an event is a chestCHEST_WORD = "CHEST"# Word used in a comment to specify an event is an empty chestEMPTY_CHEST_WORD = "EMPTY"# Choose if an icon pops-up for each multiple of the same itemMULTIPLE_ITEMS = false# Choose to play sound on item popupPLAY_POP_UP_SOUND = false# Item Popup sound SettingsPOPUP_SOUND = "Chime2"POPUP_SOUND_VOLUME = 100POPUP_SOUND_PITCH = 150 #------------------------------------------------------------------------------#------------------------------------------------------------------------------#[iTEM FOUND WINDOW DEFINITIONS]# Message to be shown when an item is gained# (String states: [number recieved] [item name] MSG_ADD ex. 3 Potions Recieved)MSG_ADD = "Ricevuto"# Message to be shown when an item is lost# (String states: [number removed] [item name] MSG_REMOVE ex. 25 Cards Lost)MSG_REMOVE = "Lost"# Message to be shown when a chest is emptyMSG_EMPTY = "The chest is empty"# Windowskin to be used for the item found windowMSG_WINDOWSKIN = "Window"# Text color number (0-31) corresponding to the color library in the# bottom right-hand corner of the windowskin usedMSG_COLOR = 14# Use an icon for gold in the icon window instead of a symbol("G" by default)USE_GOLD_ICON = true# Icon to use if above is trueGOLD_ICON = 205# Don't show the icon window next to the item found windowNO_ICON_WINDOW = false# Choose to play sound on item found windowPLAY_FOUND_WINDOW_SOUND = true# Item Found sound settingsITEM_GAIN = "Saint5"GOLD_GAIN = "Saint5"ITEM_REMOVE = "Saint5"GOLD_REMOVE = "Saint5"FOUND_SOUND_VOLUME = 100FOUND_SOUND_PITCH = 100#------------------------------------------------------------------------------# ▲ END OF CUSTOMIZATION AREA ▲#==============================================================================CHEST_DATA = []#<-DO NOT ALTER OR DELETE!(Or you'll regret it. HINT:Papa Smurf)#============================================================================== Va in conflitto con l'HUD del Time System di The Sleeping Leonhart # Autore: The Sleeping Leonhart# Versione: 1.0# Data di rilascio: 12/02/2009#------------------------------------------------------------------------------# Descrzione:# Questo script permette di avere un Hud per visualizzare il tempo del Time System#------------------------------------------------------------------------------# Versione:# 1.0 (12/02/2009): Versione Base.#------------------------------------------------------------------------------# Istruzioni:# Inserire sotto il Time System e sotto il Weather System.# Per forzare lo stato dell'hud usare lo script:# $scene.show_time_hud(true/false)# Per personalizzare lo script andate nella sezione Configurazione.#==============================================================================#==============================================================================# Configurazione#=============================================================================module Time_Hud #========================================================================= # DateSeparetor: Imposta il carattere che separa la data #------------------------------------------------------------------------- # Sintassi: # DateSeparetor = char # Parametri: # char: carattere di separazione #========================================================================= DateSeparetor = "/" #========================================================================= # TimeSeparetor: Imposta il carattere che separa il tempo #------------------------------------------------------------------------- # Sintassi: # TimeSeparetor = char # Parametri: # char: carattere di separazione #========================================================================= TimeSeparetor = ":" #========================================================================= # DateType: Imposta il tipo di data visualizzata #------------------------------------------------------------------------- # Sintassi: # DateType = type # Parametri: # type: 0) Giorno/Mese/Anno 1) NomeGiorno Giorno NomeMese Anno #========================================================================= DateType = 1 #========================================================================= # TimeType: Imposta il tipo di tempo visualizzato #------------------------------------------------------------------------- # Sintassi: # TimeType = type # Parametri: # type: 0) Ora:Minuti:Secondi 1) Ora:Minuti:Second AM/PM #========================================================================= TimeType = 1 #========================================================================= # Position: Imposta la posizione della finestra #------------------------------------------------------------------------- # Sintassi: # Position = [x, y] # Parametri: # x: coordinata x # y: coordinata y #========================================================================= Position = [0, 0] #========================================================================= # Show...: Imposta la visibilità di data, tempo, secondi, stagion, meteo #------------------------------------------------------------------------- # Sintassi: # Show... = bool # Parametri: # bool: true visible, false non visibile #========================================================================= ShowDate = true ShowTime = true ShowSecond = false ShowSeason = false ShowWeather = false #========================================================================= # Opacity: Imposta l'opacità dello sfondo della finestra #------------------------------------------------------------------------- # Sintassi: # Opacity = n # Parametri: # n: numero da 0(invisibile) a 255(completamente visibile) #========================================================================= Opacity = 0 #========================================================================= # Button: Imposta il bottone da premere per visualizzare l'HUD #------------------------------------------------------------------------- # Sintassi: # Button = Input::costante # Parametri: # costante: DOWN LEFT RIGHT UP A B C X Y Z L R SHIFT CTRL ALT F5 F6 F7 F8 F9 #========================================================================= Button = Input::SHIFT #========================================================================= # Button: Imposta l'immagine di sfondo dell'HUD #------------------------------------------------------------------------- # Sintassi: # BGImage = image # Parametri: # image: nome dell'immagine contenuta nella cartella pictures, per non usarla scrivere "" #========================================================================= BGImage = "time-hud"endclass Game_Time def time(type = 0, second = false) ss = sprintf("%02d", @second) mm = sprintf("%02d", @minute) t = "" if type == 0 hh = sprintf("%02d", @hour) else if @hour > 12 hh = sprintf("%02d", (@hour - 12)) t = " PM" else hh = sprintf("%02d", @hour) t = " AM" end end sep = Time_Hud::TimeSeparetor if second return hh+sep+mm+sep+ss+t else return hh+sep+mm+t end end def date(type = 0) dd = @day.to_s yy = @year.to_s if type == 0 mm = @month.to_s sep = Time_Hud::DateSeparetor return dd+sep+mm+sep+yy else dn = Time_System::Day[@day_name_index] mm = Time_System::Month[@month - 1] sep = " " return dn+sep+dd+sep+mm+sep+yy end endendclass Window_TimeHud < Window_Base def initialize height = 32 height += 24 if Time_Hud::ShowDate height += 24 if Time_Hud::ShowTime height += 24 if Time_Hud::ShowSeason || Time_Hud::ShowWeather super(Time_Hud::Position[0], Time_Hud::Position[0], 224, height) self.opacity = Time_Hud::Opacity @sprite = Sprite.new @sprite.bitmap = Time_Hud::BGImage != "" ? Cache.picture(Time_Hud::BGImage) : Bitmap.new(32, 32) @sprite.visible = self.visible @sprite.x = self.x @sprite.y = self.y @sprite.z = self.z - 1 @time = 0 refresh end def refresh self.contents.clear y = -4 if Time_Hud::ShowDate self.contents.draw_text(4, y, 184, 32, $game_time.date(Time_Hud::DateType)) y += 24 end if Time_Hud::ShowTime self.contents.draw_text(4, y, 184, 32, $game_time.time(Time_Hud::TimeType, Time_Hud::ShowSecond)) y += 24 end x = 4 if Time_Hud::ShowSeason self.contents.draw_text(x, y, 184, 32, $game_time.season) x += self.contents.text_size($game_time.season).width + 4 end if Time_Hud::ShowWeather self.contents.draw_text(x, y, 184, 32, $game_time.weather) end end def dispose super @sprite.bitmap.dispose @sprite.dispose end def update super @time += 1 @sprite.visible = self.visible if @time >= (Graphics.frame_rate / $game_time.speed) refresh @time = 0 end endendclass Scene_Map alias tsltmhud_scnmp_strt start def start tsltmhud_scnmp_strt @time_hud_window = Window_TimeHud.new end alias tsltmhud_scnmp_pdt update def update tsltmhud_scnmp_pdt if @time_hud_window.visible @time_hud_window.update end if Input.trigger?(Time_Hud::Button) show_time_hud(!@time_hud_window.visible) end end alias tsltmhud_scnmp_trmnt terminate def terminate tsltmhud_scnmp_trmnt @time_hud_window.dispose end def show_time_hud(show) @time_hud_window.visible = show @time_hud_window.update endendclass Game_Time attr_accessor :hud_visibilityend o meglio vanno in conflitto quando inserisco questo richiama script per abilitare\disabilitare l'HUD $scene.show_time_hud(false) c'è un modo per fixare la cosa? Link to comment Share on other sites More sharing options...
0 giver Posted March 4, 2012 Share Posted March 4, 2012 Ehm. Forse, se l'hai usata, dipende invece dall'aggiunta nel menù dell'opzione attiva-disattiva HUD . . . Guarda se ti dà conflitto anche senza . . . E prova ad inserire la versione che ho modificato dopo che mi avevi detto che funzionava grosso modo, se non l'hai già fatto . . . SCRIPT RGSS (RPG Maker XP) VINTAGE LIBRARY [2018+]http://www.rpg2s.net/forum/index.php/topic/21892-vintagevisualsrewrite-enhanced-revised-victory-screen-v-35-da-autori-vari-a-giver/ http://www.rpg2s.net/forum/index.php/topic/21868-eventing-utility-simple-last-battle-events-fix-v-30-by-giver/ http://www.rpg2s.net/forum/index.php/topic/21853-vintagerewrite-constance-menu-per-4-personaggi-da-team-constance-a-giver/ http://www.rpg2s.net/forum/index.php/topic/22126-vintagedoveroso-necroedit-dummy-title-22u-update-per-crearlo-ad-eventi-su-mappa-by-giver/ http://www.rpg2s.net/forum/index.php/topic/22127-vintagevisuals-tale-chapters-save-system-20-by-giver/ Breaking (in ogni senso) News: "Treno deraglia per via del seno di Sakurai Aoi . . ." - Info nello spoiler !! http://afantasymachine.altervista.org/_altervista_ht/NOOOOOOOOOilMIOtreninooooo_500.gifNon riesco a smettere di essere affascinato da immagini come questa . . .http://anime.vl-vostok.ru/art/photos2011/17/78049800/wall_VladAnime_WWA_1885-1680x1050.jpgAlcuni wallpapers che faccio ruotare sul mio vecchio PC . . .http://afantasymachine.altervista.org/_altervista_ht/gits_window.jpghttp://afantasymachine.altervista.org/_altervista_ht/madoka_group01.jpghttp://afantasymachine.altervista.org/_altervista_ht/arisu_picipici_01.jpghttp://afantasymachine.altervista.org/_altervista_ht/phantom_wp01_einzwei.jpg La parte più spassosa della mia vita è quando gli altri cercano di spiegarmi i miei pensieri . . . BBCode TestingTypeface & Size Link to comment Share on other sites More sharing options...
0 Astro86 Posted March 4, 2012 Author Share Posted March 4, 2012 sisi.. ho provato sia con la modifica che mi avevi fatto che con questa senza modifche.. unica differenza e che quella modificata da te mi da errore appena apro una cassa con il commento CHEST per far partire il Pop-UP.. questa senza modifiche me lo fa appena faccio Nuova Partita\Continua Link to comment Share on other sites More sharing options...
0 giver Posted March 4, 2012 Share Posted March 4, 2012 (edited) Decisamente non ho le idee chiare sulla situazione . . . Non so, magari usi un (call) script invece di un comment, per indicare CHEST ? Te lo dà solo se usi il comando indicato da Sleeping ? Allora prova a scrivere nel (call) script if $scene.is_a?(Scene_Map) $scene.show_time_hud(false) end EDIT - Oppure, se usi l'aggiunta al menù, puoi provare ad usare questo (call) script $game_time.hud_visibility = false EDIT2 - Questa, se usata la parte di codice nell'aggiunta al menù, funziona da qualunque Scene, ad eccezione del Title (perchè $game_time non esiste), non solo da (call) script . . . Edited March 5, 2012 by giver SCRIPT RGSS (RPG Maker XP) VINTAGE LIBRARY [2018+]http://www.rpg2s.net/forum/index.php/topic/21892-vintagevisualsrewrite-enhanced-revised-victory-screen-v-35-da-autori-vari-a-giver/ http://www.rpg2s.net/forum/index.php/topic/21868-eventing-utility-simple-last-battle-events-fix-v-30-by-giver/ http://www.rpg2s.net/forum/index.php/topic/21853-vintagerewrite-constance-menu-per-4-personaggi-da-team-constance-a-giver/ http://www.rpg2s.net/forum/index.php/topic/22126-vintagedoveroso-necroedit-dummy-title-22u-update-per-crearlo-ad-eventi-su-mappa-by-giver/ http://www.rpg2s.net/forum/index.php/topic/22127-vintagevisuals-tale-chapters-save-system-20-by-giver/ Breaking (in ogni senso) News: "Treno deraglia per via del seno di Sakurai Aoi . . ." - Info nello spoiler !! http://afantasymachine.altervista.org/_altervista_ht/NOOOOOOOOOilMIOtreninooooo_500.gifNon riesco a smettere di essere affascinato da immagini come questa . . .http://anime.vl-vostok.ru/art/photos2011/17/78049800/wall_VladAnime_WWA_1885-1680x1050.jpgAlcuni wallpapers che faccio ruotare sul mio vecchio PC . . .http://afantasymachine.altervista.org/_altervista_ht/gits_window.jpghttp://afantasymachine.altervista.org/_altervista_ht/madoka_group01.jpghttp://afantasymachine.altervista.org/_altervista_ht/arisu_picipici_01.jpghttp://afantasymachine.altervista.org/_altervista_ht/phantom_wp01_einzwei.jpg La parte più spassosa della mia vita è quando gli altri cercano di spiegarmi i miei pensieri . . . BBCode TestingTypeface & Size Link to comment Share on other sites More sharing options...
0 Astro86 Posted March 4, 2012 Author Share Posted March 4, 2012 Perfetto.. ora funziona sia con la modifica che mi hai fatto che senza :) Grazie Link to comment Share on other sites More sharing options...
Question
Astro86
Ciao a tutti.. dopo svariati tentativi ho scoperto quale script va in conflitto con un'altra script e volevo vedere se si può far andare d'accordo le 2 script
La Script è la Item Popup
# Chest Item Pop-Up
#------------------------------------------------------------------------------
# Original Author : OriginalWij
# Version : 1.0
#==============================================================================
# Game_Interpreter
#==============================================================================
class Game_Event < Game_Character
alias chest_update update
def update
chest_update
$event = @event
end
end
class Game_Interpreter
#--------------------------------------------------------------------------
# Get X
#--------------------------------------------------------------------------
def get_x
events = $game_map.events
x_coord = events[@event_id]
return x_coord.screen_x
end
#--------------------------------------------------------------------------
# Get Y
#--------------------------------------------------------------------------
def get_y
events = $game_map.events
y_coord = events[@event_id]
return y_coord.screen_y
end
#--------------------------------------------------------------------------
# Change Gold
#--------------------------------------------------------------------------
def command_125
value = operate_value(@params[0], @params[1], @params[2])
$game_party.gain_gold(value)
x_value = get_x
y_value = get_y
for i in 0...@list.size
$scene = Chest_Popup.new(x_value, y_value, 0, value, 1) if @list.code == 108 and @list.parameters == [CHEST_WORD]
end
return true
end
#--------------------------------------------------------------------------
# Change Items
#--------------------------------------------------------------------------
def command_126
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_items[@params[0]], value)
$game_map.need_refresh = true
x_value = get_x
y_value = get_y
for i in 0...@list.size
$scene = Chest_Popup.new(x_value, y_value, 1, value, @params[0]) if @list.code == 108 and @list.parameters == [CHEST_WORD]
end
return true
end
#--------------------------------------------------------------------------
# Change Weapons
#--------------------------------------------------------------------------
def command_127
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_weapons[@params[0]], value, @params[4])
x_value = get_x
y_value = get_y
for i in 0...@list.size
$scene = Chest_Popup.new(x_value, y_value, 2, value, @params[0]) if @list.code == 108 and @list.parameters == [CHEST_WORD]
end
return true
end
#--------------------------------------------------------------------------
# Change Armor
#--------------------------------------------------------------------------
def command_128
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_armors[@params[0]], value, @params[4])
x_value = get_x
y_value = get_y
for i in 0...@list.size
$scene = Chest_Popup.new(x_value, y_value, 3, value, @params[0]) if @list.code == 108 and @list.parameters == [CHEST_WORD]
end
return true
end
#--------------------------------------------------------------------------
# Empty Chest
#--------------------------------------------------------------------------
alias empty_chest_execute_command execute_command
def execute_command
for i in 0...@list.size
chest(-1,0,0,false) if @list.code == 108 and @list.parameters == [EMPTY_CHEST_WORD]
end
empty_chest_execute_command
end
end
#==============================================================================
# Item Popup Window
#==============================================================================
class Item_Popup_Window < Window_Base
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------
def initialize(x, y)
super(0, 0, 544, 416)
self.opacity = 0
@x = x - 26
@y = y - 56
end
#--------------------------------------------------------------------------
# Pop-Up
#--------------------------------------------------------------------------
def pop_up(icon_index, x, y)
self.contents.clear
draw_icon(icon_index, x, y, true)
end
end
#==============================================================================
# Chest_Popup
#==============================================================================
class Chest_Popup < Scene_Base
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------
def initialize(x, y, type, amount, index)
@x = x
@y = y
@amount = amount
$iftype=type;$ifamount=amount;$ifindex=index
case type
when 0 # gold
@amount = 1
@icon_index = GOLD_ICON
when 1 # items
@icon_index = $data_items[index].icon_index
when 2 # weapons
@icon_index = $data_weapons[index].icon_index
when 3 # armors
@icon_index = $data_armors[index].icon_index
end
end
#--------------------------------------------------------------------------
# Start
#--------------------------------------------------------------------------
def start
create_background
@popup_window = Item_Popup_Window.new(@x, @y)
end
#--------------------------------------------------------------------------
# Terminate
#--------------------------------------------------------------------------
def terminate
@popup_window.dispose
@menuback_sprite.dispose
end
#--------------------------------------------------------------------------
# Return Scene
#--------------------------------------------------------------------------
def return_scene(type,index,amount,popup)
$scene = Scene_Map.new
if USE_ITEM_FOUND;chest(type,index,amount,popup);end
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
def update
super
@popup_window.update
@menuback_sprite.update
if USE_ITEM_POPUP;do_popup;else;return_scene($iftype,$ifindex,$ifamount,false);end
end
#--------------------------------------------------------------------------
# Update Basic
#--------------------------------------------------------------------------
def update_basic
Graphics.update
Input.update
$game_map.update
end
#--------------------------------------------------------------------------
# Wait
#--------------------------------------------------------------------------
def wait(duration)
for i in 0...duration
update_basic
end
end
#--------------------------------------------------------------------------
# Create Background
#--------------------------------------------------------------------------
def create_background
@menuback_sprite = Sprite.new
@menuback_sprite.bitmap = $game_temp.background_bitmap
@menuback_sprite.update
end
#--------------------------------------------------------------------------
# Do Pop-Up
#--------------------------------------------------------------------------
def do_popup
Audio.se_play("Audio/SE/#{POPUP_SOUND}", POPUP_SOUND_VOLUME, POPUP_SOUND_PITCH) if PLAY_POP_UP_SOUND
if MULTIPLE_ITEMS
for i in 1..@amount
for i in 0..4
@popup_window.pop_up(@icon_index, @x - 26, @y - (i * 4) - 48)
@popup_window.update
wait(2)
end
wait(5) if i != @amount
end
else
for i in 0..4
@popup_window.pop_up(@icon_index, @x - 26, @y - (i * 4) - 48)
@popup_window.update
wait(2)
end
wait(5) if i != @amount
end
return_scene($iftype,$ifindex,$ifamount,false)
end
end
#==============================================================================
#------------------------------------------------------------------------------
#==============================================================================
# Item_Found
#------------------------------------------------------------------------------
# Original Author : Khai(http://ktbanh.wordpress.com/)
# Version : 1.3
#==============================================================================
class Chest_Window_Base < Window_Base
def initialize
super(0, 0, CHEST_DATA[0], WLH + 32)
self.windowskin = Cache.system(MSG_WINDOWSKIN)
end
#------------------------------------------------------------------------------
def set_text(text, align = 1)
if text != @text
@text = text
self.contents.clear
self.contents.font.color = text_color(MSG_COLOR)
self.contents.draw_text(0, 0, self.width - 32, WLH, text, align)
end
end
end
#------------------------------------------------------------------------------
class Chest_Window_Addon < Window_Base
def initialize(index,type)
super(0, 0, CHEST_DATA[1], WLH + 32)
self.windowskin = Cache.system(MSG_WINDOWSKIN)
if USE_GOLD_ICON and type==3;type=4;end
self.draw_icon($data_items[index].icon_index, 0, 0, true)if type == 0
self.draw_icon($data_armors[index].icon_index, 0, 0, true)if type == 1
self.draw_icon($data_weapons[index].icon_index, 0, 0, true)if type == 2
self.draw_icon(GOLD_ICON, 0, 0, true) if type == 4
self.contents.font.color = text_color(MSG_COLOR)
self.contents.draw_text(6, 0, CHEST_DATA[1], WLH, $data_system.terms.gold) if type == 3
end
end
#------------------------------------------------------------------------------
def chest(type,index,value,mapcall)
case type;when 0;type=3;when 1;type=0;when 2;type=2;when 3;type=1;end
if mapcall==true;case type;when 0;$game_party.gain_item($data_items[index],value)
when 1;$game_party.gain_item($data_armors[index],value)
when 2;$game_party.gain_item($data_weapons[index],value)
when 3;$game_party.gain_gold(value);end;end
$scene = Scene_Chest.new(type,index,value)
end
#------------------------------------------------------------------------------
class Scene_Chest < Scene_Base
def initialize(type,index,num)
@index = index;@setting = type;@num = num;@spriteset = Spriteset_Map.new
CHEST_DATA[1] = 56
if USE_GOLD_ICON;if type == 3; CHEST_DATA[1] = 56;end
else;if type == 3; CHEST_DATA[1] = width_set($data_system.terms.gold);end;end
@khai_icon_window = Chest_Window_Addon.new(index, type)
case type;when 0;@type=$data_items[@index].name
when 1;@type=$data_armors[@index].name
when 2;@type=$data_weapons[@index].name
when 3;@type=Vocab::gold;else;@text=MSG_EMPTY;@khai_icon_window.width=0;end
#Add Type(0-2) item/armors/weapons
@text = "#{num} #{@type}s #{MSG_ADD}" if type<3&&type>-1&&num>=0
#Add Type(3) gold
@text = "#{num} #{@type} #{MSG_ADD}" if type==3&&num>=0
#Remove Type(0-2) item/armors/weapons
@text = "#{num*-1} #{@type}s #{MSG_REMOVE}" if type<3&&type>-1&&num<0&&num!=-1
#Remove Type(3) Gold
@text = "#{num*-1} #{@type} #{MSG_REMOVE}" if type==3&&num<0
#Remove Single
@text = "#{@type} #{MSG_REMOVE}" if type<3&&type>-1&&num==-1
#Add Single
@text = "#{@type} #{MSG_ADD}" if type<3&&type>-1&&num==1
CHEST_DATA[0] = width_set(@text)
#Window Properties
@khai_icon_window.width=0 if NO_ICON_WINDOW
@khai_info_window=Chest_Window_Base.new
@khai_info_window.width=width_set(@text)
@khai_info_window.set_text(@text)
@khai_info_window.x=(544-(@khai_info_window.width-@khai_icon_window.width))/2
@khai_icon_window.x=(544-(@khai_info_window.width+@khai_icon_window.width))/2
@khai_icon_window.y=(416-@khai_icon_window.height)/2
@khai_info_window.y=(416-@khai_info_window.height)/2
play_se
end
#------------------------------------------------------------------------------
def width_set(n)
self.width_set_bitmap.text_size(n).width + 42
end
#------------------------------------------------------------------------------
def width_set_bitmap
Bitmap.new(32,32)
end
#------------------------------------------------------------------------------
def play_se
#Item Gain SE
Audio.se_play("Audio/SE/#{ITEM_GAIN}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting<3&&@setting>-1&&@num>0&&ITEM_GAIN != "" if PLAY_FOUND_WINDOW_SOUND
#Gold Gain SE
Audio.se_play("Audio/SE/#{GOLD_GAIN}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting==3&&@num>=0&&GOLD_GAIN != "" if PLAY_FOUND_WINDOW_SOUND
#Item Remove SE
Audio.se_play("Audio/SE/#{ITEM_REMOVE}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting<3&&@setting>-1&&@num<0&&ITEM_REMOVE != "" if PLAY_FOUND_WINDOW_SOUND
#Gold Remove SE
Audio.se_play("Audio/SE/#{GOLD_REMOVE}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting==3&&@num<0&&GOLD_REMOVE != "" if PLAY_FOUND_WINDOW_SOUND
end
#------------------------------------------------------------------------------
def terminate
@spriteset.dispose
@khai_icon_window.dispose
@khai_info_window.dispose
end
#------------------------------------------------------------------------------
def update
@khai_info_window.update
@khai_icon_window.update
@spriteset.update # enables sprite update (weather)
$game_map.update # enables event update (event movement)
$scene = Scene_Map.new if Input.trigger?(Input::B) or Input.trigger?(Input::C)
end
#------------------------------------------------------------------------------
end
#==============================================================================
seconda script sempre del Pop-UP
# Script : Item Popup / Item Found
#------------------------------------------------------------------------------
# Authors : OriginalWij - Item Pop-Up
# : Khai - Item Found (http://ktbanh.wordpress.com/)
# : Eccid - Item Popup/Item Found Integration and Modification
#------------------------------------------------------------------------------
# Versions : 1.0 - Item Pop-Up (Inital Release)
# : 1.3 - Item Found (Final Release of Version Used)
# : 1.0 - Item Popup/Item Found Integration and Modification
# (Initial Release)
#==============================================================================
# Description :
# - This script (when both scripts are activated) makes the item icon pop out
# from the chest and calls a box containing the item icon (when activated)
# along with the number recieved and name of an item, when a chest is
# specified by a comment box containing the "CHEST_WORD"
#------------------------------------------------------------------------------
# Features :
# - Easy to use
# - No call scripts needed to add items, uses the program default commands
# - Customizable call word used to specify chests
# - Almost completely customizable
# - Works when adding or subtracting items
#------------------------------------------------------------------------------
# How to Install :
# - Place both parts of the script in the "Materials" section above main
# - If you already have either script, it is reccomended you delete them
# or they could cause compatability issues
#------------------------------------------------------------------------------
# How to Use :
# - Make a comment at the beginning of your chest event containing what is
# set as the CHEST_WORD without the quotations around it ("CHEST" by
# default)
# - Use the add item, weapon, armor or gold commands from the event commands
# menu in the editor
# - When adding multiple items, insert a WAIT(1) between them
# - To make a message stating the chest is empty, make a comment containing
# the EMPTY_CHEST_WORD ("EMPTY" by default)
# NOTE: This is useful to put in the last page of a chest event (after
# the chest has been opened)
#------------------------------------------------------------------------------
# - As well, you may use the item found window on its own by using the
# script command "chest(type, index, amount, true)" (without quotations)
# - type (0-3)
# 0 = Gold
# 1 = Item
# 2 = Weapon
# 3 = Armor
#
# - index (Item Number)
#
# - amount (Number Recieved)
#
# - true (leave it true, it specifies the script called by an event)
#
# - Note: Using the call script also puts the item in your inventory,
# so there is no need to add it manually
#------------------------------------------------------------------------------
# Compatability Issues :
# - Anaryu's Particle Engine VX no longer seems to be affected by nor affects
# either of these script
#------------------------------------------------------------------------------
# Terms and Conditions :
# - Free to use as long as authors are credited
#------------------------------------------------------------------------------
# Credits :
# - OriginalWij (Item Pop-Up)
# - Khai (Item Found)(http://ktbanh.wordpress.com/)
# - Eccid (Item Popup/Item Found Integration and Modification)
#==============================================================================
# - PM me if you can think of more ways to make this customizable
#==============================================================================
#------------------------------------------------------------------------------
#==============================================================================
# ▼ CUSTOMIZATION AREA ▼
#------------------------------------------------------------------------------
# Which scripts to use
USE_ITEM_POPUP = true
USE_ITEM_FOUND = true # You could set them both to false... but why?
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#[iTEM POPUP DEFINITIONS]
# "Gold" icon index
GOLD_ICON = 205
# Word used in a comment to specify an event is a chest
CHEST_WORD = "CHEST"
# Word used in a comment to specify an event is an empty chest
EMPTY_CHEST_WORD = "EMPTY"
# Choose if an icon pops-up for each multiple of the same item
MULTIPLE_ITEMS = false
# Choose to play sound on item popup
PLAY_POP_UP_SOUND = false
# Item Popup sound Settings
POPUP_SOUND = "Chime2"
POPUP_SOUND_VOLUME = 100
POPUP_SOUND_PITCH = 150
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#[iTEM FOUND WINDOW DEFINITIONS]
# Message to be shown when an item is gained
# (String states: [number recieved] [item name] MSG_ADD ex. 3 Potions Recieved)
MSG_ADD = "Ricevuto"
# Message to be shown when an item is lost
# (String states: [number removed] [item name] MSG_REMOVE ex. 25 Cards Lost)
MSG_REMOVE = "Lost"
# Message to be shown when a chest is empty
MSG_EMPTY = "The chest is empty"
# Windowskin to be used for the item found window
MSG_WINDOWSKIN = "Window"
# Text color number (0-31) corresponding to the color library in the
# bottom right-hand corner of the windowskin used
MSG_COLOR = 14
# Use an icon for gold in the icon window instead of a symbol("G" by default)
USE_GOLD_ICON = true
# Icon to use if above is true
GOLD_ICON = 205
# Don't show the icon window next to the item found window
NO_ICON_WINDOW = false
# Choose to play sound on item found window
PLAY_FOUND_WINDOW_SOUND = true
# Item Found sound settings
ITEM_GAIN = "Saint5"
GOLD_GAIN = "Saint5"
ITEM_REMOVE = "Saint5"
GOLD_REMOVE = "Saint5"
FOUND_SOUND_VOLUME = 100
FOUND_SOUND_PITCH = 100
#------------------------------------------------------------------------------
# ▲ END OF CUSTOMIZATION AREA ▲
#==============================================================================
CHEST_DATA = []#<-DO NOT ALTER OR DELETE!(Or you'll regret it. HINT:Papa Smurf)
#==============================================================================
Va in conflitto con l'HUD del Time System di The Sleeping Leonhart
# Versione: 1.0
# Data di rilascio: 12/02/2009
#------------------------------------------------------------------------------
# Descrzione:
# Questo script permette di avere un Hud per visualizzare il tempo del Time System
#------------------------------------------------------------------------------
# Versione:
# 1.0 (12/02/2009): Versione Base.
#------------------------------------------------------------------------------
# Istruzioni:
# Inserire sotto il Time System e sotto il Weather System.
# Per forzare lo stato dell'hud usare lo script:
# $scene.show_time_hud(true/false)
# Per personalizzare lo script andate nella sezione Configurazione.
#==============================================================================
#==============================================================================
# Configurazione
#=============================================================================
module Time_Hud
#=========================================================================
# DateSeparetor: Imposta il carattere che separa la data
#-------------------------------------------------------------------------
# Sintassi:
# DateSeparetor = char
# Parametri:
# char: carattere di separazione
#=========================================================================
DateSeparetor = "/"
#=========================================================================
# TimeSeparetor: Imposta il carattere che separa il tempo
#-------------------------------------------------------------------------
# Sintassi:
# TimeSeparetor = char
# Parametri:
# char: carattere di separazione
#=========================================================================
TimeSeparetor = ":"
#=========================================================================
# DateType: Imposta il tipo di data visualizzata
#-------------------------------------------------------------------------
# Sintassi:
# DateType = type
# Parametri:
# type: 0) Giorno/Mese/Anno 1) NomeGiorno Giorno NomeMese Anno
#=========================================================================
DateType = 1
#=========================================================================
# TimeType: Imposta il tipo di tempo visualizzato
#-------------------------------------------------------------------------
# Sintassi:
# TimeType = type
# Parametri:
# type: 0) Ora:Minuti:Secondi 1) Ora:Minuti:Second AM/PM
#=========================================================================
TimeType = 1
#=========================================================================
# Position: Imposta la posizione della finestra
#-------------------------------------------------------------------------
# Sintassi:
# Position = [x, y]
# Parametri:
# x: coordinata x
# y: coordinata y
#=========================================================================
Position = [0, 0]
#=========================================================================
# Show...: Imposta la visibilità di data, tempo, secondi, stagion, meteo
#-------------------------------------------------------------------------
# Sintassi:
# Show... = bool
# Parametri:
# bool: true visible, false non visibile
#=========================================================================
ShowDate = true
ShowTime = true
ShowSecond = false
ShowSeason = false
ShowWeather = false
#=========================================================================
# Opacity: Imposta l'opacità dello sfondo della finestra
#-------------------------------------------------------------------------
# Sintassi:
# Opacity = n
# Parametri:
# n: numero da 0(invisibile) a 255(completamente visibile)
#=========================================================================
Opacity = 0
#=========================================================================
# Button: Imposta il bottone da premere per visualizzare l'HUD
#-------------------------------------------------------------------------
# Sintassi:
# Button = Input::costante
# Parametri:
# costante: DOWN LEFT RIGHT UP A B C X Y Z L R SHIFT CTRL ALT F5 F6 F7 F8 F9
#=========================================================================
Button = Input::SHIFT
#=========================================================================
# Button: Imposta l'immagine di sfondo dell'HUD
#-------------------------------------------------------------------------
# Sintassi:
# BGImage = image
# Parametri:
# image: nome dell'immagine contenuta nella cartella pictures, per non usarla scrivere ""
#=========================================================================
BGImage = "time-hud"
end
class Game_Time
def time(type = 0, second = false)
ss = sprintf("%02d", @second)
mm = sprintf("%02d", @minute)
t = ""
if type == 0
hh = sprintf("%02d", @hour)
else
if @hour > 12
hh = sprintf("%02d", (@hour - 12))
t = " PM"
else
hh = sprintf("%02d", @hour)
t = " AM"
end
end
sep = Time_Hud::TimeSeparetor
if second
return hh+sep+mm+sep+ss+t
else
return hh+sep+mm+t
end
end
def date(type = 0)
dd = @day.to_s
yy = @year.to_s
if type == 0
mm = @month.to_s
sep = Time_Hud::DateSeparetor
return dd+sep+mm+sep+yy
else
dn = Time_System::Day[@day_name_index]
mm = Time_System::Month[@month - 1]
sep = " "
return dn+sep+dd+sep+mm+sep+yy
end
end
end
class Window_TimeHud < Window_Base
def initialize
height = 32
height += 24 if Time_Hud::ShowDate
height += 24 if Time_Hud::ShowTime
height += 24 if Time_Hud::ShowSeason || Time_Hud::ShowWeather
super(Time_Hud::Position[0], Time_Hud::Position[0], 224, height)
self.opacity = Time_Hud::Opacity
@sprite = Sprite.new
@sprite.bitmap = Time_Hud::BGImage != "" ? Cache.picture(Time_Hud::BGImage) : Bitmap.new(32, 32)
@sprite.visible = self.visible
@sprite.x = self.x
@sprite.y = self.y
@sprite.z = self.z - 1
@time = 0
refresh
end
def refresh
self.contents.clear
y = -4
if Time_Hud::ShowDate
self.contents.draw_text(4, y, 184, 32, $game_time.date(Time_Hud::DateType))
y += 24
end
if Time_Hud::ShowTime
self.contents.draw_text(4, y, 184, 32, $game_time.time(Time_Hud::TimeType, Time_Hud::ShowSecond))
y += 24
end
x = 4
if Time_Hud::ShowSeason
self.contents.draw_text(x, y, 184, 32, $game_time.season)
x += self.contents.text_size($game_time.season).width + 4
end
if Time_Hud::ShowWeather
self.contents.draw_text(x, y, 184, 32, $game_time.weather)
end
end
def dispose
super
@sprite.bitmap.dispose
@sprite.dispose
end
def update
super
@time += 1
@sprite.visible = self.visible
if @time >= (Graphics.frame_rate / $game_time.speed)
refresh
@time = 0
end
end
end
class Scene_Map
alias tsltmhud_scnmp_strt start
def start
tsltmhud_scnmp_strt
@time_hud_window = Window_TimeHud.new
end
alias tsltmhud_scnmp_pdt update
def update
tsltmhud_scnmp_pdt
if @time_hud_window.visible
@time_hud_window.update
end
if Input.trigger?(Time_Hud::Button)
show_time_hud(!@time_hud_window.visible)
end
end
alias tsltmhud_scnmp_trmnt terminate
def terminate
tsltmhud_scnmp_trmnt
@time_hud_window.dispose
end
def show_time_hud(show)
@time_hud_window.visible = show
@time_hud_window.update
end
end
class Game_Time
attr_accessor :hud_visibility
end
o meglio vanno in conflitto quando inserisco questo richiama script per abilitare\disabilitare l'HUD
c'è un modo per fixare la cosa?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now