-
Posts
1,288 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Posts posted by giver
-
-
Personalmente, non uso alias negli script per me stesso, quindi non sapevo del problema del Tasto F12, mai usato nel testare gli script altrui, e quando provai la soluzione, aggiungendo l'unless, gli alias, che senza non danno problemi, davano errore finchè non li mettevo appunto tra parentesi, ma forse mettevo anche la parola alias tra parentesi . . .
Finchè non potrò ricominciare a testare, credo che non userò più l'unless come modificatore, quindi scriverò
unless $@ alias nomealias metodoaliasato end
-
L'unico problema che dovrebbe dare, in teoria è cercare di usare il valore in una draw_text senza trasformarlo temporaneamente in stringa, con .to_s, cosa che nel VX viene fatta in automatico, mentre con l'XP va fatto con tutte le variabili contenenti valori non stringa . . . Ma questo è risaputo da eoni (basta guardare TUTTI gli script di un progetto nuovo che "disegnano testo" numerico) . . . Non ho idea se sia compatibile col VX, non ho controllato la documentazione (non ho il VX e neppure l'ACE) . . .
EDIT - Aggiunto il testo in blu . . .
Tra l'altro, nel VX, Game_Party deriva da Game_Unit . . .
-
Prova a guardare QUI . . .
-
Non so se è ciò che ti serve, nè se funzioni effettivamente . . .
# SIMPLE KILL COUNT by giver # # Per sapere il numero di uccisioni inflitte ad un tipo di nemico # $game_party.kills[iD_NEMICO_NEL_DATABASE] # Es. (call) script per mettere in una variabile evento le uccisioni totali di un nemico # $game_variables[iD_VARIABILE] = $game_party.kills[iD_NEMICO_NEL_DATABASE] # quindi, un (call) script # $game_variables[46] = $game_party.kills[24] # mette il numero di uccisioni inflitte al nemico 24 nella variabile-evento 46 # class Game_Party # attr_reader :kills # (alias giver_killcount_gpty_iniz initialize) unless $@ # def initialize giver_killcount_gpty_iniz @kills = {} @kills.default = 0 end # end # class Game_Enemy < Game_Battler # def hp=(valore) super(valore) if self.dead? unless @dead @dead = true $game_party.kills[@enemy_id] += 1 end else @dead = false end end # enddovrebbe dare errore se usato con salvataggi precedenti al suo inserimento, quindi testare con nuova partita o evento di battaglia durante un Battle Test del DataBase . . .
-
Basta che scegli uno dei comandi legati ai membri del party, e scorrendo col cursore le mini-schede te li fa vedere tutti, man mano che scendi . . . Almeno credo . . .
-
Posto qua invece che nella discussione aperta da Zosimos . . .
Questa versione modificata, non testata,, permette di usare un'immagine come fondale dell'alchemy, anche contemporaneamente alla mappa . . .
Le parti aggiunte sono contrassegnate da AGGIUNTA e/o da giver, sotto commento, per vedere come implementarle anche altrove . . .
#============================================================================== # ** Alchemy Pot #------------------------------------------------------------------------------ # Autore: The Sleeping Leonhart # Versione: 1.4 # Data di rilascio: 10/07/2010 #------------------------------------------------------------------------------ # Descrzione: # Questo script simula il pentolone alchemico di Dragon Quest VIII. # Per chi non lo conoscesse il pentolone alchemico permette di "buttare" # nel pentolone oggetti per crearne uno nuovo. #------------------------------------------------------------------------------ # Versione: # 1.0 (06/12/2008): Versione Base. # 1.1 (06/12/2008): Aggiunta la possibilità di ottenere oggetti da formule errate. # 1.2 (08/12/2008): Fixato un Bug bug nella item window. # Ora si possono visualizzare immediatamente i risultati. # 1.3 (09/12/2008): Aggiunto un indicatore del tempo residuo. # Aggiunto filtro per gli ingredienti inutilizzabili # 1.4 (10/07/2010): Bugfix. # # giver 1.4.1 (datecode 20120719.1102): Aggiunto uso immagine come background # anche contemporaneo alla mappa come fondale #------------------------------------------------------------------------------ # Istruzioni: # Per chiamare il pentolone usate il comando script degli eventi ed inserite: # $scene = Scene_AlchemyPot.new # Premere A per passare dalla finestra di conferma a quella degli oggetti e viceversa. # Per personalizzare lo script andate nella sezione Configurazione e Vocabolario. #============================================================================== #============================================================================== # Configurazione #============================================================================= module AlchemyPot #=====Non Toccare========================================================= i = load_data("Data/Items.rxdata") w = load_data("Data/Weapons.rxdata") a = load_data("Data/Armors.rxdata") #========================================================================= #========================================================================= # Formula: Imposta le formule del pentolone. #------------------------------------------------------------------------- # Sintassi: # Formula[iId1, ...] = [iId2, time] # Parametri: # iId1: id degli ingredienti, usate i[id] per gli oggetti, w[id] per le armi, # a[id] per le armature. id è il numero dell'oggetto nel database. # iId2: id dell'oggetto ottenuto, usate i[id] per gli oggetti, w[id] per le armi, # a[id] per le armature. id è il numero dell'oggetto nel database. # time: numero di minuti richiesti per la ricetta. #========================================================================= Formula = {} Formula[[i[1], i[1]]] = [i[2], 0.02] Formula[[i[1], w[1]]] = [w[2], 0] Formula[[a[1], w[2]]] = [a[2], 4] Formula[[i[1], i[1], i[1]]] = [i[3], 1] Formula[[i[1], i[1], i[1], i[1], i[1]]] = [i[8], 1] #========================================================================= # UnusableItem: Definisce gli ingredienti non usabili nel pentolone #------------------------------------------------------------------------- # Sintassi: # UnusableItem = [iId, ...] # Parametri: # iId: id degli ingredienti, usate i[id] per gli oggetti, w[id] per le armi, # a[id] per le armature. id è il numero dell'oggetto nel database. #========================================================================= UnusableItem = [i[3], w[5], a[4]] #========================================================================= # MaxItem: Numero massimo di oggetti inserbili nel pentolone. #------------------------------------------------------------------------- # Sintassi: # MaxItem = n # Parametri: # n: Numero massimo di oggetti inserbili nel pentolone. #========================================================================= MaxItem = 5 #========================================================================= # FailureItem: Imposta gli oggetti ricevuti con formule sbagliate #------------------------------------------------------------------------- # Sintax: # FailureItem = [iId, ...] # Parameter: # iId: id dell'oggetto ottenuto, usate i[id] per gli oggetti, w[id] per le armi, # a[id] per le armature. id è il numero dell'oggetto nel database. #========================================================================= FailureItem = [i[1], w[4], a[5]] #========================================================================= # FailureTime: Imposta il tempo per ottenere l'oggetto sbagliato #------------------------------------------------------------------------- # Sintax: # FailureItem = time # Parameter: # time: numero di minuti richiesti per la ricetta. #========================================================================= FailureTime = 1 #========================================================================= # MapBG: Imposta la mappa come background #------------------------------------------------------------------------- # Sintassi: # MapBG = b # Parametri: # b: true per impostare la mappa come primo background, false per il background nero. #========================================================================= MapBG = false #======================= AGGIUNTA by giver ======================= # Mettere tra le virgolette il nome di un'immagine della cartella Picture # da usare come secondo beckground SOVRAPPOSTO al primo # Se non si inserisce nulla tra virgolette, il secondo background risulterà trasparente ImageBG = "" # Opacità dell'immagine usata come secondo background (da 1 a 255) ImageBG_op = 255 # Opacità della skin delle finestre nella Scene (da 0 per invisibile, 255 per solidamente opaca) W_op = 160 #======================= FINE AGGIUNTA by giver ================== #========================================================================= # TimeMeter: Imposta le immagini della barra del tempo #------------------------------------------------------------------------- # Sintassi: # TimeMeter = [emptymeter, fullmeter] o nil # Parametri: # emptymeter = picture che rappresenta la barra del tempo vuota # fullmeter = picture che rappresenta la barra del tempo piena # nil = mettere nil per non visualizzare la barra del tempo #========================================================================= TimeMeter = ["MeterEmpty", "MeterFull"] end #============================================================================== # Vocabolario #============================================================================= module Vocab #Pulsante di Conferma AlchemyPotGo = "Avvia" #Pulsante di uscita AlchemyPotExit = "Esci" #Formula Corretta AlchemyPotRightFormula = "Credo che possa funzionare!" #Formula Inesistente AlchemyPotWrongFormula = "Non credo che possa funzionare!" #Ricetta Terminata AlchemyPotFormulaFinished = "La ricetta è pronta!" #Ricetta non Terminata AlchemyPotFormulaNotFinished = "La ricetta non è ancora pronta!" #Oggetto ottenuto AlchemyPotObtained = "Hai ottenuto:" end class Game_Party attr_accessor :alchemy_pot alias tslalchemypot_gameparty_initialize initialize def initialize tslalchemypot_gameparty_initialize @alchemy_pot = [] end end class Window_Base def draw_graphical_bar(x, y, barravuota, barrapiena, corrente, max) barra_vuota = Bitmap.new("Graphics/Pictures/"+barravuota) barra_piena = Bitmap.new("Graphics/Pictures/"+barrapiena) taglio = corrente.to_f / max.to_f cwp = barra_piena.width cwv = barra_vuota.width chp = barra_piena.height chv = barra_vuota.height taglio = taglio*cwp src_rect = Rect.new(0, 0, taglio, chp) self.contents.blt(32+x-cwp/4, 18+y-chp/2, barra_piena, src_rect) src_rect = Rect.new(taglio, 0, cwv-taglio, chv) self.contents.blt(32+x-cwv/4+taglio, 18+y-chv/2, barra_vuota, src_rect) end end class Window_AlchemyPotItem < Window_Selectable def initialize super(32, 96, 312, 312) @column_max = 10 self.index = 0 refresh end def item return @data[self.index] end def enable?(item) return $game_party.item_can_use?(item) end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for item in $data_items if $game_party.item_number(item.id) > 0 and item != nil @data.push(item) if check(item) end end for item in $data_weapons if $game_party.weapon_number(item.id) > 0 and item != nil @data.push(item) if check(item) end end for item in $data_armors if $game_party.armor_number(item.id) > 0 and item != nil @data.push(item) if check(item) end end @item_max = @data.size @row_max = @data.size / 10 if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 28) for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end x = index % @column_max * 28 y = index / @column_max * 28 rect = Rect.new(x, y, 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24)) self.contents.font.size = 12 self.contents.draw_text(12 + x, 8 + y, 24, 24, number.to_s) end def update_help @help_window.set_text(item == nil ? "" : item.name) end def page_row_max return (self.height - 32) / 28 end def top_row return self.oy / 28 end def top_row=(row) super self.oy = row * 28 end def update_cursor_rect super x = @index % @column_max * 28 y = @index / @column_max * 28 - self.oy self.cursor_rect.set(x, y, 24, 24) end def check(item) for i in AlchemyPot::UnusableItem if i.id == item.id and i.class == item.class return false end end return true end end class Window_AlchemyPotPot < Window_Base def initialize super(454, 96, 28 + 32, 28 * AlchemyPot::MaxItem + 32) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh(pot = []) self.contents.clear @data = pot.clone @data.push(nil) if @data == [] @item_max = @data.size for i in 0...@item_max draw_item(i) end end def draw_item(index) item = @data[index] if item != nil y = index * 28 bitmap = RPG::Cache.icon(item.icon_name) self.contents.blt(0, y, bitmap, Rect.new(0, 0, 24, 24)) end end end class Window_AlchemyPotResult < Window_Base def initialize super(0, 192, 320, 64) self.contents = Bitmap.new(width - 32, height - 32) self.width = [self.contents.text_size(Vocab::AlchemyPotObtained).width + 240, 640].min self.contents = Bitmap.new(width - 32, height - 32) self.x = 272 - self.width / 2 refresh end def refresh(item = nil) self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(0, 4, self.width - 64, 24, Vocab::AlchemyPotObtained) draw_item_name(item, self.contents.text_size(Vocab::AlchemyPotObtained).width + 2, 0) end end class Window_PotTimeMeter < Window_Base def initialize(a = 0) super(420, 400, 192, 64) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 refresh(a) end def refresh(a) if AlchemyPot::TimeMeter != nil self.contents.clear a = 0 if a == nil b = $game_party.alchemy_pot[2] b = (Graphics.frame_count - a) * 100 if b == nil b += 1 if b == 0 draw_graphical_bar(0, 0, AlchemyPot::TimeMeter[0], AlchemyPot::TimeMeter[1], Graphics.frame_count-a, b) end end end class Scene_AlchemyPot def main @map = Spriteset_Map.new if AlchemyPot::MapBG #======================= AGGIUNTA by giver ======================= unless AlchemyPot::ImageBG == "" @bg = Sprite.new @bg.bitmap = RPG::Cache.picture(AlchemyPot::ImageBG) @bg.opacity = AlchemyPot::ImageBG_op @bg.z += 10 end #======================= FINE AGGIUNTA by giver ================== create_command_window @help_window = Window_Help.new #======================= AGGIUNTA by giver ======================= @help_window.opacity = AlchemyPot::W_op #======================= FINE AGGIUNTA by giver ================== @item_window = Window_AlchemyPotItem.new #======================= AGGIUNTA by giver ======================= @item_window.opacity = AlchemyPot::W_op #======================= FINE AGGIUNTA by giver ================== @item_window.help_window = @help_window @pot_window = Window_AlchemyPotPot.new #======================= AGGIUNTA by giver ======================= @pot_window.opacity = AlchemyPot::W_op #======================= FINE AGGIUNTA by giver ================== @result_window = Window_AlchemyPotResult.new #======================= AGGIUNTA by giver ======================= @result_window.opacity = AlchemyPot::W_op #======================= FINE AGGIUNTA by giver ================== @result_window.visible = false @meter = Window_PotTimeMeter.new($game_party.alchemy_pot[1]) @ready = false if $game_party.alchemy_pot != [] if $game_party.alchemy_pot[0][0] == "Wrong" @ingredients = $game_party.alchemy_pot[0][1].clone item = AlchemyPot::FailureItem[rand(AlchemyPot::FailureItem.size)] else @ingredients = $game_party.alchemy_pot[0].clone item = AlchemyPot::Formula[find_recipe(@ingredients)][0] end @pot_window.refresh(@ingredients) @item_window.active = false if Graphics.frame_count - $game_party.alchemy_pot[1] >= $game_party.alchemy_pot[2] @help_window.set_text(Vocab::AlchemyPotFormulaFinished) case item when RPG::Item $game_party.gain_item(item.id, 1) when RPG::Weapon $game_party.gain_weapon(item.id, 1) when RPG::Armor $game_party.gain_armor(item.id, 1) end @result_window.refresh(item) $game_party.alchemy_pot = [] @ready = true else @help_window.set_text(Vocab::AlchemyPotFormulaNotFinished) end else @ingredients = [] end Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @map.dispose if AlchemyPot::MapBG #======================= AGGIUNTA by giver ======================= unless @bg.nil? @bg.bitmap.dispose @bg.dispose end #======================= FINE AGGIUNTA by giver ================== @command_window.dispose @help_window.dispose @item_window.dispose @pot_window.dispose @result_window.dispose @meter.dispose end def update @help_window.update @command_window.update @item_window.update @pot_window.update @result_window.update @meter.update if @command_window.active update_command_selection elsif @item_window.active update_item_selection elsif @ready and @result_window.visible == false if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) @result_window.visible = true @result_window.z = 105 return end elsif @result_window.visible if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) @ingredients = [] @ready = false @result_window.visible = false @item_window.active = true @item_window.refresh @pot_window.refresh return end else if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $scene = Scene_Map.new end end if $game_party.alchemy_pot[1] != nil @meter.refresh($game_party.alchemy_pot[1]) if Graphics.frame_count - $game_party.alchemy_pot[1] >= $game_party.alchemy_pot[2] $scene = Scene_AlchemyPot.new end end end def create_command_window s1 = Vocab::AlchemyPotGo s2 = Vocab::AlchemyPotExit @command_window = Window_Command.new(96, [s1, s2]) @command_window.active = false @command_window.x = 430 @command_window.y = 304 end def update_item_selection if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) if @ingredients == [] $scene = Scene_Map.new else pop = @ingredients.pop case pop when RPG::Item $game_party.gain_item(pop.id, 1) when RPG::Weapon $game_party.gain_weapon(pop.id, 1) when RPG::Armor $game_party.gain_armor(pop.id, 1) end @item_window.refresh @pot_window.refresh(@ingredients) end elsif Input.trigger?(Input::C) if @ingredients.size < AlchemyPot::MaxItem and @item_window.item != nil $game_system.se_play($data_system.decision_se) item = @item_window.item @ingredients.push(item) case item when RPG::Item $game_party.gain_item(item.id, -1) when RPG::Weapon $game_party.gain_weapon(item.id, -1) when RPG::Armor $game_party.gain_armor(item.id, -1) end @item_window.refresh @pot_window.refresh(@ingredients) else $game_system.se_play($data_system.buzzer_se) end elsif Input.trigger?(Input::A) $game_system.se_play($data_system.decision_se) @item_window.active = false @command_window.active = true end end def update_command_selection if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) exit elsif Input.trigger?(Input::C) case @command_window.index when 0 if @ingredients.size > 1 $game_system.se_play($data_system.decision_se) start_alchemy else $game_system.se_play($data_system.buzzer_se) end when 1 $game_system.se_play($data_system.decision_se) exit end elsif Input.trigger?(Input::A) $game_system.se_play($data_system.decision_se) @item_window.active = true @command_window.active = false end end def exit for item in @ingredients case item when RPG::Item $game_party.gain_item(item.id, 1) when RPG::Weapon $game_party.gain_weapon(item.id, 1) when RPG::Armor $game_party.gain_armor(item.id, 1) end end $scene = Scene_Map.new end def start_alchemy rec = find_recipe(@ingredients) if rec != nil && AlchemyPot::Formula[rec] != nil @help_window.set_text(Vocab::AlchemyPotRightFormula) $game_party.alchemy_pot[0] = rec.clone $game_party.alchemy_pot[1] = Graphics.frame_count $game_party.alchemy_pot[2] = AlchemyPot::Formula[rec][1] * Graphics.frame_rate * 60 @command_window.active = false return end @help_window.set_text(Vocab::AlchemyPotWrongFormula) if AlchemyPot::FailureItem.size > 0 $game_party.alchemy_pot[0] = ["Wrong", @ingredients.clone] $game_party.alchemy_pot[1] = Graphics.frame_count $game_party.alchemy_pot[2] = AlchemyPot::FailureTime * Graphics.frame_rate * 60 @command_window.active = false return else for item in @ingredients case item when RPG::Item $game_party.gain_item(item.id, 1) when RPG::Weapon $game_party.gain_weapon(item.id, 1) when RPG::Armor $game_party.gain_armor(item.id, 1) end end @ingredients = [] @item_window.refresh @pot_window.refresh(@ingredients) end end def find_recipe(items) for i in AlchemyPot::Formula.keys formula = item_sort(i) ingredients = item_sort(items) if formula == ingredients return i end end end def item_sort(formula) i = []; w = []; a = [] for item in 0...formula.size i.push(formula[item].id) if formula[item].is_a?(RPG::Item) w.push(formula[item].id) if formula[item].is_a?(RPG::Weapon) a.push(formula[item].id) if formula[item].is_a?(RPG::Armor) end a.sort!; i.sort!; w.sort! formula = [] for type in [i, w, a] for item in type formula.push($data_items[item]) if type == i formula.push($data_weapons[item]) if type == w formula.push($data_armors[item]) if type == a end end end endEDIT - Adesso anche con opacità della skin delle finestre impostabile in configurazione, che me ne ero dimenticato . . .
-
Prego . . . Ma riguardando il codice, perchè mi sembrava di aver dimenticato qualcosa (Il ritorno di Scene_End al comando corretto del menù), mi sono accorto che le icone andavano anch'esse abbassate come la finestra comandi, quindi ho corretto il codice postato sopra . . .
-
Non è testato, ma dovrebbe funzionare . . .
#============================================================================== # ** Nortos # Nortos Beyond CMS Version # Version 1.0b #============================================================================== BG_item = 'item' BG_skill = 'skill' BG_equip = 'equip' BG_status = 'status' BG_save = 'save' class Scene_Menu # Venendo a mancare LOAD, la finestra comandi è più bassa # Il valore sottostante la sposta verso il basso di mezza riga WC_OY = 16 end BG_exit = 'exit' BG_location = 'location' BG_playtime = 'time' BG_gold = 'gold' #============================================================================== # ** Window_Selectable #------------------------------------------------------------------------------ # This window class contains cursor movement and scroll functions. #============================================================================== class Window_Selectable1 < Window_Base #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :index # cursor position attr_reader :help_window # help window #-------------------------------------------------------------------------- # * Object Initialization # x : window x-coordinate # y : window y-coordinate # width : window width # height : window height #-------------------------------------------------------------------------- def initialize(x, y, width, height) super(x, y, width, height) @item_max = 1 @column_max = 1 @index = -1 end #-------------------------------------------------------------------------- # * Set Cursor Position # index : new cursor position #-------------------------------------------------------------------------- def index=(index) @index = index # Update Help Text (update_help is defined by the subclasses) if self.active and @help_window != nil update_help end # Update cursor rectangle update_cursor_rect end #-------------------------------------------------------------------------- # * Get Row Count #-------------------------------------------------------------------------- def row_max # Compute rows from number of items and columns return (@item_max + @column_max - 1) / @column_max end #-------------------------------------------------------------------------- # * Get Top Row #-------------------------------------------------------------------------- def top_row # Divide y-coordinate of window contents transfer origin by 1 row # height of 32 return self.oy / 32 end #-------------------------------------------------------------------------- # * Set Top Row # row : row shown on top #-------------------------------------------------------------------------- def top_row=(row) # If row is less than 0, change it to 0 if row < 0 row = 0 end # If row exceeds row_max - 1, change it to row_max - 1 if row > row_max - 1 row = row_max - 1 end # Multiply 1 row height by 32 for y-coordinate of window contents # transfer origin self.oy = row * 32 end #-------------------------------------------------------------------------- # * Get Number of Rows Displayable on 1 Page #-------------------------------------------------------------------------- def page_row_max # Subtract a frame height of 32 from the window height, and divide it by # 1 row height of 32 return (self.height - 32) / 32 end #-------------------------------------------------------------------------- # * Get Number of Items Displayable on 1 Page #-------------------------------------------------------------------------- def page_item_max # Multiply row count (page_row_max) times column count (@column_max) return page_row_max * @column_max end #-------------------------------------------------------------------------- # * Set Help Window # help_window : new help window #-------------------------------------------------------------------------- def help_window=(help_window) @help_window = help_window # Update help text (update_help is defined by the subclasses) if self.active and @help_window != nil update_help end end #-------------------------------------------------------------------------- # * Update Cursor Rectangle #-------------------------------------------------------------------------- def update_cursor_rect # If cursor position is less than 0 if @index < 0 self.cursor_rect.empty return end # Get current row row = @index / @column_max # If current row is before top row if row < self.top_row # Scroll so that current row becomes top row self.top_row = row end # If current row is more to back than back row if row > self.top_row + (self.page_row_max - 1) # Scroll so that current row becomes back row self.top_row = row - (self.page_row_max - 1) end # Calculate cursor width cursor_width = self.width / @column_max - 32 # Calculate cursor coordinates x = @index % @column_max * (cursor_width + 32) y = @index / @column_max * 32 - self.oy # Update cursor rectangle self.cursor_rect.set(x, y, cursor_width, 32) end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super # If cursor is movable if self.active and @item_max > 0 and @index >= 0 # If the right directional button was pressed if Input.repeat?(Input::LEFT) # If column count is 2 or more, and cursor position is closer to front # than (item count -1) if (@column_max == 1 and Input.trigger?(Input::RIGHT)) or @index >= @column_max # Move cursor up $game_system.se_play($data_system.cursor_se) @index = (@index - @column_max + @item_max) % @item_max end end # If the left directional button was pressed if Input.repeat?(Input::RIGHT) # If column count is 2 or more, and cursor position is more back than 0 if (@column_max == 1 and Input.trigger?(Input::LEFT)) or @index < @item_max - @column_max # Move cursor down $game_system.se_play($data_system.cursor_se) @index = (@index + @column_max) % @item_max end end end # Update help text (update_help is defined by the subclasses) if self.active and @help_window != nil update_help end # Update cursor rectangle update_cursor_rect end end class Window_Base < Window def fc face = RPG::Cache.picture("") end def draw_fc(actor,x,y) face = RPG::Cache.picture(actor.name + "_fc") rescue fc fw = face.width fh = face.height src_rect = Rect.new(0, 0, fw, fh) self.contents.blt(x , y - fh, face, src_rect) end end class Window_PlayTime < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.name = "Tahoma" self.contents.font.size = 15 self.contents.font.color = system_color self.contents.draw_text(4, 0, 120, 32, "Tempo:") @total_sec = Graphics.frame_count / Graphics.frame_rate hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 text = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.draw_text(4, 0, 122, 32, text, 2) end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end #-------------------------------------------------------------------------- # * Window Location #-------------------------------------------------------------------------- class Window_Location < Window_Base def initialize super(0, 0, 300, 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = "Tahoma" self.contents.font.size = 14 refresh end def refresh self.contents.clear data = load_data("Data/MapInfos.rxdata") self.contents.font.color = system_color self.contents.draw_text(0, 0, 248, 32, "Dove ti trovi:") self.contents.font.color = normal_color self.contents.draw_text(50, 0, 100, 32, data[$game_map.map_id].name, 2) end end #-------------------------------------------------------------------------- # * Window Gold #-------------------------------------------------------------------------- class Window_Gold < Window_Base def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear self.contents.font.name = "Tahoma" cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2) end end #-------------------------------------------------------------------------- # * Menu_Status #-------------------------------------------------------------------------- class Window_MenuStatus < Window_Selectable1 def initialize super(0, 0, 700, 100) self.contents = Bitmap.new(width - 32, height - 32) refresh self.active = false self.index = -1 end def refresh self.contents.font.name = "Tahoma" self.contents.font.size = 15 self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = i * 220 y = 0 actor = $game_party.actors[i] draw_fc(actor,x + 14,y + 53) draw_actor_name(actor, x+15, y) draw_actor_level(actor, x, y + 16) draw_actor_state(actor, x+18, y + 46) draw_actor_exp(actor, x + 50, y + 30) draw_actor_hp(actor, x + 65, y-10) draw_actor_sp(actor, x + 65, y+10) end end def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(@index * 220, 0, self.width - 480, 64) end end end #-------------------------------------------------------------------------- # * Menu Scene #-------------------------------------------------------------------------- class Scene_Menu def initialize(menu_index = 0) @menu_index = menu_index end def main @sprite = Spriteset_Map.new viewport = Viewport.new(0, 0, 640, 480) s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "Stato" s5 = "Salva" s7 = "Esci" @command_window = Window_Command1.new(110, [s1, s2, s3, s4, s5, s7]) @command_window.x = 495 + 160 @command_window.y = 40 + WC_OY @command_window.height = 257 @command_window.back_opacity = 170 @command_window.index = @menu_index # If number of party members is 0 if $game_party.actors.size == 0 # Disable items, skills, equipment, and status @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end if $game_system.save_disabled # Disable save @command_window.disable_item(4) end @window_PlayTime = Window_PlayTime.new @window_PlayTime.x = -160 @window_PlayTime.y = 300 @window_PlayTime.back_opacity = 170 @window_Gold = Window_Gold.new @window_Gold.x = -160 @window_Gold.y = 230 @window_Gold.back_opacity = 170 @window_Location = Window_Location.new @window_Location.y = 300 @window_Location.x = 344 + 290 @window_Location.back_opacity = 170 @status_window = Window_MenuStatus.new @status_window.x = -30 @status_window.y = 370 + 110 @status_window.back_opacity = 170 @item = Sprite.new @item.bitmap = RPG::Cache.icon(BG_item) @item.x = 600 + 160 @item.y = 60 + WC_OY @item.z = @item.z + 255 @skill = Sprite.new @skill.bitmap = RPG::Cache.icon(BG_skill) @skill.x = 600 + 160 @skill.y = 92 + WC_OY @skill.z = @skill.z + 255 @equip = Sprite.new @equip.bitmap = RPG::Cache.icon(BG_equip) @equip.x = 600 + 160 @equip.y = 124 + WC_OY @equip.z = @equip.z + 255 @status = Sprite.new @status.bitmap = RPG::Cache.icon(BG_status) @status.x = 600 + 160 @status.y = 156 + WC_OY @status.z = @status.z + 255 @save = Sprite.new @save.bitmap = RPG::Cache.icon(BG_save) @save.x = 600 + 160 @save.y = 188 + WC_OY @save.z = @save.z + 255 @quit = Sprite.new @quit.bitmap = RPG::Cache.icon(BG_exit) @quit.x = 600 + 160 @quit.y = 220 + WC_OY @quit.z = @quit.z + 255 @location = Sprite.new @location.bitmap = RPG::Cache.icon(BG_location) @location.x = 600 + 160 @location.y = 320 @location.z = @location.z + 255 @playtime = Sprite.new @playtime.bitmap = RPG::Cache.icon(BG_playtime) @playtime.x = -160 @playtime.y = 320 @playtime.z = @playtime.z + 255 @gold = Sprite.new @gold.bitmap = RPG::Cache.icon(BG_gold) @gold.x = -120 @gold.y = 250 @gold.z = @gold.z + 255 Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows viewport.dispose @command_window.dispose @window_PlayTime.dispose @window_Gold.dispose @window_Location.dispose @status_window.dispose @item.dispose @skill.dispose @equip.dispose @status.dispose @save.dispose @quit.dispose @gold.dispose @playtime.dispose @location.dispose @sprite.dispose end def entrance @command_window.x -= 10 if @command_window.x > 530 @window_PlayTime.x += 10 if @window_PlayTime.x < 0 @window_Location.x -= 15 if @window_Location.x > 344 @window_Gold.x += 10 if @window_Gold.x < 0 @status_window.y -= 10 if @status_window.y > 370 @item.x -= 10 if @item.x > 547 @skill.x -= 10 if @skill.x > 547 @equip.x -= 10 if @equip.x > 547 @status.x -= 10 if @status.x > 547 @save.x -= 10 if @save.x > 547 @quit.x -= 10 if @quit.x > 547 @playtime.x += 10 if @playtime.x < 70 @gold.x += 10 if @gold.x < 80 @location.x -= 10 if @location.x > 600 end def exit @command_window.x += 10 if @command_window.x < 655 @window_PlayTime.x -= 10 if @window_PlayTime.x > -160 @window_Location.x += 15 if @window_Location.x < 640 @window_Gold.x -= 10 if @window_Gold.x > -160 @status_window.y += 10 if @status_window.y < 480 @item.x += 10 if @item.x < 760 @skill.x += 10 if @skill.x < 760 @quit.x += 10 if @quit.x < 760 @equip.x += 10 if @equip.x < 760 @status.x += 10 if @status.x < 760 @save.x += 10 if @save.x < 760 @playtime.x -= 10 if @playtime.x > -160 @gold.x -= 10 if @gold.x > -160 @location.x += 10 if @location.x < 760 if @status_window.y >= 480 $scene = Scene_Map.new $game_map.autoplay return end end def update if @intro == nil entrance end if @exit == true exit @intro = false end @status_window.update @window_Gold.update @window_PlayTime.update @window_Location.update @command_window.update # If command window is active: call update_command if @command_window.active update_command return end # If status window is active: call update_status if @status_window.active update_status return end end def update_command # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) @exit = true return end # If C button was pressed if Input.trigger?(Input::C) # If command other than save or end game, and party members = 0 if $game_party.actors.size == 0 and @command_window.index < 4 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Branch by command window cursor position case @command_window.index when 0 $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new when 1 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 if $game_system.save_disabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Save.new when 5 $game_system.se_play($data_system.decision_se) $scene = Scene_End.new end return end end #-------------------------------------------------------------------------- # * Frame Update (when status window is active) #-------------------------------------------------------------------------- def update_status # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Make command window active @command_window.active = true @status_window.active = false @status_window.index = -1 return end # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 1 # skill # If this actor's action limit is 2 or more if $game_party.actors[@status_window.index].restriction >= 2 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to skill screen $scene = Scene_Skill.new(@status_window.index) when 2 # equipment # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to equipment screen $scene = Scene_Equip.new(@status_window.index) when 3 # status # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to status screen $scene = Scene_Status.new(@status_window.index) end return end end end #============================================================================== # ** Window_Command #------------------------------------------------------------------------------ # This window deals with general command choices. #============================================================================== class Window_Command1 < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization # width : window width # commands : command text string array #-------------------------------------------------------------------------- def initialize(width, commands) # Compute window height from command quantity super(0, 0, width, commands.size * 40 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) refresh self.index = 0 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i, normal_color) end end #-------------------------------------------------------------------------- # * Draw Item # index : item number # color : text color #-------------------------------------------------------------------------- def draw_item(index, color) self.contents.font.color = color rect = Rect.new(26, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index]) end #-------------------------------------------------------------------------- # * Disable Item # index : item number #-------------------------------------------------------------------------- def disable_item(index) draw_item(index, disabled_color) end end -
Roba facile perchè non è un comando che richiede la revisione di condizioni di attivazione/disattivazione . . . Ma vuoi tenere comunque la Scene_Load di questo menù in sostituzione di quella di default ?
-
Scusate l'OT . . .
Sembrate più nel tentativo di sviluppare alla Constance che nell'ottimizzare le prestazioni realizzando gli script alla ACE . . . Confusione o l'apparenza inganna ?
Ah, non c'è bisogno che rispondiate . . .
-
Ah ecco capisco, è proprio quella che poi da il problema da main modificato! D: Bene, grazie! ^ ^
No, quello avviene perchè la 101 è crackata . . .
Giusto!

Mi piace rendermi utile ;) . . .
-
Quello è un nome di variabile globale.
Come già ripetuto più volte, in altre discussioni relative all'incompatibilità dei font, la versione 1.01 non aveva i riferimenti per sapere come impostare un font diverso da quello di default non presente/leggibile nei PC occidentali . . . Quindi modificarono gli script di default affinchè usassero un font indicato da una variabile globale, la quale purtroppo non è la stessa per tutte le versioni della 1.01, per questo di solito si suggerisce di usare il Main modificato da DaD quando si incontrano problemi con i font, che copre la maggioranza, ma non tutte, le varianti della variabile globale per il nome del font . . .
Ah, mi sono accorto adesso che invece di mettere Font.default_name si potrebbe direttamente cancellare quell'istruzione, probabilmente (# ad inizio riga) . . .
-
Nello script, cerca $fontface e sostituiscilo con "MS PGothic" o "Arial" (incluse le virgolette), che sono i due più usati . . .
EDIT - Oppure, Font.default_name, così risulta uniforme in tutto il gioco . . .
-
EDIT - Ma che errore dà nei dettagli ?
Potrebbe anche essere un conflitto causato dal fatto che usi diversi sistemi di save e load contemporaneamente . . . (E due Scene_Gameover che si annullano a vicenda, per i problemi indicati nelle altre discussioni)
-
class Window_Base < Window def draw_actor_battler(actor, x, y) bitmap = RPG::Cache.picture(actor.battler_name) cw, ch = bitmap.width, bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw/2, y - ch/2, bitmap, src_rect) end endLa picture deve avere lo stesso nome dell'immagine usata come battler
-
*Perchè mi ricordo che fosse spiegato chiaramente ?*
Dovrebbe essere:
# Per salvare come checkpoint Check.point # Per caricare dall'ulrimo checkpoint Check.load
-
Prova ad incollare questo snippet sotto lo script:
class Window_Base < Window # Posizione del centro dell'immagine del Battler BT_OX = 80 BT_OY = 80 # Usa l'immagine del Battler ? Mettere false per non mostrare niente dove andrebbe il battler . . . BT_SHOW = true def draw_actor_battler(actor, x, y) bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) cw, ch = (bitmap.width / 4), (bitmap.height / 10) src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + BT_OX - cw/2, y + BT_OY - ch/2, bitmap, src_rect) if BT_SHOW end endNon ho ben presente le differenze tra l'uso del battler in questo script rispetto alla battaglia, quindi probabilmente dovrai aggiustare i due valori di centratura del Battler (BT_OX e BT_OY) . . .
Forse è troppo piccola come immagine, preferisci (è possibile, con ulteriore modifica) usare una picture, magari, invece del battler ? -
R: Direi di no. Per fermare l'esecuzione della pagina dovrebbe bastar mettere lo switch OFF . . . Ovviamente se l'unica condizione per il danno è la distanza, finchè resta a portata la pagina si riattiverà comunque . . . Le condizioni dovrebbero essere di più, ad esempio conteggiando il facing di eroe e bersaglio potenziale, la pressione di un tasto, ecc.
Gestire certe cose tramite script sarebbe un sistema ancora migliore . . .
E' un peccato, poi, che l'XP, senza modifiche agli script di base, non sia in grado di chiamare le pagine degli eventi-mappa . . . Per cose del genere, col 2000 io uso proprio la chiamata alla pagina . . . Altrimenti meglio usare eventi comuni ad hoc, che siano in grado di danneggiare qualunque bersaglio dopo averlo "individuato" . . .
-
Ma il wait è il passo del Move Route o è esterno ?
Poi, il bloccare l'eroe è meglio farlo tramite evento comune . . .
Ed invece di metterlo in Parallelo, potresti mettere ripeti movimento nella Move Route di attesa . . .
Ricordati, in questo caso, di usare una Move Route vuota per sbloccare l'eroe quando hai finito . . .
Ci dovrebbe essere da qualche parte nel forum uno snippet, sia in versione con SDK che senza, che sfrutta uno switch per attivare/disattivare il blocco dell'eroe . . .
-
Potrebbe essere
# Scrivi valore alias scrivi_valore []= def []=(indice, valore) # codice # chiamata alias scrivi_valore(indice, valore) end # Leggi valore alias leggi_valore [] def [](indice) # codice # chiamata alias leggi_valore(indice) end
Per i parametri da passare, però, è meglio se guardi il codice della classe Array (e Hash) del ruby 1.8 . . .
-
Scusate. Forse è addirittura la versione "modificata" di questo script:
-
. . . o un qualche picture drama, piuttosto . . .
-
Oppure puoi usare una "utility" che estrae sonoro dai video (Format Factory, Virtualdub Mod, VLC Media Player, Video Downloader, ecc), con cui prelevare da un filmato una traccia audio contenente il sonoro che ti serve ed importarla in Audacity per ritagliare più chirurgicamente la parte che ti è utile ed eventualmente aggiungerle effetti e rifiniture . . .
-
Non ho l'ACE, ma guardando in giro credo che capiti perchè è stato usato call (che mette nello stack) invece di goto (vai a . . .) o return (togli dallo stack)
Quindi dovresti rimediare sostituendo appunto nel codice del Quest System le due chiamate . . .
# Appare così . . . # def inputUpdate if Input.trigger?(Input::B) #Play Cancel SE Sound.play_cancel #Return to set scene if TNDqb::Return > -1 SceneManager.call(Scene_Menu) else SceneManager.call(Scene_Map) end elsif Input.trigger?(Input::C) #Play Decision SE Sound.play_ok #Refresh quest data @main.set_quest(@quest[@command_window.index]) #Goto command_refresh end end # # . . . Dovrebbe diventare così . . . # def inputUpdate if Input.trigger?(Input::B) #Play Cancel SE Sound.play_cancel #Return to set scene if TNDqb::Return > -1 SceneManager.return else SceneManager.goto(Scene_Map) end elsif Input.trigger?(Input::C) #Play Decision SE Sound.play_ok #Refresh quest data @main.set_quest(@quest[@command_window.index]) #Goto command_refresh end end
Chiedo scusa per il non poter essere più preciso . . .
Ovviamente, potrebbe non funzionare . . .

Contatore nemici
in Richieste scripts RGSS (XP)
Posted
A me, in passato, visto che sono quasi due anni che uso linux causa hard disc rotto nel fisso che ho a casa, funzionava SOLO se, aggiungendo l'unless, mettevo le parentesi, probabilmente così
invece che come nello snippet