-
Posts
655 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Posts posted by mikb89
-
-
Ok Destroya ne parliamo su skype ^^
Per quanto riguarda le informazioni non è che non voglio darle, è che magari non le scrivo nel topic, però in privato potete chiedere (:
-
Il mio solito script del mese convertito per gli altri due tool, con demo :D
FATTO
-
Non avevo visto il post D:
E nemmeno il secondo errore, ora è corretto ^^
-
Destroya, se invece di battler fossero chara andrebbe bene?
ab lo so ): non preoccuparti ^^
Per quanto riguarda l'attirare l'attenzione sì, eviterei. Un credit al forum ci sta tutto, ma per quanto riguarda il parlare del tool, il meno possibile ^^
Comunque grazie SIMO xD
-
Testament, mi hai beccato subito xD
Flame, quando puoi ne parliamo su skype ^^
-
Il titolo dice già molto ^^
Ho un cliente che mi paga per sviluppargli un gioco su di lui. Il videogame verrà pubblicizzato e tutto, ma non sarà destinato alla vendita, è più un piccolo bonus per i suoi fan.
Ora, il loro budget è molto limitato, quindi non aspettatevi pagamenti di tremila euro al mese, ma del resto non andremo a fare un gioco in 3D, ma verrà utilizzato l'RTP dell'XP. Più modifiche e aggiunte.
Il mio obiettivo è di tirare fuori qualcosa di molto bello. Oltre al fatto di guadagnare, e di lasciare il cliente felice così poi potrebbe contattarci ancora o consigliarci ad altri, c'è il fatto che il gioco sarà distribuito. È un modo per farsi conoscere.
I tempi di sviluppo saranno medi (dovremo completarlo entro dicembre), e, giusto per non terrorizzarvi, vi dico che il gioco ha sì una storia, ma non è un RPG, quindi ce la si può fare.
Che tipo di grafica serve:
- Interfacce e menu;
- Edit alle RTP (servono tile moderni);
- Personaggi da creare da zero con characters e battlers. I battler dovranno avere diverse pose ed essere animati (il grosso del lavoro è infatti questo).
FAQ:
D: Ci dai dettagli sulla trama?
R: No, voi dovete farmi la grafica, la trama non vi riguarda, né sono autorizzato a parlarne. Ove necessario ovviamente non ci sarà alcun problema a parlarvene, una volta che accetterete l'incarico ^^
D: Che garanzie di pagamento abbiamo?
R: Le stesse che ho io. Non posso darvene di più. Al massimo posso pagarvi di tasca mia quello che riesco a uscire, se davvero dovesse succedere che ci 'rubino' il lavoro.
E in quel caso sareste comunque liberi di utilizzare il materiale come vi pare, per fortuna non possono cancellarvelo dall'hard disk xD
D: Hai considerato le varie beghe legali?
R: Sì, e anche se non l'avessi fatto, non mi metterei di certo a parlarne qui ^^
Mi paro con le FAQ, per evitare che il topic degeneri ^^
Avanti con le proposte! (:
- Interfacce e menu;
-
Ok xD
(forse era meglio se lo specificavo nel primo post xD appena faccio edito :D)
-
Ti ringrazio Macha :3
-
Grazie Guardian ^^
In che senso diverse grafiche?
Per gli eventi scegli tu quali vedere tramite la lista che ti appare dalla voce aggiunta nel menu di F9 (in realtà tutto il menu è aggiunto, ma vabè xD)
-
No, soltanto sui salvataggi, e come hai detto il problema si pone solo se decidi di togliere lo script mentre makeri. Nella release finale non ci sono i salvataggi quindi non c'è problema.
-
Esatto Apo, spero questo script aiuti ^^
Grazie :3
-
Ahaha vabè, se eri a buon punto completalo ^^
Corretto l'errore, comunque, grazie :)
-
Visible Debug 1.2c
Descrizione
Capita che qualcosa vada storto fra switch e variabili. Non sai cosa succede, sai solo che non funziona come previsto. Qui entra in gioco questo script!http://img525.imageshack.us/img525/6813/visibledebugvxace.png
Funzionalità
Con questo script puoi tenere sotto controllo una lista di parametri vari i cui cambiamenti saranno mostrati in tempo reale. Questa lista include:- switch e variabili, switch locali degli eventi;
- grafica di eventi, giocatore, eroi, nemici;
- posizione e stato 'Come fantasma' di eventi e giocatore;
- id dei tile dove si trova il giocatore;
- numero di oggetti, armi, armature possedute;
- hp, mp, tp (se abilitato), atk, def, luk, agi, due stati dei combattenti;
- nomi & livello degli eroi (i nemici non li hanno);
- altre informazioni utili aggiunte dalle configurazioni (puoi vedere come sono fatte e aggiungerne di tue).
Autore
mikb89Allegati
Demo multilingua v. 1.2 (1.33 MB)Istruzioni per l'uso
Inserite lo script sotto Materials. Le istruzioni sono fra i commenti.Script
# Visible Debug v. 1.2c # VX Ace version # by mikb89 # Dettagli: # Capita che qualcosa vada storto fra switch e variabili. Non sai cosa # succede, sai solo che non funziona come previsto. # Con questo script puoi tenere sotto controllo una lista di parametri # vari i cui cambiamenti saranno mostrati in tempo reale. # Questa lista include: # - switch e variabili, switch locali degli eventi; # - grafica di eventi, giocatore, eroi, nemici; # - posizione e stato 'Come fantasma' di eventi e giocatore; # - id dei tile dove si trova il giocatore; # - numero di oggetti, armi, armature possedute; # - hp, mp, tp (se abilitato), atk, def, luk, agi, due stati dei combattenti; # - nomi & livello degli eroi (i nemici non li hanno); # - altre informazioni utili aggiunte dalle configurazioni (puoi vedere # come sono fatte e aggiungerne di tue). # Configurazioni: module VDEBUG # Lista di termini da personalizzare come si vuole: HELP_TEXT = "Invio: aggiungi/togli; Pag: cambia lista." # Aiutati! # Cosa appare alla pressione di F9: CALL_CLASSIC_DEBUG_TEXT = "Chiama Debug" CALL_VDEBUG_SETTINGS_TEXT = "Dati Visible Debug" # Nomi delle liste: SWITCH_LIST_TEXT = "Switch" VARIABLE_LIST_TEXT = "Variabili" ITEM_LIST_TEXT = "Oggetti" ACTOR_LIST_TEXT = "Eroi" EVENT_LIST_TEXT = "Eventi" DATA_LIST_TEXT = "Info" WEAPON_LIST_TEXT = "Armi" ARMOR_LIST_TEXT = "Armature" ENEMY_LIST_TEXT = "Nemici" SHOW_EVENT_NAME = true # Mostra nomi di eventi. Metti false per compatibilità. MOVE_AROUND_KEY = :ALT # Premendo questo più volte, l'hud del Visible Debug si sposterà nei quattro # angoli dello schermo e si nasconderà. # Dati disponibili: def self.collect_mainlist poss = [] # Puoi cambiare l'ordine, ma non puoi aggiungere voci. poss << [-1, $data_system.switches.size-1] poss << [-2, $data_system.variables.size-1] poss << [-3, $data_items.size-1] poss << [-4, $data_actors.size-1] poss << [0, $game_player] poss << [-5, $game_map.events.size] # Non serve -1 perché è un Hash. D: poss << [-6, self.useful_data.size-1] poss << [-7, $data_weapons.size-1] poss << [-8, $data_armors.size-1] poss << [-9, [$game_troop.members.size, 8].max] poss # A patto che tu non sappia quel che fai, naturalmente. end def self.useful_data da = [nil] # Il primo valore dev'essere nil. da << [["Party:", $game_party.members.size], # Apri un array, aggiungi. ["G:", $game_party.gold], # Primo valore: stringa mostrata... ["S:", $game_party.steps], # ...secondo valore: variabile col dato. ["T:", self.adjust_time(Graphics.frame_count)], # Ricorda le , ["Sav:", $game_system.save_count]] # Chiudi l'array. # Mostrerà: "Party: 3 G: 333 S: 33 T: 3:33 Sav: 3" con qualcosa # invece di 3. da << ["Timer:", self.adjust_time($game_timer.sec)] # Anche un elemento singolo può essere aggiunto. E la variabile # può anche venir fuori da una funzione def. da << [["Map id:", $game_map.map_id], ["Size:", $game_map.width], ["x", $game_map.height]] # Puoi, come esercizio, aggiungere ad esempio il nome mappa. :) # Aggiungi qui le tue info personalizzate! TU puoi. da # Semplicemente restituisce l'array. end def self.adjust_time(value) # Esempio di funzione. Formatta il tempo. value /= Graphics.frame_rate # Graphics.frame_rate = 1 secondo. sec = value % 60 # Ottiene i secondi. value -= sec # Li sottrae. "#{value/60}:#{sprintf("%02d",sec)}" # Restituisce il tempo come min:sec. end end #Codename: vdebug ($imported ||= {})[:mikb89_vdebug] = true # Licenza: # - Puoi chiedermi di includere il supporto per altri script, a patto che usino # il $imported[script] = true; # - Puoi modificare e anche ripostare i miei script, dopo una mia risposta. Per # ripostarli, comunque, devi aver fatto pesanti modifiche o porting, non puoi # fare un post con lo script così com'è; # - Puoi usare i miei script per fare quel che vuoi, da giochi gratis a liberi # a commerciali. Apprezzerei comunque essere messo al corrente di quello che # stai creando; # - Devi creditarmi, se usi questo script o parte di esso. # * operations to let the Visible Debug configuration be available class Scene_Map #class Scene_Map#def update_call_debug() <- rewritten def update_call_debug SceneManager.call(Scene_ChoiceDebug) if $TEST && Input.press?(:F9) end end class Window_GameDebug < Window_GameEnd #class Window_GameDebug#def make_command_list() def make_command_list add_command(VDEBUG::CALL_CLASSIC_DEBUG_TEXT, :dbg) add_command(VDEBUG::CALL_VDEBUG_SETTINGS_TEXT, :vd) add_command(Vocab::cancel, :cancel) end end class Scene_ChoiceDebug < Scene_MenuBase #class Scene_ChoiceDebug#def start() def start super; @command_window = Window_GameDebug.new @command_window.set_handler(:dbg, proc{SceneManager.goto(Scene_Debug)}) @command_window.set_handler(:vd, proc{SceneManager.goto(Scene_VisibleDebug)}) @command_window.set_handler(:cancel, method(:return_scene)) end #class Scene_ChoiceDebug#def pre_terminate() def pre_terminate super; @command_window.close; update until @command_window.close? end end # * operations to let the Visible Debug sprite work #class Game_Event#def name() (class Game_Event; def name; @event.name; end; end) if VDEBUG::SHOW_EVENT_NAME # why isn't the event name readable by default? WHY??? class Scene_Base alias_method(:updateSB_b4_vdebug, :update) unless method_defined?(:updateSB_b4_vdebug) #class Scene_Base#def update() <- aliased def update updateSB_b4_vdebug # update the debug sprite just everywhere! $game_player.sdebug.update if $game_player end end class << SceneManager alias_method(:run_b4_vdebug, :run) unless method_defined?(:run_b4_vdebug) #class Scene_Manager#def self.run() <- aliased def run run_b4_vdebug $game_player.sdebug.dispose end alias_method(:snapshot_for_background_b4_vdebug, :snapshot_for_background) unless method_defined?(:snapshot_for_background_b4_vdebug) #class Scene_Manager#def self.snapshot_for_background() <- aliased def snapshot_for_background # we don't want the debug sprite to be captured in the snapshot $game_player.sdebug.visible = false if $game_player snapshot_for_background_b4_vdebug $game_player.sdebug.visible = true if $game_player end end class Game_Player # rely sprite on $game_player due to its reperibility. No, I'm not kidding :E #class Game_Player#def sdebug() def sdebug @sdebug ||= Sprite_Debug.new end end class Sprite_Debug < Sprite attr_reader :infos #class Sprite_Debug#def initialize(i, pos) def initialize(i = nil, pos = 0) super() self.infos = (i.is_a?(Array) ? i : [i]) # must be an array self.z = 99999999 # a big value self.opacity = 222 # little transparency @last_values = [] @pos = pos - 1; move_around # position set end #class Sprite_Debug#def move_around() def move_around @pos += 1; @pos %= 5 # increase position, modulate value self.x = w*(@pos%2) # right/left self.y = Graphics.height/2*(@pos/2) # up/down/out end #class Sprite_Debug#def w() def w # just to write a little less Graphics.width/2 end #class Sprite_Debug#def infos=(i) def infos=(i) @infos = i create_bitmap # once data change, we recreate the image end #class Sprite_Debug#def _dump(*args) def _dump(*args) str = @infos[0].nil? ? "n," : "" @infos.each {|i| i.each {|d| str += " #{d.is_a?(Numeric) ? d : "p"}"} str += "," } if str == "" str += @pos.to_s # values to save end #class Sprite_Debug#def _load(data) def self._load(data) p data data = data.split(',') pos = data.pop.to_i || 0 i = data[0] == "n" ? nil : data.each_index {|d| data[d] = data[d].split data[d].each_index {|n| data[d][n] = (data[d][n] == "p" ? $game_player : data[d][n].to_i)} } Sprite_Debug.new(i, pos) end #class Sprite_Debug#def create_bitmap() def create_bitmap self.bitmap.dispose if self.bitmap && !self.bitmap.disposed? h = @infos.size*24 self.bitmap = Bitmap.new(w,[h,1].max) # h is 0, if there's no item for i in 0...@infos.size next if @infos[i] == nil || @infos[i].size < 2 draw_row(i, true) end end #class Sprite_Debug#def draw_row(i, new) def draw_row(i, new = false) self.bitmap.clear_rect(0,i*24,w,24) unless new # no need to clear if new im = get_item(@infos[i]) # get the bitmap then blt it. This way I can get return unless im # the same bitmap everywhere ^^ draw_placement(0, i*24) self.bitmap.blt(0, i*24, im, im.rect) im.dispose end #class Sprite_Debug#def draw_placement(x, y) def draw_placement(x, y) self.bitmap.fill_rect(x+4,y+6,w-8,24-8,Color.new(0,0,0,128)) # a bLackground end #class Sprite_Debug#def collect(v) def collect(v) # gets the relevant value(s) for each item case v[0] when 0; collect_player when 1; $game_switches[v[1]] when 2; $game_variables[v[1]] when 3; $game_party.item_number($data_items[v[1]]) when 4; collect_actor($game_actors[v[1]]) when 5; collect_event($game_map.events[v[1]]) when 6; collect_data(VDEBUG::useful_data[v[1]]) when 7; $game_party.item_number($data_weapons[v[1]]) when 8; $game_party.item_number($data_armors[v[1]]) when 9; collect_enemy($game_troop.members[v[1]-1]) else; nil end end #class Sprite_Debug#def collect_player() def collect_player da = [] da << $game_player.character_name da << $game_player.character_index da << $game_player.direction da << $game_player.x da << $game_player.y da << ($game_player.through || $game_player.debug_through?) for i in [0, 1, 2] da << $game_map.data[$game_player.x, $game_player.y, i] end da end #class Sprite_Debug#def collect_actor(actor) def collect_actor(actor) da = [] da << actor.character_name da << actor.character_index da << actor.name da << actor.level da << actor.hp da << actor.mhp da << actor.mp da << actor.mmp da << actor.states da << actor.atk da << actor.def da << actor.luk da << actor.agi da end #class Sprite_Debug#def collect_event(event) def collect_event(event) da = [] return da if event.nil? da << event.character_name da << event.character_index da << event.direction da << event.x da << event.y da << (event.through || event.debug_through?) for ss in ['A', 'B', 'C', 'D'] da << $game_self_switches[[$game_map.map_id, event.id, ss]] end da end #class Sprite_Debug#def collect_data(data) def collect_data(data) da = [] return da if data.nil? || !data.is_a?(Array) data = [data] unless data[0].is_a?(Array) return da if data.size < 1 for val in data da << val[1] end da end #class Sprite_Debug#def collect_enemy(enemy) def collect_enemy(enemy) da = [] return da if enemy.nil? da << enemy.battler_name da << enemy.battler_hue da << enemy.name da << enemy.hp da << enemy.mhp da << enemy.mp da << enemy.mmp da << enemy.states da << enemy.atk da << enemy.def da << enemy.luk da << enemy.agi da end #class Sprite_Debug#def get_item(item, width, enabled) def get_item(item, width = w, enabled = true) # draw item in a returned bitmap bit = Bitmap.new(width,24) bit.font.color.alpha = blta = enabled ? 255 : 128 case item[0] when -9; draw_container(VDEBUG::ENEMY_LIST_TEXT, item[1], bit) when -8; draw_container(VDEBUG::ARMOR_LIST_TEXT, item[1], bit) when -7; draw_container(VDEBUG::WEAPON_LIST_TEXT, item[1], bit) when -6; draw_container(VDEBUG::DATA_LIST_TEXT, item[1], bit) when -5; draw_container(VDEBUG::EVENT_LIST_TEXT, item[1], bit) when -4; draw_container(VDEBUG::ACTOR_LIST_TEXT, item[1], bit) when -3; draw_container(VDEBUG::ITEM_LIST_TEXT, item[1], bit) when -2; draw_container(VDEBUG::VARIABLE_LIST_TEXT, item[1], bit) when -1; draw_container(VDEBUG::SWITCH_LIST_TEXT, item[1], bit) when 0; draw_player(item[1], bit, blta) when 1; draw_switch(item[1], bit, blta) when 2; draw_variable(item[1], bit, blta) when 3; draw_item(item[1], bit, blta) when 4; draw_actor(item[1], bit, blta) when 5; draw_event(item[1], bit, blta) when 6; draw_data(item[1], bit, blta) when 7; draw_weapon(item[1], bit, blta) when 8; draw_armor(item[1], bit, blta) when 9; draw_enemy(item[1], bit, blta) else; bit.dispose; bit = nil end bit end #class Sprite_Debug#def draw_container(txt, n, bitmap) def draw_container(txt, n, bitmap) bitmap.draw_text(12, 0, bitmap.width-32, 24, txt) bitmap.draw_text(0, 0, bitmap.width, 24, n > 0 ? "(#{n})" : "", 2) end #class Sprite_Debug#def draw_player(item, bitmap, blta) def draw_player(item, bitmap, blta) if item != nil bitmap.blt(0, 0, get_character_icon(item, true), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, "(#{item.x};#{item.y})") tile = "" for i in [0, 1, 2] tile += $game_map.data[item.x, item.y, i].to_s + (i != 2 ? ", " : "") end bitmap.draw_text(0, 0, bitmap.width-3, 24, "Tile: #{tile}", 2) if (item.through || item.debug_through?) bitmap.font.color = Color.new(0,0,0) bitmap.font.out_color = Color.new(99,33,55) bitmap.draw_text(0, 8, 23, 24, "T", 2) end end end #class Sprite_Debug#def draw_switch(n, bitmap, blta) def draw_switch(n, bitmap, blta) if n != nil name = $data_system.switches[n] bitmap.blt(0, 0, get_text_icon("S"), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width-32, 24, "[#{n}] #{name}:") bitmap.draw_text(0, 0, bitmap.width, 24, "[O#{$game_switches[n] ? "N" : "FF"}]", 2) end end #class Sprite_Debug#def draw_variable(n, bitmap, blta) def draw_variable(n, bitmap, blta) if n != nil name = $data_system.variables[n] bitmap.blt(0, 0, get_text_icon("V"), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width-32, 24, "[#{n}] #{name}:") bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_variables[n].to_s, 2) end end #class Sprite_Debug#def draw_item(n, bitmap, blta) def draw_item(n, bitmap, blta) item = $data_items[n] if item != nil bitmap.blt(0, 0, get_icon(item.icon_index), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, item.name) bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_party.item_number(item), 2) end end #class Sprite_Debug#def draw_actor(n, bitmap, blta) def draw_actor(n, bitmap, blta) item = $game_actors[n] if item != nil iw = bitmap.width bitmap.draw_text(24, 0, bitmap.width, 24, item.name) wb = Window_Base.new(-(iw+32),-56,iw+32,56) # I get a Window_Base for its wb.draw_actor_name(item, 24, 0) # useful draw_this, draw_that gs = iw-w vals = [-8, -2] if $data_system.opt_display_tp vals[0] -= 4; vals[1] -= 4; vals << 0 wb.draw_gauge(96, vals[2], 48+gs, item.tp_rate, wb.tp_gauge_color1, wb.tp_gauge_color2) end wb.draw_gauge(96, vals[0], 48+gs, item.hp_rate, wb.hp_gauge_color1, wb.hp_gauge_color2) wb.draw_gauge(96, vals[1], 48+gs, item.mp_rate, wb.mp_gauge_color1, wb.mp_gauge_color2) wb.draw_actor_icons(item, 154+gs, 0, 48) wb.contents.font.size /= 2 wb.contents.font.color = Color.new(0,0,0) wb.contents.font.out_color = wb.system_color wb.contents.draw_text(5, 8, 12, 24, Vocab::level_a) wb.contents.draw_text(iw-80+16, -4, 22, 24, Vocab::param(2)[0...3]) wb.contents.draw_text(iw-48+16, -4, 22, 24, Vocab::param(3)[0...3]) wb.contents.draw_text(iw-80+16, 6, 22, 24, Vocab::param(6)[0...3]) wb.contents.draw_text(iw-48+16, 6, 22, 24, Vocab::param(7)[0...3]) wb.contents.font.out_color = wb.normal_color wb.contents.draw_text(0, 8, 23, 24, item.level, 2) wb.contents.draw_text(iw-80+26, -4, 18, 24, item.atk, 2) wb.contents.draw_text(iw-48+26, -4, 18, 24, item.def, 2) wb.contents.draw_text(iw-80+26, 6, 18, 24, item.luk, 2) wb.contents.draw_text(iw-48+26, 6, 18, 24, item.agi, 2) bitmap.blt(0, 0, get_character_icon(item), Rect.new(0,0,24,24), blta) bitmap.blt(0, 0, wb.contents, wb.contents.rect, blta) wb.dispose end end #class Sprite_Debug#def draw_event(n, bitmap, blta) def draw_event(n, bitmap, blta) item = $game_map.events[n] if item != nil bitmap.blt(0, 0, get_character_icon(item, true), Rect.new(0,0,24,24), blta) nm = VDEBUG::SHOW_EVENT_NAME ? item.name : "" bitmap.draw_text(24, 0, bitmap.width-3, 24, "[#{item.id}](#{item.x};#{item.y})#{nm}") loc = "ON:" for ss in ['A', 'B', 'C', 'D'] loc += " " + ss + "," if $game_self_switches[[$game_map.map_id, item.id, ss]] end loc[-1] = "" if loc[-1] == ',' bitmap.draw_text(0, 0, bitmap.width, 24, loc, 2) if (item.through || item.debug_through?) bitmap.font.color = Color.new(0,0,0) bitmap.font.out_color = Color.new(99,33,55) bitmap.draw_text(0, 8, 23, 24, "T", 2) end else bitmap.blt(0, 0, get_text_icon(n.to_s), Rect.new(0,0,24,24), blta) bitmap.draw_text(0, 0, bitmap.width, 24, "EV#{sprintf("%03d", n)}", 1) end end #class Sprite_Debug#def draw_data(n, bitmap, blta) def draw_data(n, bitmap, blta) item = VDEBUG::useful_data[n] if item != nil && item.is_a?(Array) item = [item] unless item[0].is_a?(Array) return if item.size < 1 str = "" for val in item str += val[0] + " #{val[1]} " end str[-1] = "" if str[-1] == " " bitmap.draw_text(0, 0, bitmap.width, 24, str, 1) end end #class Sprite_Debug#def draw_weapon(n, bitmap, blta) def draw_weapon(n, bitmap, blta) item = $data_weapons[n] if item != nil bitmap.blt(0, 0, get_icon(item.icon_index), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, item.name) bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_party.item_number(item), 2) end end #class Sprite_Debug#def draw_armor(n, bitmap, blta) def draw_armor(n, bitmap, blta) item = $data_armors[n] if item != nil bitmap.blt(0, 0, get_icon(item.icon_index), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, item.name) bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_party.item_number(item), 2) end end #class Sprite_Debug#def draw_enemy(n, bitmap, blta) def draw_enemy(n, bitmap, blta) item = $game_troop.members[n-1] iw = bitmap.width if item != nil wb = Window_Base.new(-(iw+32),-56,iw+32,56) # I get a Window_Base for its wb.draw_actor_name(item, 24, 0) # useful draw_this, draw_that gs = iw-w vals = [-8, -2] if $data_system.opt_display_tp vals[0] -= 4; vals[1] -= 4; vals << 0 wb.draw_gauge(96, vals[2], 48+gs, item.tp_rate, wb.tp_gauge_color1, wb.tp_gauge_color2) end wb.draw_gauge(96, vals[0], 48+gs, item.hp_rate, wb.hp_gauge_color1, wb.hp_gauge_color2) wb.draw_gauge(96, vals[1], 48+gs, item.mp_rate, wb.mp_gauge_color1, wb.mp_gauge_color2) wb.draw_actor_icons(item, 154+gs, 0, 48) wb.contents.font.size /= 2 wb.contents.font.color = Color.new(0,0,0) wb.contents.font.out_color = wb.system_color wb.contents.draw_text(iw-80+16, -4, 22, 24, Vocab::param(2)[0...3]) wb.contents.draw_text(iw-48+16, -4, 22, 24, Vocab::param(3)[0...3]) wb.contents.draw_text(iw-80+16, 6, 22, 24, Vocab::param(6)[0...3]) wb.contents.draw_text(iw-48+16, 6, 22, 24, Vocab::param(7)[0...3]) wb.contents.font.out_color = wb.normal_color wb.contents.draw_text(0, 8, 23, 24, item.letter, 2) wb.contents.draw_text(iw-80+26, -4, 18, 24, item.atk, 2) wb.contents.draw_text(iw-48+26, -4, 18, 24, item.def, 2) wb.contents.draw_text(iw-80+26, 6, 18, 24, item.luk, 2) wb.contents.draw_text(iw-48+26, 6, 18, 24, item.agi, 2) bitmap.blt(0, 0, get_enemy_icon(item), Rect.new(0,0,24,24), blta) bitmap.blt(0, 0, wb.contents, wb.contents.rect, blta) wb.dispose else bitmap.blt(0, 0, get_text_icon(n.to_s), Rect.new(0,0,24,24), blta) bitmap.draw_text(0, 0, iw, 24, "...", 1) end end #class Sprite_Debug#def get_icon(index) def get_icon(index) # get an icon with the Window_Base, cache it @icache ||= {} return @icache[index] if @icache[index] wb = Window_Base.new(-56,-56,56,56) wb.draw_icon(index,0,0) bit = wb.contents.clone wb.dispose @icache[index] = bit bit end #class Sprite_Debug#def get_character_icon(chara, dir) def get_character_icon(chara, dir = false) # get iconized character from... @icache ||= {} c_id = chara.character_name + "_" + chara.character_index.to_s + "_" + (dir ? chara.direction.to_s : "2") return @icache[c_id] if @icache[c_id] if dir cp = chara.clone cp.transparent = true sc = Sprite_Character.new(nil, cp) # ...a Sprite_Character or... bit = Bitmap.new(24, 24) bit.blt((24-sc.src_rect.width)/2,(24-sc.src_rect.height)/2,sc.bitmap, sc.src_rect) sc.dispose cp = nil else wb = Window_Base.new(-56,-56,56,56) # ...a Window_Base... wb.draw_actor_graphic(chara,12,33) bit = wb.contents.clone wb.dispose end @icache[c_id] = bit # ...and cache it bit end #class Sprite_Debug#def get_text_icon(text) def get_text_icon(text) # get an iconized text, like S, V or numbers @icache ||= {} return @icache[text] if @icache[text] bit = Bitmap.new(24,24) bit.font.shadow = false bit.font.italic = true bit.font.bold = true bit.font.size -= 1 bit.font.color = Color.new(81,59,59, 128) for i in -2..2; for j in -1..1 # draw black text many times around bit.draw_text(i,j+2,24,24,text,1) end; end bit.blur # then blur it bit.font.color = Color.new(255,255,255) bit.draw_text(0,2,24,24,text,1) @icache[text] = bit bit end #class Sprite_Debug#def get_enemy_icon(enemy) def get_enemy_icon(enemy) # get an iconized enemy graphic @icache ||= {} id = enemy.battler_name + "_" + enemy.battler_hue.to_s return @icache[id] if @icache[id] bit = Bitmap.new(24,24) sb = Sprite_Battler.new(nil, enemy) # get the bitmap from a Sprite_Battler sb.opacity = 0 # don't wanna see the full battler sb.update_bitmap # let the graphic be loaded sb.dispose if sb.bitmap.nil? || sb.bitmap.disposed? # no graphic? return bit if sb.disposed? b2 = Bitmap.new(sb.src_rect.width, sb.src_rect.height) # I get a new bitmap b2.blt(0, 0, sb.bitmap, sb.src_rect) # within src_rect sb.bitmap = b2 # disposing sb even its bitmap will be disposed if b2.width <= 24 || b2.height <= 24 # if little bitmap just center it bit.blt((24-b2.width)/2, (24-b2.height)/2, b2, b2.rect) else # else resize fact = (b2.width > b2.height ? b2.height : b2.width)/24.0 nw = b2.width/fact; nh = b2.height/fact bit.stretch_blt(Rect.new((24-nw)/2, (24-nh)/2, nw, nh), b2, b2.rect) end sb.dispose @icache[id] = bit bit end #class Sprite_Debug#def update() def update return if SceneManager.scene_is?(Scene_File) move_around if Input.trigger?(VDEBUG::MOVE_AROUND_KEY) for i in 0...@infos.compact.size v = @infos[i] # set every new value and redraw if needed draw_row(i) if @last_values[i] != (@last_values[i] = collect(v)) end super end end # * operation to create a Visible Debug options screen class Window_VDList < Window_Selectable # a silly, simple, window that handle a list attr_reader :data #class Window_VDList#def initialize(x, y, list, ctd) def initialize(x, y, list = [], ctd = false) super(x, y, Graphics.width/2, Graphics.height-y) @cantdisable = ctd self.index = 0 set_list(list) end #class Window_VDList#def item_max() def item_max @data ? @data.size : 1 end #class Window_VDList#def set_list(list) def set_list(list) @data = list self.index = item_max - 1 if self.index > 0 && item_max < self.index refresh end #class Window_VDList#def enabled?(index) def enabled?(index) return true if @cantdisable !$game_player.sdebug.infos.include?(@data[index]) end #class Window_VDList#def item() def item return @data[self.index] end #class Window_VDList#def add_item(it) def add_item(it) @data.push(it) set_list(@data.compact) end #class Window_VDList#def remove_item(it) def remove_item(it) remove(@data.index(it)) end #class Window_VDList#def remove(index) def remove(index) return if index == nil return if index < 0 return if index >= @data.size @data.delete_at(index) set_list(@data) end #class Window_VDList#def refresh() def refresh create_contents for i in 0...item_max draw_item(i) end end #class Window_VDList#def draw_item(index) def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) return if @data[index].nil? im = $game_player.sdebug.get_item(@data[index], rect.width-4, enabled?(index)) self.contents.blt(rect.x, rect.y, im, im.rect) if im im.dispose if im end end class Scene_VisibleDebug < Scene_Base # a silly, simple, scene #class Scene_VisibleDebug#def start() def start super @help_window = Window_Help.new(1) @help_window.set_text(VDEBUG::help_TEXT) ips = @help_window.height # third list window parameter is the list, fourth is the cantdisable value @mainlist_window = Window_VDList.new(0, ips, VDEBUG::collect_mainlist) @debuglist_window = Window_VDList.new(@mainlist_window.width, ips, $game_player.sdebug.infos, true) @elementlist_window = Window_VDList.new(0, ips) @elementlist_window.visible = false @mainlist_window.activate @mainlist_window.set_handler(:ok, method(:mainlist_ok)) @mainlist_window.set_handler(:cancel, method(:return_scene)) @mainlist_window.set_handler(:pageup, method(:mainlist_pag)) @mainlist_window.set_handler(:pagedown, method(:mainlist_pag)) @debuglist_window.set_handler(:ok, method(:debuglist_ok)) @debuglist_window.set_handler(:cancel, method(:return_scene)) @debuglist_window.set_handler(:pageup, method(:debuglist_pag)) @debuglist_window.set_handler(:pagedown, method(:debuglist_pag)) @elementlist_window.set_handler(:ok, method(:elementlist_ok)) @elementlist_window.set_handler(:cancel, method(:elementlist_cancel)) end #class Scene_VisibleDebug#def mainlist_ok() def mainlist_ok it = @mainlist_window.item if it[0] >= 0 # if item's a item: if @mainlist_window.enabled?(@mainlist_window.index) # add/remove @debuglist_window.add_item(it) else @debuglist_window.remove_item(it) end $game_player.sdebug.infos = @debuglist_window.data # update @mainlist_window.draw_item(@mainlist_window.index) # redraw @mainlist_window.activate else # if item's a group: process_elementlist_open(it) # open the sub-list @elementlist_window.activate end end #class Scene_VisibleDebug#def mainlist_pag() def mainlist_pag @debuglist_window.activate end #class Scene_VisibleDebug#def debuglist_ok() def debuglist_ok @debuglist_window.remove(@debuglist_window.index) # remove the item $game_player.sdebug.infos = @debuglist_window.data # update @mainlist_window.refresh # redraw @debuglist_window.activate end #class Scene_VisibleDebug#def debuglist_pag() def debuglist_pag @mainlist_window.activate end #class Scene_VisibleDebug#def elementlist_ok() def elementlist_ok it = @elementlist_window.item if @elementlist_window.enabled?(@elementlist_window.index) # add/remove @debuglist_window.add_item(it) else @debuglist_window.remove_item(it) end $game_player.sdebug.infos = @debuglist_window.data # update @elementlist_window.draw_item(@elementlist_window.index) # redraw @elementlist_window.activate end #class Scene_VisibleDebug#def elementlist_cancel() def elementlist_cancel @mainlist_window.activate @elementlist_window.close end #class Scene_VisibleDebug#def process_elementlist_open(it) def process_elementlist_open(it) # it contains the type and the size # collect elements of the group vals = [] for d in 1..it[1] # starting from 1, because there aren't IDs 0 vals << [it[0]*-1,d] # the type must be positive end # and let the window appears @elementlist_window.set_list(vals) @elementlist_window.index = 0 @elementlist_window.visible = true @elementlist_window.open end endVisibile ancheBugs e Conflitti Noti
I salvataggi vengono modificati per contenere la lista di dati scelta. È possibile comunque caricare salvataggi precedenti, mentre per continuare ad usare quelli effettuati in presenza dello script, nel caso quest'ultimo venisse rimosso, è presente nella demo un piccolo codicino - per nulla invadente - da lasciare.Altri Dettagli
Grazie aper avermi ispirato l'idea (:Grazie aper avermi supportato con un fastidioso bug ^^ -
vgfvf è un utente ^^
Comunque qua c'è un video: http://www.youtube.com/watch?v=DSZV0oHD4Ns
Sembra che il lavoro fosse a buon punto D:
Qua comunque il progetto su sourceforge: http://sourceforge.net/projects/argss/
-
Visible Debug 1.2
Descrizione
Capita che qualcosa vada storto fra switch e variabili. Non sai cosa succede, sai solo che non funziona come previsto. Qui entra in gioco questo script!http://img543.imageshack.us/img543/5624/visibledebugvx.png
Funzionalità
Con questo script puoi tenere sotto controllo una lista di parametri vari i cui cambiamenti saranno mostrati in tempo reale. Questa lista include:- switch e variabili, switch locali degli eventi;
- grafica di eventi, giocatore, eroi, nemici;
- posizione e stato 'Come fantasma' di eventi e giocatore;
- id dei tile dove si trova il giocatore;
- numero di oggetti, armi, armature possedute;
- hp, mp, rage (se usi YEM), atk, def, spi, agi, due stati dei combattentii;
- nomi & livello degli eroi (i nemici non li hanno);
- altre informazioni utili aggiunte dalle configurazioni (puoi vedere come sono fatte e aggiungerne di tue).
Autore
mikb89Allegati
Demo multilingua v. 1.2 (262 KB)Istruzioni per l'uso
Inserite lo script sotto Materials. Le istruzioni sono fra i commenti.Script
# Visible Debug v. 1.2 # VX version # by mikb89 # Dettagli: # Capita che qualcosa vada storto fra switch e variabili. Non sai cosa # succede, sai solo che non funziona come previsto. # Con questo script puoi tenere sotto controllo una lista di parametri # vari i cui cambiamenti saranno mostrati in tempo reale. # Questa lista include: # - switch e variabili, switch locali degli eventi; # - grafica di eventi, giocatore, eroi, nemici; # - posizione e stato 'Come fantasma' di eventi e giocatore; # - id dei tile dove si trova il giocatore; # - numero di oggetti, armi, armature possedute; # - hp, mp, rage (se usi YEM), atk, def, spi, agi, due stati dei combattenti; # - nomi & livello degli eroi (i nemici non li hanno); # - altre informazioni utili aggiunte dalle configurazioni (puoi vedere # come sono fatte e aggiungerne di tue). # Configurazioni: module VDEBUG # Lista di termini da personalizzare come si vuole: HELP_TEXT = "Invio: aggiungi/togli; Pag: cambia lista." # Aiutati! # Cosa appare alla pressione di F9: CALL_CLASSIC_DEBUG_TEXT = "Chiama Debug" CALL_VDEBUG_SETTINGS_TEXT = "Dati Visible Debug" # Nomi delle liste: SWITCH_LIST_TEXT = "Switch" VARIABLE_LIST_TEXT = "Variabili" ITEM_LIST_TEXT = "Oggetti" ACTOR_LIST_TEXT = "Eroi" EVENT_LIST_TEXT = "Eventi" DATA_LIST_TEXT = "Info" WEAPON_LIST_TEXT = "Armi" ARMOR_LIST_TEXT = "Armature" ENEMY_LIST_TEXT = "Nemici" SHOW_EVENT_NAME = true # Mostra nomi di eventi. Metti false per compatibilità. MOVE_AROUND_KEY = Input::ALT # Premendo questo più volte, l'hud del Visible Debug si sposterà nei quattro # angoli dello schermo e si nasconderà. # Dati disponibili: def self.collect_mainlist poss = [] # Puoi cambiare l'ordine, ma non puoi aggiungere voci. poss << [-1, $data_system.switches.size-1] poss << [-2, $data_system.variables.size-1] poss << [-3, $data_items.size-1] poss << [-4, $data_actors.size-1] poss << [0, $game_player] poss << [-5, $game_map.events.size] # Non serve -1 perché è un Hash. D: poss << [-6, self.useful_data.size-1] poss << [-7, $data_weapons.size-1] poss << [-8, $data_armors.size-1] poss << [-9, [$game_troop.members.size, 8].max] poss # A patto che tu non sappia quel che fai, naturalmente. end def self.useful_data da = [nil] # Il primo valore dev'essere nil. da << [["Party:", $game_party.members.size], # Apri un array, aggiungi. ["G:", $game_party.gold], # Primo valore: stringa mostrata... ["S:", $game_party.steps], # ...secondo valore: variabile col dato. ["T:", self.adjust_time(Graphics.frame_count)], # Ricorda le , ["Sav:", $game_system.save_count]] # Chiudi l'array. # Mostrerà: "Party: 3 G: 333 S: 33 T: 3:33 Sav: 3" con qualcosa # invece di 3. da << ["Timer:", self.adjust_time($game_system.timer)] # Anche un elemento singolo può essere aggiunto. E la variabile # può anche venir fuori da una funzione def. da << [["Map id:", $game_map.map_id], ["Size:", $game_map.width], ["x", $game_map.height]] # Puoi, come esercizio, aggiungere ad esempio il nome mappa. :) # Aggiungi qui le tue info personalizzate! TU puoi. da # Semplicemente restituisce l'array. end def self.adjust_time(value) # Esempio di funzione. Formatta il tempo. value /= Graphics.frame_rate # Graphics.frame_rate = 1 secondo. sec = value % 60 # Ottiene i secondi. value -= sec # Li sottrae. "#{value/60}:#{sprintf("%02d",sec)}" # Restituisce il tempo come min:sec. end end #Codename: vdebug ($imported ||= {})[:mikb89_vdebug] = true # Licenza: # - Puoi chiedermi di includere il supporto per altri script, a patto che usino # il $imported[script] = true; # - Puoi modificare e anche ripostare i miei script, dopo una mia risposta. Per # ripostarli, comunque, devi aver fatto pesanti modifiche o porting, non puoi # fare un post con lo script così com'è; # - Puoi usare i miei script per fare quel che vuoi, da giochi gratis a liberi # a commerciali. Apprezzerei comunque essere messo al corrente di quello che # stai creando; # - Devi creditarmi, se usi questo script o parte di esso. # * operations to let the Visible Debug configuration be available class Scene_Map #class Scene_Map#def call_debug() <- rewritten def call_debug Sound.play_decision $game_temp.next_scene = nil $scene = Scene_ChoiceDebug.new end end # Yanfly liked to destroy the Scene_End, let's support him! :D if $imported["SystemGameOptions"] # REQUIRE YEM - System Game Options class Scene_ChoiceDebug < Scene_Base # this is just a clone of the Scene_End #class Scene_ChoiceDebug#def start() def start; super; create_menu_background; create_command_window; end #class Scene_ChoiceDebug#def post_start() def post_start; super; open_command_window; end #class Scene_ChoiceDebug#def pre_terminate() def pre_terminate; super; close_command_window; end #class Scene_ChoiceDebug#def terminate() def terminate; super; @command_window.dispose; dispose_menu_background; end #class Scene_ChoiceDebug#def update() def update super; update_menu_background; @command_window.update if Input.trigger?(Input::B) Sound.play_cancel; return_scene elsif Input.trigger?(Input::C); case @command_window.index when 0; command_to_title when 1; command_shutdown when 2; Sound.play_decision; return_scene end; end end #class Scene_ChoiceDebug#def update_menu_background() def update_menu_background; super; @menuback_sprite.tone.set(0,0,0,128); end #class Scene_ChoiceDebug#def open_command_window() def open_command_window @command_window.open; begin @command_window.update; Graphics.update end until @command_window.openness == 255 end #class Scene_ChoiceDebug#def close_command_window() def close_command_window @command_window.close; begin @command_window.update; Graphics.update end until @command_window.openness == 0 end end # END REQUIRE else class Scene_ChoiceDebug < Scene_End; end end class Scene_ChoiceDebug #class Scene_ChoiceDebug#def return_scene() def return_scene $scene = Scene_Map.new end #class Scene_ChoiceDebug#def create_command_window() def create_command_window s1 = VDEBUG::CALL_CLASSIC_DEBUG_TEXT s2 = VDEBUG::CALL_VDEBUG_SETTINGS_TEXT s3 = Vocab::cancel @command_window = Window_Command.new(272, [s1, s2, s3]) @command_window.x = (544 - @command_window.width) / 2 @command_window.y = (416 - @command_window.height) / 2 @command_window.openness = 0 end # just using original Scene_End class names #class Scene_ChoiceDebug#def command_to_title() def command_to_title Sound.play_decision $scene = Scene_Debug.new close_command_window end #class Scene_ChoiceDebug#def command_shutdown() def command_shutdown Sound.play_decision $scene = Scene_VisibleDebug.new close_command_window end end # * operations to let the Visible Debug sprite work #class Game_Event#def name() (class Game_Event; def name; @event.name; end; end) if VDEBUG::SHOW_EVENT_NAME # why isn't the event name readable by default? WHY??? class Scene_End alias_method(:terminateSE_b4_vdebug, :terminate) unless method_defined?(:terminateSE_b4_vdebug) #class Scene_End#def terminate() <- aliased def terminate terminateSE_b4_vdebug # dispose the sprite on Shutdown and To title commands $game_player.sdebug.dispose if !$scene || $scene.is_a?(Scene_Title) end end class Scene_Base alias_method(:updateSB_b4_vdebug, :update) unless method_defined?(:updateSB_b4_vdebug) #class Scene_Base#def update() <- aliased def update updateSB_b4_vdebug # update the debug sprite just everywhere! $game_player.sdebug.update if $game_player end alias_method(:snapshot_for_background_b4_vdebug, :snapshot_for_background) unless method_defined?(:snapshot_for_background_b4_vdebug) #class Scene_Base#def snapshot_for_background() <- aliased def snapshot_for_background # we don't want the debug sprite to be captured in the snapshot $game_player.sdebug.visible = false if $game_player snapshot_for_background_b4_vdebug $game_player.sdebug.visible = true if $game_player end end class Game_Player # rely sprite on $game_player due to its reperibility. No, I'm not kidding :E #class Game_Player#def sdebug() def sdebug @sdebug ||= Sprite_Debug.new end end class Sprite_Debug < Sprite attr_reader :infos #class Sprite_Debug#def initialize(i, pos, vp) def initialize(i = nil, pos = 0, vp = nil) if vp == nil; super(); else; super(vp); end # viewport? self.infos = (i.is_a?(Array) ? i : [i]) # must be an array self.z = 99999999 # a big value self.opacity = 222 # little transparency @last_values = [] @pos = pos - 1; move_around # position set end #class Sprite_Debug#def move_around() def move_around @pos += 1; @pos %= 5 # increase position, modulate value self.x = w*(@pos%2) # right/left self.y = Graphics.height/2*(@pos/2) # up/down/out end #class Sprite_Debug#def w() def w # just to write a little less Graphics.width/2 end #class Sprite_Debug#def infos=(i) def infos=(i) @infos = i create_bitmap # once data change, we recreate the image end #class Sprite_Debug#def marshal_dump() def marshal_dump [@infos, @pos, self.viewport] # values to save end #class Sprite_Debug#def marshal_load(data) def marshal_load(data) initialize(data[0] || nil, data[1] || 0, data[2] || nil) end #class Sprite_Debug#def create_bitmap() def create_bitmap self.bitmap.dispose if self.bitmap && !self.bitmap.disposed? h = @infos.size*24 self.bitmap = Bitmap.new(w,[h,1].max) # h is 0, if there's no item for i in 0...@infos.size next if @infos[i] == nil || @infos[i].size < 2 draw_row(i, true) end end #class Sprite_Debug#def draw_row(i, new) def draw_row(i, new = false) self.bitmap.clear_rect(0,i*24,w,24) unless new # no need to clear if new im = get_item(@infos[i]) # get the bitmap then blt it. This way I can get return unless im # the same bitmap everywhere ^^ draw_placement(0, i*24) self.bitmap.blt(0, i*24, im, im.rect) im.dispose end #class Sprite_Debug#def draw_placement(x, y) def draw_placement(x, y) self.bitmap.fill_rect(x+4,y+6,w-8,24-8,Color.new(0,0,0,128)) # a bLackground end #class Sprite_Debug#def collect(v) def collect(v) # gets the relevant value(s) for each item case v[0] when 0; collect_player when 1; $game_switches[v[1]] when 2; $game_variables[v[1]] when 3; $game_party.item_number($data_items[v[1]]) when 4; collect_actor($game_actors[v[1]]) when 5; collect_event($game_map.events[v[1]]) when 6; collect_data(VDEBUG::useful_data[v[1]]) when 7; $game_party.item_number($data_weapons[v[1]]) when 8; $game_party.item_number($data_armors[v[1]]) when 9; collect_enemy($game_troop.members[v[1]-1]) else; nil end end #class Sprite_Debug#def collect_player() def collect_player da = [] da << $game_player.character_name da << $game_player.character_index da << $game_player.direction da << $game_player.x da << $game_player.y da << ($game_player.through || $game_player.debug_through?) for i in [0, 1, 2] da << $game_map.data[$game_player.x, $game_player.y, i] end da end #class Sprite_Debug#def collect_actor(actor) def collect_actor(actor) da = [] da << actor.character_name da << actor.character_index da << actor.name da << actor.level da << actor.hp da << actor.maxhp da << actor.mp da << actor.maxmp da << actor.states da << actor.atk da << actor.def da << actor.spi da << actor.agi da end #class Sprite_Debug#def collect_event(event) def collect_event(event) da = [] return da if event.nil? da << event.character_name da << event.character_index da << event.direction da << event.x da << event.y da << (event.through || event.debug_through?) for ss in ['A', 'B', 'C', 'D'] da << $game_self_switches[[$game_map.map_id, event.id, ss]] end da end #class Sprite_Debug#def collect_data(data) def collect_data(data) da = [] return da if data.nil? || !data.is_a?(Array) data = [data] unless data[0].is_a?(Array) return da if data.size < 1 for val in data da << val[1] end da end #class Sprite_Debug#def collect_enemy(enemy) def collect_enemy(enemy) da = [] return da if enemy.nil? da << enemy.battler_name da << enemy.battler_hue da << enemy.name da << enemy.hp da << enemy.maxhp da << enemy.mp da << enemy.maxmp da << enemy.states da << enemy.atk da << enemy.def da << enemy.spi da << enemy.agi da end #class Sprite_Debug#def get_item(item, width, enabled) def get_item(item, width = w, enabled = true) # draw item in a returned bitmap bit = Bitmap.new(width,24) bit.font.color.alpha = blta = enabled ? 255 : 128 case item[0] when -9; draw_container(VDEBUG::ENEMY_LIST_TEXT, item[1], bit) when -8; draw_container(VDEBUG::ARMOR_LIST_TEXT, item[1], bit) when -7; draw_container(VDEBUG::WEAPON_LIST_TEXT, item[1], bit) when -6; draw_container(VDEBUG::DATA_LIST_TEXT, item[1], bit) when -5; draw_container(VDEBUG::EVENT_LIST_TEXT, item[1], bit) when -4; draw_container(VDEBUG::ACTOR_LIST_TEXT, item[1], bit) when -3; draw_container(VDEBUG::ITEM_LIST_TEXT, item[1], bit) when -2; draw_container(VDEBUG::VARIABLE_LIST_TEXT, item[1], bit) when -1; draw_container(VDEBUG::SWITCH_LIST_TEXT, item[1], bit) when 0; draw_player(item[1], bit, blta) when 1; draw_switch(item[1], bit, blta) when 2; draw_variable(item[1], bit, blta) when 3; draw_item(item[1], bit, blta) when 4; draw_actor(item[1], bit, blta) when 5; draw_event(item[1], bit, blta) when 6; draw_data(item[1], bit, blta) when 7; draw_weapon(item[1], bit, blta) when 8; draw_armor(item[1], bit, blta) when 9; draw_enemy(item[1], bit, blta) else; bit.dispose; bit = nil end bit end #class Sprite_Debug#def draw_container(txt, n, bitmap) def draw_container(txt, n, bitmap) bitmap.draw_text(12, 0, bitmap.width-32, 24, txt) bitmap.draw_text(0, 0, bitmap.width, 24, n > 0 ? "(#{n})" : "", 2) end #class Sprite_Debug#def draw_player(item, bitmap, blta) def draw_player(item, bitmap, blta) if item != nil bitmap.blt(0, 0, get_character_icon(item, true), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, "(#{item.x};#{item.y})") tile = "" for i in [0, 1, 2] tile += $game_map.data[item.x, item.y, i].to_s + (i != 2 ? ", " : "") end bitmap.draw_text(0, 0, bitmap.width-3, 24, "Tile: #{tile}", 2) if (item.through || item.debug_through?) bitmap.font.size /= 2 bitmap.font.shadow = false col = false for i in -1..2; for j in -1..1 # I could avoid all this, but... next if i == j && i == 0 if i == 2 next if j != 0 col = true i = 0 end bitmap.font.color = col ? Color.new(0,0,0) : Color.new(99,33,55) bitmap.draw_text(i, j+8, 23, 24, "T", 2) break if i == j && j == 0 end; end end end end #class Sprite_Debug#def draw_switch(n, bitmap, blta) def draw_switch(n, bitmap, blta) if n != nil name = $data_system.switches[n] bitmap.blt(0, 0, get_text_icon("S"), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width-32, 24, "[#{n}] #{name}:") bitmap.draw_text(0, 0, bitmap.width, 24, "[O#{$game_switches[n] ? "N" : "FF"}]", 2) end end #class Sprite_Debug#def draw_variable(n, bitmap, blta) def draw_variable(n, bitmap, blta) if n != nil name = $data_system.variables[n] bitmap.blt(0, 0, get_text_icon("V"), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width-32, 24, "[#{n}] #{name}:") bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_variables[n].to_s, 2) end end #class Sprite_Debug#def draw_item(n, bitmap, blta) def draw_item(n, bitmap, blta) item = $data_items[n] if item != nil bitmap.blt(0, 0, get_icon(item.icon_index), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, item.name) bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_party.item_number(item), 2) end end #class Sprite_Debug#def draw_actor(n, bitmap, blta) def draw_actor(n, bitmap, blta) item = $game_actors[n] if item != nil iw = bitmap.width bitmap.draw_text(24, 0, bitmap.width, 24, item.name) wb = Window_Base.new(-(iw+32),-56,iw+32,56) # I get a Window_Base for its wb.draw_actor_name(item, 24, 0) # useful draw_this, draw_that gs = iw-w vals = [-8, -2] if $imported["CoreFixesUpgradesMelody"] || $imported["BattleEngineMelody"] # REQUIRE YEM Battle Engine Melody OR YEM Core Fixes and Upgrades if item.use_rage? vals[0] -= 4; vals[1] -= 4; vals << 0 wb.draw_enemy_rage_gauge(item, 96, vals[2], 48+gs) end # END REQUIRE end wb.draw_actor_hp_gauge(item, 96, vals[0], 48+gs) wb.draw_actor_mp_gauge(item, 96, vals[1], 48+gs) wb.draw_actor_state(item, 154+gs, 0, 48) wb.contents.font.size /= 2 wb.contents.font.shadow = false col = false for i in -1..2; for j in -1..1 next if i == j && i == 0 if i == 2 next if j != 0 col = true i = 0 end wb.contents.font.color = col ? Color.new(0,0,0) : wb.system_color wb.contents.draw_text(i+6-1, j+8, 12, 24, Vocab::level_a) wb.contents.draw_text(i+iw-80+16, j-4, 22, 24, Vocab::atk[0...3]) wb.contents.draw_text(i+iw-48+16, j-4, 22, 24, Vocab::def[0...3]) wb.contents.draw_text(i+iw-80+16, j+6, 22, 24, Vocab::spi[0...3]) wb.contents.draw_text(i+iw-48+16, j+6, 22, 24, Vocab::agi[0...3]) wb.contents.font.color = col ? Color.new(0,0,0) : wb.normal_color wb.contents.draw_text(i, j+8, 23, 24, item.level, 2) wb.contents.draw_text(i+iw-80+26, j-4, 18, 24, item.atk, 2) wb.contents.draw_text(i+iw-48+26, j-4, 18, 24, item.def, 2) wb.contents.draw_text(i+iw-80+26, j+6, 18, 24, item.spi, 2) wb.contents.draw_text(i+iw-48+26, j+6, 18, 24, item.agi, 2) break if i == j && j == 0 end;end bitmap.blt(0, 0, get_character_icon(item), Rect.new(0,0,24,24), blta) bitmap.blt(0, 0, wb.contents, wb.contents.rect, blta) wb.dispose end end #class Sprite_Debug#def draw_event(n, bitmap, blta) def draw_event(n, bitmap, blta) item = $game_map.events[n] if item != nil bitmap.blt(0, 0, get_character_icon(item, true), Rect.new(0,0,24,24), blta) nm = VDEBUG::SHOW_EVENT_NAME ? item.name : "" bitmap.draw_text(24, 0, bitmap.width-3, 24, "[#{item.id}](#{item.x};#{item.y})#{nm}") loc = "ON:" for ss in ['A', 'B', 'C', 'D'] loc += " " + ss + "," if $game_self_switches[[$game_map.map_id, item.id, ss]] end loc[-1] = "" if loc[-1].chr == ',' bitmap.draw_text(0, 0, bitmap.width, 24, loc, 2) if (item.through || item.debug_through?) bitmap.font.size /= 2 bitmap.font.shadow = false col = false for i in -1..2; for j in -1..1 next if i == j && i == 0 if i == 2 next if j != 0 col = true i = 0 end bitmap.font.color = col ? Color.new(0,0,0) : Color.new(99,33,55) bitmap.draw_text(i, j+8, 23, 24, "T", 2) if (item.through || item.debug_through?) break if i == j && j == 0 end; end end else bitmap.blt(0, 0, get_text_icon(n.to_s), Rect.new(0,0,24,24), blta) bitmap.draw_text(0, 0, bitmap.width, 24, "EV#{sprintf("%03d", n)}", 1) end end #class Sprite_Debug#def draw_data(n, bitmap, blta) def draw_data(n, bitmap, blta) item = VDEBUG::useful_data[n] if item != nil && item.is_a?(Array) item = [item] unless item[0].is_a?(Array) return if item.size < 1 str = "" for val in item str += val[0] + " #{val[1]} " end str[-1] = "" if str[-1].chr == " " bitmap.draw_text(0, 0, bitmap.width, 24, str, 1) end end #class Sprite_Debug#def draw_weapon(n, bitmap, blta) def draw_weapon(n, bitmap, blta) item = $data_weapons[n] if item != nil bitmap.blt(0, 0, get_icon(item.icon_index), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, item.name) bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_party.item_number(item), 2) end end #class Sprite_Debug#def draw_armor(n, bitmap, blta) def draw_armor(n, bitmap, blta) item = $data_armors[n] if item != nil bitmap.blt(0, 0, get_icon(item.icon_index), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, item.name) bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_party.item_number(item), 2) end end #class Sprite_Debug#def draw_enemy(n, bitmap, blta) def draw_enemy(n, bitmap, blta) item = $game_troop.members[n-1] iw = bitmap.width if item != nil wb = Window_Base.new(-(iw+32),-56,iw+32,56) # I get a Window_Base for its wb.draw_actor_name(item, 24, 0) # useful draw_this, draw_that gs = iw-w vals = [-8, -2] if $imported["CoreFixesUpgradesMelody"] || $imported["BattleEngineMelody"] # REQUIRE YEM Battle Engine Melody OR YEM Core Fixes and Upgrades if item.use_rage? vals[0] -= 4; vals[1] -= 4; vals << 0 wb.draw_enemy_rage_gauge(item, 96, vals[2], 48+gs) end # END REQUIRE end wb.draw_actor_hp_gauge(item, 96, vals[0], 48+gs) wb.draw_actor_mp_gauge(item, 96, vals[1], 48+gs) wb.draw_actor_state(item, 154+gs, 0, 48) wb.contents.font.size /= 2 wb.contents.font.shadow = false col = false for i in -1..2; for j in -1..1 next if i == j && i == 0 if i == 2 next if j != 0 col = true i = 0 end wb.contents.font.color = col ? Color.new(0,0,0) : wb.system_color wb.contents.draw_text(i+iw-80+16, j-4, 22, 24, Vocab::atk[0...3]) wb.contents.draw_text(i+iw-48+16, j-4, 22, 24, Vocab::def[0...3]) wb.contents.draw_text(i+iw-80+16, j+6, 22, 24, Vocab::spi[0...3]) wb.contents.draw_text(i+iw-48+16, j+6, 22, 24, Vocab::agi[0...3]) wb.contents.font.color = col ? Color.new(0,0,0) : wb.normal_color wb.contents.draw_text(i, j+8, 23, 24, item.letter, 2) wb.contents.draw_text(i+iw-80+26, j-4, 18, 24, item.atk, 2) wb.contents.draw_text(i+iw-48+26, j-4, 18, 24, item.def, 2) wb.contents.draw_text(i+iw-80+26, j+6, 18, 24, item.spi, 2) wb.contents.draw_text(i+iw-48+26, j+6, 18, 24, item.agi, 2) break if i == j && j == 0 end;end bitmap.blt(0, 0, get_enemy_icon(item), Rect.new(0,0,24,24), blta) bitmap.blt(0, 0, wb.contents, wb.contents.rect, blta) wb.dispose else bitmap.blt(0, 0, get_text_icon(n.to_s), Rect.new(0,0,24,24), blta) bitmap.draw_text(0, 0, iw, 24, "...", 1) end end #class Sprite_Debug#def get_icon(index) def get_icon(index) # get an icon with the Window_Base, cache it @icache ||= {} return @icache[index] if @icache[index] wb = Window_Base.new(-56,-56,56,56) wb.draw_icon(index,0,0) bit = wb.contents.clone wb.dispose @icache[index] = bit bit end #class Sprite_Debug#def get_character_icon(chara, dir) def get_character_icon(chara, dir = false) # get iconized character from... if $imported["BattleEngineMelody"] && !dir # actors here have icons ^^ # REQUIRE YEM Battle Engine Melody return get_icon(chara.battler_icon) # END REQUIRE end @icache ||= {} c_id = chara.character_name + "_" + chara.character_index.to_s + "_" + (dir ? chara.direction.to_s : "2") return @icache[c_id] if @icache[c_id] if dir cp = chara.clone cp.transparent = true sc = Sprite_Character.new(nil, cp) # ...a Sprite_Character or... bit = Bitmap.new(24, 24) bit.blt((24-sc.src_rect.width)/2,(24-sc.src_rect.height)/2,sc.bitmap, sc.src_rect) sc.dispose cp = nil else wb = Window_Base.new(-56,-56,56,56) # ...a Window_Base... wb.draw_actor_graphic(chara,12,33) bit = wb.contents.clone wb.dispose end @icache[c_id] = bit # ...and cache it bit end #class Sprite_Debug#def get_text_icon(text) def get_text_icon(text) # get an iconized text, like S, V or numbers @icache ||= {} return @icache[text] if @icache[text] bit = Bitmap.new(24,24) bit.font.shadow = false bit.font.italic = true bit.font.bold = true bit.font.size -= 1 bit.font.color = Color.new(81,59,59, 128) for i in -2..2; for j in -1..1 # draw black text many times around bit.draw_text(i,j+2,24,24,text,1) end; end bit.blur # then blur it bit.font.color = Color.new(255,255,255) bit.draw_text(0,2,24,24,text,1) @icache[text] = bit bit end #class Sprite_Debug#def get_enemy_icon(enemy) def get_enemy_icon(enemy) # get an iconized enemy graphic @icache ||= {} if $imported["BattleEngineMelody"] # battlers here already have an icon ^^ # REQUIRE YEM Battle Engine Melody wtf = enemy.enemy.enemy_icon_hue # enemy enemy enemy enemy enemy xD id = enemy.battler_icon.to_s + "_" + wtf.to_s return @icache[id] if @icache[id] bit = get_icon(enemy.battler_icon).clone bit.hue_change(wtf) if wtf != 0 # END REQUIRE else id = enemy.battler_name + "_" + enemy.battler_hue.to_s return @icache[id] if @icache[id] bit = Bitmap.new(24,24) sb = Sprite_Battler.new(nil, enemy) # get the bitmap from a Sprite_Battler sb.opacity = 0 # don't wanna see the full battler if $imported["TankentaiSideview(Kaduki)"] # REQUIRE RPG Tankentai Sideview Battle System sb.make_battler # Tankentai has its own function for battler drawing # END REQUIRE else sb.update_battler_bitmap # let the graphic be loaded end sb.dispose if sb.bitmap.nil? || sb.bitmap.disposed? # no graphic? return bit if sb.disposed? b2 = Bitmap.new(sb.src_rect.width, sb.src_rect.height) # I get a new bitmap b2.blt(0, 0, sb.bitmap, sb.src_rect) # within src_rect sb.bitmap = b2 # disposing sb even its bitmap will be disposed if b2.width <= 24 || b2.height <= 24 # if little bitmap just center it bit.blt((24-b2.width)/2, (24-b2.height)/2, b2, b2.rect) else # else resize fact = (b2.width > b2.height ? b2.height : b2.width)/24.0 nw = b2.width/fact; nh = b2.height/fact bit.stretch_blt(Rect.new((24-nw)/2, (24-nh)/2, nw, nh), b2, b2.rect) end sb.dispose end @icache[id] = bit bit end #class Sprite_Debug#def update() def update move_around if Input.trigger?(VDEBUG::MOVE_AROUND_KEY) for i in 0...@infos.compact.size v = @infos[i] # set every new value and redraw if needed draw_row(i) if @last_values[i] != (@last_values[i] = collect(v)) end super end end # * operation to create a Visible Debug options screen class Window_VDList < Window_Selectable # a silly, simple, window that handle a list attr_reader :data #class Window_VDList#def initialize(x, y, list, ctd) def initialize(x, y, list = [], ctd = false) super(x, y, Graphics.width/2, Graphics.height-y) @column_max = 1 @cantdisable = ctd self.index = 0 set_list(list) end #class Window_VDList#def set_list(list) def set_list(list) @data = list @item_max = @data.size self.index = @item_max - 1 if self.index > 0 && @item_max < self.index refresh end #class Window_VDList#def enabled?(index) def enabled?(index) return true if @cantdisable !$game_player.sdebug.infos.include?(@data[index]) end #class Window_VDList#def item() def item return @data[self.index] end #class Window_VDList#def add_item(it) def add_item(it) @data.push(it) set_list(@data.compact) end #class Window_VDList#def remove_item(it) def remove_item(it) remove(@data.index(it)) end #class Window_VDList#def remove(index) def remove(index) return if index == nil return if index < 0 return if index >= @data.size @data.delete_at(index) set_list(@data) end #class Window_VDList#def refresh() def refresh create_contents for i in 0...@item_max draw_item(i) end end #class Window_VDList#def draw_item(index) def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) return if @data[index].nil? im = $game_player.sdebug.get_item(@data[index], rect.width-4, enabled?(index)) self.contents.blt(rect.x, rect.y, im, im.rect) if im im.dispose if im end end class Scene_VisibleDebug < Scene_Base # a silly, simple, scene #class Scene_VisibleDebug#def start() def start super create_menu_background @help_window = Window_Help.new @help_window.set_text(VDEBUG::HELP_TEXT) ips = @help_window.height # third list window parameter is the list, fourth is the cantdisable value @mainlist_window = Window_VDList.new(0, ips, VDEBUG::collect_mainlist) @debuglist_window = Window_VDList.new(@mainlist_window.width, ips, $game_player.sdebug.infos, true) @elementlist_window = Window_VDList.new(0, ips) @elementlist_window.visible = false @elementlist_window.active = false @debuglist_window.active = false end #class Scene_VisibleDebug#def terminate() def terminate super dispose_menu_background @help_window.dispose @mainlist_window.dispose @debuglist_window.dispose @elementlist_window.dispose end #class Scene_VisibleDebug#def update() def update super update_menu_background @help_window.update @mainlist_window.update @debuglist_window.update @elementlist_window.update if @mainlist_window.active update_mainlist elsif @debuglist_window.active update_debuglist elsif @elementlist_window.active update_elementlist end end #class Scene_VisibleDebug#def update_mainlist() def update_mainlist if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new return elsif Input.trigger?(Input::C) Sound.play_decision it = @mainlist_window.item if it[0] >= 0 # if item's a item: if @mainlist_window.enabled?(@mainlist_window.index) # add/remove @debuglist_window.add_item(it) else @debuglist_window.remove_item(it) end $game_player.sdebug.infos = @debuglist_window.data # update @mainlist_window.draw_item(@mainlist_window.index) # redraw else # if item's a group: process_elementlist_open(it) # open the sub-list @mainlist_window.active = false @elementlist_window.active = true end elsif Input.trigger?(Input::R) || Input.trigger?(Input::L) Sound.play_cursor @mainlist_window.active = false @debuglist_window.active = true end end #class Scene_VisibleDebug#def update_debuglist() def update_debuglist if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new return elsif Input.trigger?(Input::C) Sound.play_decision @debuglist_window.remove(@debuglist_window.index) # remove the item $game_player.sdebug.infos = @debuglist_window.data # update @mainlist_window.refresh # redraw elsif Input.trigger?(Input::R) || Input.trigger?(Input::L) Sound.play_cursor @mainlist_window.active = true @debuglist_window.active = false end end #class Scene_VisibleDebug#def update_elementlist() def update_elementlist if Input.trigger?(Input::B) Sound.play_cancel @elementlist_window.active = false @mainlist_window.active = true @elementlist_window.close elsif Input.trigger?(Input::C) Sound.play_decision it = @elementlist_window.item if @elementlist_window.enabled?(@elementlist_window.index) # add/remove @debuglist_window.add_item(it) else @debuglist_window.remove_item(it) end $game_player.sdebug.infos = @debuglist_window.data # update @elementlist_window.draw_item(@elementlist_window.index) # redraw end end #class Scene_VisibleDebug#def process_elementlist_open(it) def process_elementlist_open(it) # it contains the type and the size # collect elements of the group vals = [] for d in 1..it[1] # starting from 1, because there aren't IDs 0 vals << [it[0]*-1,d] # the type must be positive end # and let the window appears @elementlist_window.set_list(vals) @elementlist_window.index = 0 @elementlist_window.visible = true @elementlist_window.open end endVisibile ancheBugs e Conflitti Noti
I salvataggi vengono modificati per contenere la lista di dati scelta. È possibile comunque caricare salvataggi precedenti, mentre per continuare ad usare quelli effettuati in presenza dello script, nel caso quest'ultimo venisse rimosso, è presente nella demo un piccolo codicino - per nulla invadente - da lasciare.Altri Dettagli
Grazie aper avermi ispirato l'idea (: -
Visible Debug 1.2
Descrizione
Capita che qualcosa vada storto fra switch e variabili. Non sai cosa succede, sai solo che non funziona come previsto. Qui entra in gioco questo script!
http://img341.imageshack.us/img341/806/visibledebugxp.pngFunzionalità
Con questo script puoi tenere sotto controllo una lista di parametri vari i cui cambiamenti saranno mostrati in tempo reale. Questa lista include:
- switch e variabili, switch locali degli eventi;
- grafica di eventi, giocatore, eroi, nemici;
- posizione e stato 'Come fantasma' di eventi e giocatore;
- id dei tile dove si trova il giocatore;
- numero di oggetti, armi, armature possedute;
- hp, sp, atk, pdef, str, dex, int, agi, stato dei combattenti;
- nomi & livello degli eroi (i nemici non li hanno);
- altre informazioni utili aggiunte dalle configurazioni (puoi vedere come sono fatte e aggiungerne di tue).
Autore
mikb89
Allegati
Demo multilingua v. 1.2 (805 KB)
http://www.mediafire...fazb7tuowp9winyIstruzioni per l'uso
Inserite lo script sotto Materials. Le istruzioni sono fra i commenti.
Script
# Visible Debug v. 1.2 # XP version # by mikb89 # Dettagli: # Capita che qualcosa vada storto fra switch e variabili. Non sai cosa # succede, sai solo che non funziona come previsto. # Con questo script puoi tenere sotto controllo una lista di parametri # vari i cui cambiamenti saranno mostrati in tempo reale. # Questa lista include: # - switch e variabili, switch locali degli eventi; # - grafica di eventi, giocatore, eroi, nemici; # - posizione e stato 'Come fantasma' di eventi e giocatore; # - id dei tile dove si trova il giocatore; # - numero di oggetti, armi, armature possedute; # - hp, sp, atk, pdef, str, dex, int, agi, stato dei combattenti; # - nomi & livello degli eroi (i nemici non li hanno); # - altre informazioni utili aggiunte dalle configurazioni (puoi vedere # come sono fatte e aggiungerne di tue). # Configurazioni: module VDEBUG # Lista di termini da personalizzare come si vuole: HELP_TEXT = "Invio: aggiungi/togli; Pag: cambia lista." # Aiutati! # Cosa appare alla pressione di F9: CALL_CLASSIC_DEBUG_TEXT = "Chiama Debug" CALL_VDEBUG_SETTINGS_TEXT = "Dati Visible Debug" # Nomi delle liste: SWITCH_LIST_TEXT = "Switch" VARIABLE_LIST_TEXT = "Variabili" ITEM_LIST_TEXT = "Oggetti" ACTOR_LIST_TEXT = "Eroi" EVENT_LIST_TEXT = "Eventi" DATA_LIST_TEXT = "Info" WEAPON_LIST_TEXT = "Armi" ARMOR_LIST_TEXT = "Armature" ENEMY_LIST_TEXT = "Nemici" SHOW_EVENT_NAME = true # Mostra nomi di eventi. Metti false per compatibilità. MOVE_AROUND_KEY = Input::ALT # Premendo questo più volte, l'hud del Visible Debug si sposterà nei quattro # angoli dello schermo e si nasconderà. TIME_TO_LOSE = 1 # Meglio lasciarlo così (1). È il tempo da aspettare per ogni aggiornamento. # Non mettere 0 o meno o lo script si fermerà. # Dati disponibili: def self.collect_mainlist poss = [] # Puoi cambiare l'ordine, ma non puoi aggiungere voci. poss << [-1, $data_system.switches.size-1] poss << [-2, $data_system.variables.size-1] poss << [-3, $data_items.size-1] poss << [-4, $data_actors.size-1] poss << [0, $game_player] poss << [-5, $game_map.events.size] # Non serve -1 perché è un Hash. D: poss << [-6, self.useful_data.size-1] poss << [-7, $data_weapons.size-1] poss << [-8, $data_armors.size-1] poss << [-9, [$game_troop.enemies.size, 8].max] poss # A patto che tu non sappia quel che fai, naturalmente. end def self.useful_data da = [nil] # Il primo valore dev'essere nil. da << [["Party:", $game_party.actors.size], # Apri un array, aggiungi. ["G:", $game_party.gold], # Primo valore: stringa mostrata... ["S:", $game_party.steps], # ...secondo valore: variabile col dato. ["T:", self.adjust_time(Graphics.frame_count)], # Ricorda le , ["Sav:", $game_system.save_count]] # Chiudi l'array. # Mostrerà: "Party: 3 G: 333 S: 33 T: 3:33 Sav: 3" con qualcosa # invece di 3. da << ["Timer:", self.adjust_time($game_system.timer)] # Anche un elemento singolo può essere aggiunto. E la variabile # può anche venir fuori da una funzione def. da << [["Map id:", $game_map.map_id], ["Size:", $game_map.width], ["x", $game_map.height]] # Puoi, come esercizio, aggiungere ad esempio il nome mappa. :) # Aggiungi qui le tue info personalizzate! TU puoi. da # Semplicemente restituisce l'array. end def self.adjust_time(value) # Esempio di funzione. Formatta il tempo. value /= Graphics.frame_rate # Graphics.frame_rate = 1 secondo. sec = value % 60 # Ottiene i secondi. value -= sec # Li sottrae. "#{value/60}:#{sprintf("%02d",sec)}" # Restituisce il tempo come min:sec. end end #Codename: vdebug ($imported ||= {})[:mikb89_vdebug] = true # Licenza: # - Puoi chiedermi di includere il supporto per altri script, a patto che usino # il $imported[script] = true; # - Puoi modificare e anche ripostare i miei script, dopo una mia risposta. Per # ripostarli, comunque, devi aver fatto pesanti modifiche o porting, non puoi # fare un post con lo script così com'è; # - Puoi usare i miei script per fare quel che vuoi, da giochi gratis a liberi # a commerciali. Apprezzerei comunque essere messo al corrente di quello che # stai creando; # - Devi creditarmi, se usi questo script o parte di esso. # * operations to let the Visible Debug configuration be available class Scene_Map #class Scene_Map#def call_debug() <- rewritten def call_debug # Clear debug call flag $game_temp.debug_calling = false # Play decision SE $game_system.se_play($data_system.decision_se) # Straighten player position $game_player.straighten # Switch to debug screen $scene = Scene_ChoiceDebug.new end end class Scene_ChoiceDebug #class Scene_ChoiceDebug#def main() def main # Make command window s1 = VDEBUG::CALL_CLASSIC_DEBUG_TEXT s2 = VDEBUG::CALL_VDEBUG_SETTINGS_TEXT s3 = "Cancel" @command_window = Window_Command.new(320, [s1, s2, s3]) @command_window.x = 320 - @command_window.width / 2 @command_window.y = 240 - @command_window.height / 2 # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame Update @command_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new elsif Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $scene = case @command_window.index when 0; Scene_Debug.new when 1; Scene_VisibleDebug.new when 2; Scene_Map.new else; self; end end # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of window @command_window.dispose end end # * operations to let the Visible Debug sprite work #class Game_Event#def name() (class Game_Event; def name; @event.name; end; end) if VDEBUG::SHOW_EVENT_NAME # why isn't the event name readable by default? WHY??? class Scene_End alias_method(:mainSE_b4_vdebug, :main) unless method_defined?(:mainSE_b4_vdebug) #class Scene_End#def main() <- aliased def main mainSE_b4_vdebug # dispose the sprite on Shutdown and To title commands $game_player.sdebug.dispose if !$scene || $scene.is_a?(Scene_Title) end end Thread.new{ wait = VDEBUG::TIME_TO_LOSE loop do wait -= 1 ($game_player.sdebug.update rescue nil) if $game_player && $scene && wait == 0 wait = VDEBUG::TIME_TO_LOSE if wait == 0 end } # USARE QUESTO SOTTO PER DEBUG DATO CHE IL THREAD NON DA MESSAGGI DI ERRORE!!!# #class Scene_Battle#Map # alias upd update unless method_defined?(:upd) # def update # #($game_player.sdebug.update) if $game_player # upd # end #end #DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG DEBUG# class Game_Player < Game_Character # rely sprite on $game_player due to its reperibility. No, I'm not kidding :E #class Game_Player#def sdebug() def sdebug @sdebug ||= Sprite_Debug.new end end class Sprite_Debug < Sprite attr_reader :infos #class Sprite_Debug#def initialize(i, pos, vp) def initialize(i = nil, pos = 0, vp = nil) if vp == nil; super(); else; super(vp); end # viewport? self.infos = (i.is_a?(Array) ? i : [i]) # must be an array self.z = 99999999 # a big value self.opacity = 222 # little transparency @last_values = [] @pos = pos - 1; move_around # position set end #class Sprite_Debug#def move_around() def move_around @pos += 1; @pos %= 5 # increase position, modulate value self.x = 320*(@pos%2) # right/left self.y = 240*(@pos/2) # up/down/out end #class Sprite_Debug#def infos=(i) def infos=(i) @infos = i create_bitmap # once data change, we recreate the image end #class Sprite_Debug#def marshal_dump() def marshal_dump [@infos, @pos, self.viewport] # values to save end #class Sprite_Debug#def marshal_load(data) def marshal_load(data) initialize(data[0] || nil, data[1] || 0, data[2] || nil) end #class Sprite_Debug#def create_bitmap() def create_bitmap self.bitmap.dispose if self.bitmap && !self.bitmap.disposed? h = @infos.size*24 self.bitmap = Bitmap.new(320,[h,1].max) # h is 0, if there's no item for i in 0...@infos.size next if @infos[i] == nil || @infos[i].size < 2 draw_row(i, true) rescue nil end end #class Sprite_Debug#def draw_row(i, new) def draw_row(i, new = false) self.bitmap.fill_rect(0,i*24,320,24,Color.new(0,0,0,0)) unless new # no need # to clear if new im = get_item(@infos[i]) # get the bitmap then blt it. This way I can get return unless im # the same bitmap everywhere ^^ draw_placement(0, i*24) self.bitmap.blt(0, i*24, im, im.rect) im.dispose end #class Sprite_Debug#def draw_placement(x, y) def draw_placement(x, y) self.bitmap.fill_rect(x+4,y+6,320-8,24-8,Color.new(0,0,0,128)) # bLackground end #class Sprite_Debug#def collect(v) def collect(v) # gets the relevant value(s) for each item case v[0] when 0; collect_player when 1; $game_switches[v[1]] when 2; $game_variables[v[1]] when 3; $game_party.item_number(v[1]) when 4; collect_actor($game_actors[v[1]]) when 5; collect_event($game_map.events[v[1]]) when 6; collect_data(VDEBUG::useful_data[v[1]]) when 7; $game_party.weapon_number(v[1]) when 8; $game_party.armor_number(v[1]) when 9; collect_enemy($game_troop.enemies[v[1]-1]) else; nil; end end #class Sprite_Debug#def collect_player() def collect_player da = [] da << $game_player.character_name da << $game_player.character_hue da << $game_player.direction da << $game_player.x da << $game_player.y da << ($game_player.through || ($DEBUG && Input.press?(Input::CTRL))) for i in [0, 1, 2] da << $game_map.data[$game_player.x, $game_player.y, i] end da end #class Sprite_Debug#def collect_actor(actor) def collect_actor(actor) da = [] da << actor.character_name da << actor.character_hue da << actor.name da << actor.level da << actor.hp da << actor.maxhp da << actor.sp da << actor.maxsp da << actor.states da << actor.atk da << actor.pdef da << actor.str da << actor.dex da << actor.int da << actor.agi da end #class Sprite_Debug#def collect_event(event) def collect_event(event) da = [] return da if event.nil? da << event.character_name da << event.character_hue da << event.direction da << event.x da << event.y da << event.through for ss in ['A', 'B', 'C', 'D'] da << $game_self_switches[[$game_map.map_id, event.id, ss]] end da end #class Sprite_Debug#def collect_data(data) def collect_data(data) da = [] return da if data.nil? || !data.is_a?(Array) data = [data] unless data[0].is_a?(Array) return da if data.size < 1 for val in data da << val[1] end da end #class Sprite_Debug#def collect_enemy(enemy) def collect_enemy(enemy) da = [] return da if enemy.nil? da << enemy.battler_name da << enemy.battler_hue da << enemy.name da << enemy.hp da << enemy.maxhp da << enemy.sp da << enemy.maxsp da << enemy.states da << enemy.atk da << enemy.pdef da << enemy.str da << enemy.dex da << enemy.int da << enemy.agi da end #class Sprite_Debug#def get_item(item, width, enabled) def get_item(item, width = 320, enabled = true) # draw item in a bitmap bit = Bitmap.new(width,24) bit.font.color.alpha = blta = enabled ? 255 : 128 case item[0] when -9; draw_container(VDEBUG::ENEMY_LIST_TEXT, item[1], bit) when -8; draw_container(VDEBUG::ARMOR_LIST_TEXT, item[1], bit) when -7; draw_container(VDEBUG::WEAPON_LIST_TEXT, item[1], bit) when -6; draw_container(VDEBUG::DATA_LIST_TEXT, item[1], bit) when -5; draw_container(VDEBUG::EVENT_LIST_TEXT, item[1], bit) when -4; draw_container(VDEBUG::ACTOR_LIST_TEXT, item[1], bit) when -3; draw_container(VDEBUG::ITEM_LIST_TEXT, item[1], bit) when -2; draw_container(VDEBUG::VARIABLE_LIST_TEXT, item[1], bit) when -1; draw_container(VDEBUG::SWITCH_LIST_TEXT, item[1], bit) when 0; draw_player(item[1], bit, blta) when 1; draw_switch(item[1], bit, blta) when 2; draw_variable(item[1], bit, blta) when 3; draw_item(item[1], bit, blta) when 4; draw_actor(item[1], bit, blta) when 5; draw_event(item[1], bit, blta) when 6; draw_data(item[1], bit, blta) when 7; draw_weapon(item[1], bit, blta) when 8; draw_armor(item[1], bit, blta) when 9; draw_enemy(item[1], bit, blta) else; bit.dispose; bit = nil end bit end #class Sprite_Debug#def draw_container(txt, n, bitmap) def draw_container(txt, n, bitmap) bitmap.draw_text(12, 0, bitmap.width-32, 24, txt) bitmap.draw_text(0, 0, bitmap.width, 24, n > 0 ? "(#{n})" : "", 2) end #class Sprite_Debug#def draw_player(item, bitmap, blta) def draw_player(item, bitmap, blta) if item != nil bitmap.blt(0, 0, get_character_icon(item, true), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, "(#{item.x};#{item.y})") tile = "" for i in [0, 1, 2] tile += $game_map.data[item.x, item.y, i].to_s + (i != 2 ? ", " : "") end bitmap.draw_text(0, 0, bitmap.width-3, 24, "Tile: #{tile}", 2) if (item.through || ($DEBUG && Input.press?(Input::CTRL))) bitmap.font.size /= 2 bitmap.font.shadow = false if bitmap.font.respond_to?(:shadow) col = false for i in -1..2; for j in -1..1 # I could avoid all this, but... next if i == j && i == 0 if i == 2 next if j != 0 col = true i = 0 end bitmap.font.color = col ? Color.new(0,0,0) : Color.new(99,33,55) bitmap.draw_text(i, j+8, 23, 24, "T", 2) break if i == j && j == 0 end; end end end end #class Sprite_Debug#def draw_switch(n, bitmap, blta) def draw_switch(n, bitmap, blta) if n != nil name = $data_system.switches[n] bitmap.blt(0, 0, get_text_icon("S"), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width-32, 24, "[#{n}] #{name}:") bitmap.draw_text(0, 0, bitmap.width, 24, "[O#{$game_switches[n] ? "N" : "FF"}]", 2) end end #class Sprite_Debug#def draw_variable(n, bitmap, blta) def draw_variable(n, bitmap, blta) if n != nil name = $data_system.variables[n] bitmap.blt(0, 0, get_text_icon("V"), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width-32, 24, "[#{n}] #{name}:") bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_variables[n].to_s, 2) end end #class Sprite_Debug#def draw_item(n, bitmap, blta) def draw_item(n, bitmap, blta) item = $data_items[n] if item != nil bitmap.blt(0, 0, get_icon(item.icon_name), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, item.name) bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_party.item_number(n).to_s, 2) end end #class Sprite_Debug#def draw_actor(n, bitmap, blta) def draw_actor(n, bitmap, blta) item = $game_actors[n] if item != nil iw = bitmap.width #bitmap.draw_text(24, 0, bitmap.width, 24, item.name) # draw name twice? wb = Window_Base.new(-(iw+32),-56,iw+32,56) # I get a Window_Base for its wb.contents = Bitmap.new(iw+32, 56) wb.draw_actor_name(item, 24, -4) # useful draw_this, draw_that gs = iw-320 vals = [0, 10] #vals[0] -= 4; vals[1] -= 4; vals << 0 wb.draw_actor_state(item, 160+gs, -4, 56) wb.contents.font.size /= 2 wb.contents.font.shadow = false if wb.contents.font.respond_to?(:shadow) col = false for i in -1..2; for j in -1..1 next if i == j && i == 0 if i == 2 next if j != 0 col = true i = 0 end wb.contents.font.color = col ? Color.new(0,0,0) : wb.system_color wb.contents.draw_text(i+106, j+vals[0], 16, 16, $data_system.words.hp) wb.contents.draw_text(i+106, j+vals[1], 16, 16, $data_system.words.sp) wb.contents.draw_text(i+6-1, j+8, 12, 24, "Lv") wb.contents.draw_text(i+iw-112+16, j-4, 22, 24, $data_system.words.atk[0...3]) wb.contents.draw_text(i+iw-48+16, j-4, 22, 24, $data_system.words.pdef[0...3]) wb.contents.draw_text(i+iw-80+16, j-4, 22, 24, $data_system.words.str[0...3]) wb.contents.draw_text(i+iw-80+16, j+6, 22, 24, $data_system.words.dex[0...3]) wb.contents.draw_text(i+iw-112+16, j+6, 22, 24, $data_system.words.int[0...3]) wb.contents.draw_text(i+iw-48+16, j+6, 22, 24, $data_system.words.agi[0...3]) wb.contents.font.color = col ? Color.new(0,0,0) : wb.normal_color wb.contents.draw_text(i, j+8, 23, 24, item.level.to_s, 2) wb.contents.draw_text(i+iw-112+26, j-4, 18, 24, item.atk.to_s, 2) wb.contents.draw_text(i+iw-48+26, j-4, 18, 24, item.pdef.to_s, 2) wb.contents.draw_text(i+iw-80+26, j-4, 18, 24, item.str.to_s, 2) wb.contents.draw_text(i+iw-80+26, j+6, 18, 24, item.dex.to_s, 2) wb.contents.draw_text(i+iw-112+26, j+6, 18, 24, item.int.to_s, 2) wb.contents.draw_text(i+iw-48+26, j+6, 18, 24, item.agi.to_s, 2) wb.contents.draw_text(i+96+16+24, j+vals[0], 6, 16, "/", 1) wb.contents.draw_text(i+96+16+24, j+vals[1], 6, 16, "/", 1) wb.contents.draw_text(i+96+16+30, j+vals[0], 24, 16, item.maxhp.to_s) wb.contents.draw_text(i+96+16+30, j+vals[1], 24, 16, item.maxsp.to_s) unless col wb.contents.font.color = wb.knockout_color if item.hp == 0 wb.contents.font.color = wb.crisis_color if item.hp <= item.maxhp / 4 end wb.contents.draw_text(i+96+16, j+vals[0], 24, 16, item.hp.to_s, 2) unless col wb.contents.font.color = wb.knockout_color if item.sp == 0 wb.contents.font.color = wb.crisis_color if item.sp <= item.maxsp / 4 end wb.contents.draw_text(i+96+16, j+vals[1], 24, 16, item.sp.to_s, 2) break if i == j && j == 0 end; end bitmap.blt(0, 0, get_character_icon(item), Rect.new(0,0,24,24), blta) bitmap.blt(0, 0, wb.contents, wb.contents.rect, blta) wb.dispose end end #class Sprite_Debug#def draw_event(n, bitmap, blta) def draw_event(n, bitmap, blta) item = $game_map.events[n] if item != nil bitmap.blt(0, 0, get_character_icon(item, true), Rect.new(0,0,24,24), blta) nm = VDEBUG::SHOW_EVENT_NAME ? item.name : "" bitmap.draw_text(24, 0, bitmap.width-3, 24, "[#{item.id}](#{item.x};#{item.y})#{nm}") loc = "ON:" for ss in ['A', 'B', 'C', 'D'] loc += " " + ss + "," if $game_self_switches[[$game_map.map_id, item.id, ss]] end loc[-1] = "" if loc[-1].chr == ',' bitmap.draw_text(0, 0, bitmap.width, 24, loc, 2) if item.through bitmap.font.size /= 2 bitmap.font.shadow = false if bitmap.font.respond_to?(:shadow) col = false for i in -1..2; for j in -1..1 next if i == j && i == 0 if i == 2 next if j != 0 col = true i = 0 end bitmap.font.color = col ? Color.new(0,0,0) : Color.new(99,33,55) bitmap.draw_text(i, j+8, 23, 24, "T", 2) if item.through break if i == j && j == 0 end; end end else bitmap.blt(0, 0, get_text_icon(n.to_s), Rect.new(0,0,24,24), blta) bitmap.draw_text(0, 0, bitmap.width, 24, "EV#{sprintf("%03d", n)}", 1) end end #class Sprite_Debug#def draw_data(n, bitmap, blta) def draw_data(n, bitmap, blta) item = VDEBUG::useful_data[n] if item != nil && item.is_a?(Array) item = [item] unless item[0].is_a?(Array) return if item.size < 1 str = "" for val in item str += val[0] + " #{val[1]} " end str[-1] = "" if str[-1].chr == " " bitmap.draw_text(0, 0, bitmap.width, 24, str, 1) end end #class Sprite_Debug#def draw_weapon(n, bitmap, blta) def draw_weapon(n, bitmap, blta) item = $data_weapons[n] if item != nil bitmap.blt(0, 0, get_icon(item.icon_name), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, item.name) bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_party.weapon_number(n).to_s, 2) end end #class Sprite_Debug#def draw_armor(n, bitmap, blta) def draw_armor(n, bitmap, blta) item = $data_armors[n] if item != nil bitmap.blt(0, 0, get_icon(item.icon_name), Rect.new(0,0,24,24), blta) bitmap.draw_text(24, 0, bitmap.width, 24, item.name) bitmap.draw_text(0, 0, bitmap.width-3, 24, $game_party.armor_number(n).to_s, 2) end end #class Sprite_Debug#def draw_enemy(n, bitmap, blta) def draw_enemy(n, bitmap, blta) item = $game_troop.enemies[n-1] iw = bitmap.width if item != nil wb = Window_Base.new(-(iw+32),-56,iw+32,56) # I get a Window_Base for its wb.contents = Bitmap.new(iw+32, 56) wb.draw_actor_name(item, 24, -4) # useful draw_this, draw_that gs = iw-320 vals = [0, 10] #vals[0] -= 4; vals[1] -= 4; vals << 0 wb.draw_actor_state(item, 160+gs, -4, 56) wb.contents.font.size /= 2 wb.contents.font.shadow = false if wb.contents.respond_to?(:shadow) col = false for i in -1..2; for j in -1..1 next if i == j && i == 0 if i == 2 next if j != 0 col = true i = 0 end wb.contents.font.color = col ? Color.new(0,0,0) : wb.system_color wb.contents.draw_text(i+106, j+vals[0], 16, 16, $data_system.words.hp) wb.contents.draw_text(i+106, j+vals[1], 16, 16, $data_system.words.sp) wb.contents.draw_text(i+iw-112+16, j-4, 22, 24, $data_system.words.atk[0...3]) wb.contents.draw_text(i+iw-48+16, j-4, 22, 24, $data_system.words.pdef[0...3]) wb.contents.draw_text(i+iw-80+16, j-4, 22, 24, $data_system.words.str[0...3]) wb.contents.draw_text(i+iw-80+16, j+6, 22, 24, $data_system.words.dex[0...3]) wb.contents.draw_text(i+iw-112+16, j+6, 22, 24, $data_system.words.int[0...3]) wb.contents.draw_text(i+iw-48+16, j+6, 22, 24, $data_system.words.agi[0...3]) wb.contents.font.color = col ? Color.new(0,0,0) : wb.normal_color #wb.contents.draw_text(i, j+8, 23, 24, item.letter, 2) wb.contents.draw_text(i+iw-112+26, j-4, 18, 24, item.atk.to_s, 2) wb.contents.draw_text(i+iw-48+26, j-4, 18, 24, item.pdef.to_s, 2) wb.contents.draw_text(i+iw-80+26, j-4, 18, 24, item.str.to_s, 2) wb.contents.draw_text(i+iw-80+26, j+6, 18, 24, item.dex.to_s, 2) wb.contents.draw_text(i+iw-112+26, j+6, 18, 24, item.int.to_s, 2) wb.contents.draw_text(i+iw-48+26, j+6, 18, 24, item.agi.to_s, 2) wb.contents.draw_text(i+96+16+24, j+vals[0], 6, 16, "/", 1) wb.contents.draw_text(i+96+16+24, j+vals[1], 6, 16, "/", 1) wb.contents.draw_text(i+96+16+30, j+vals[0], 24, 16, item.maxhp.to_s) wb.contents.draw_text(i+96+16+30, j+vals[1], 24, 16, item.maxsp.to_s) unless col wb.contents.font.color = wb.knockout_color if item.hp == 0 wb.contents.font.color = wb.crisis_color if item.hp <= item.maxhp / 4 end wb.contents.draw_text(i+96+16, j+vals[0], 24, 16, item.hp.to_s, 2) unless col wb.contents.font.color = wb.knockout_color if item.sp == 0 wb.contents.font.color = wb.crisis_color if item.sp <= item.maxsp / 4 end wb.contents.draw_text(i+96+16, j+vals[1], 24, 16, item.sp.to_s, 2) break if i == j && j == 0 end; end bitmap.blt(0, 0, get_enemy_icon(item), Rect.new(0,0,24,24), blta) bitmap.blt(0, 0, wb.contents, wb.contents.rect, blta) wb.dispose else bitmap.blt(0, 0, get_text_icon(n.to_s), Rect.new(0,0,24,24), blta) bitmap.draw_text(0, 0, iw, 24, "...", 1) end end #class Sprite_Debug#def get_icon(index) def get_icon(index) # get an icon from cache, recache it @icache ||= {} return @icache[index] if @icache[index] bit = RPG::Cache.icon(index).clone @icache[index] = bit bit end #class Sprite_Debug#def get_character_icon(chara, dir) def get_character_icon(chara, dir = false) # get iconized character from... #if [characters_have_icon] && !dir # actors here have icons ^^ # # REQUIRE Something # return get_icon(chara.battler_icon) # # END REQUIRE #end @icache ||= {} c_id = chara.character_name + "_" + chara.character_hue.to_s + "_" + (dir ? chara.direction.to_s : "2") return @icache[c_id] if @icache[c_id] if dir cp = chara.clone cp.transparent = true return Bitmap.new(24, 24) if !cp.tile_id sc = Sprite_Character.new(nil, cp) # ...a Sprite_Character or... bit = Bitmap.new(24, 24) bit.blt((24-sc.src_rect.width)/2,(24-sc.src_rect.height)/2,sc.bitmap, sc.src_rect) sc.dispose cp = nil else wb = Window_Base.new(-56,-56,56,56) # ...a Window_Base... wb.contents = Bitmap.new(56, 56) wb.draw_actor_graphic(chara,12,33) bit = wb.contents.clone wb.dispose end @icache[c_id] = bit # ...and cache it bit end #class Sprite_Debug#def get_text_icon(text) def get_text_icon(text) # get an iconized text, like S, V or numbers @icache ||= {} return @icache[text] if @icache[text] bit = Bitmap.new(24,24) bit.font.shadow = false if bit.font.respond_to?(:shadow) bit.font.italic = true bit.font.bold = true bit.font.size -= 1 bit.font.color = Color.new(81,59,59, 128) for i in -2..2; for j in -1..1 # draw black text many times around bit.draw_text(i,j+2,24,24,text,1) end; end bit.font.color = Color.new(255,255,255) bit.draw_text(0,2,24,24,text,1) @icache[text] = bit bit end #class Sprite_Debug#def get_enemy_icon(enemy) def get_enemy_icon(enemy) # get an iconized enemy graphic @icache ||= {} #if [characters_have_icon] # battlers here already have an icon ^^ # # REQUIRE Something # ih = enemy.icon_hue # id = enemy.battler_icon.to_s + "_" + ih.to_s # return @icache[id] if @icache[id] # bit = get_icon(enemy.battler_icon).clone # bit.hue_change(ih) if ih != 0 # # END REQUIRE #else id = enemy.battler_name + "_" + enemy.battler_hue.to_s return @icache[id] if @icache[id] bit = Bitmap.new(24,24) sb = Sprite_Battler.new(nil, enemy) # get the bitmap from a Sprite_Battler sb.opacity = 0 # don't wanna see the full battler sb.update # let the graphic be loaded #RPG::Cache.battler(@battler_name, @battler_hue) # if something goes wrong sb.dispose if sb.bitmap.nil? || sb.bitmap.disposed? # no graphic? return bit if sb.disposed? b2 = Bitmap.new(sb.src_rect.width, sb.src_rect.height) # I get a new bitmap b2.blt(0, 0, sb.bitmap, sb.src_rect) # within src_rect sb.bitmap = b2 # disposing sb even its bitmap will be disposed if b2.width <= 24 || b2.height <= 24 # if little bitmap just center it bit.blt((24-b2.width)/2, (24-b2.height)/2, b2, b2.rect) else # else resize fact = (b2.width > b2.height ? b2.height : b2.width)/24.0 nw = b2.width/fact; nh = b2.height/fact bit.stretch_blt(Rect.new((24-nw)/2, (24-nh)/2, nw, nh), b2, b2.rect) end sb.dispose #end @icache[id] = bit bit end #class Sprite_Debug#def update() def update move_around if Input.trigger?(VDEBUG::MOVE_AROUND_KEY) for i in 0...@infos.compact.size v = @infos[i] # set every new value and redraw if needed draw_row(i) if @last_values[i] != (@last_values[i] = collect(v)) end super end end # * operation to create a Visible Debug options screen class Window_VDList < Window_Selectable # a silly, simple, window that handle a list attr_reader :data #class Window_VDList#def initialize(x, y, list, ctd) def initialize(x, y, list = [], ctd = false) super(x, y, 320, 480-y) @column_max = 1 @cantdisable = ctd self.index = 0 set_list(list) end #class Window_VDList#def set_list(list) def set_list(list) @data = list @item_max = @data.size self.index = @item_max - 1 if self.index > 0 && @item_max < self.index self.contents.dispose if self.contents && !self.contents.disposed? self.contents = Bitmap.new(width - 32, [@item_max, 1].max * 32) refresh end #class Window_VDList#def enabled?(index) def enabled?(index) return true if @cantdisable !$game_player.sdebug.infos.include?(@data[index]) end #class Window_VDList#def item() def item return @data[self.index] end #class Window_VDList#def add_item(it) def add_item(it) @data.push(it) set_list(@data.compact) end #class Window_VDList#def remove_item(it) def remove_item(it) remove(@data.index(it)) end #class Window_VDList#def remove(index) def remove(index) return if index == nil return if index < 0 return if index >= @data.size @data.delete_at(index) set_list(@data) end #class Window_VDList#def refresh() def refresh self.contents.clear for i in 0...@item_max draw_item(i) end end #class Window_VDList#def draw_item(index) def draw_item(index) rect = Rect.new(0, 4 + index * 32, width - 32, 24) self.contents.fill_rect(rect, Color.new(0,0,0,0)) return if @data[index].nil? im = $game_player.sdebug.get_item(@data[index], rect.width-4, enabled?(index)) self.contents.blt(rect.x, rect.y, im, im.rect) if im im.dispose if im end end class Scene_VisibleDebug # a silly, simple, scene #class Scene_VisibleDebug#def main() def main @help_window = Window_Help.new @help_window.set_text(VDEBUG::help_TEXT) ips = @help_window.height # third list window parameter is the list, fourth is the cantdisable value @mainlist_window = Window_VDList.new(0, ips, VDEBUG::collect_mainlist) @debuglist_window = Window_VDList.new(@mainlist_window.width, ips, $game_player.sdebug.infos, true) @elementlist_window = Window_VDList.new(0, ips) @elementlist_window.visible = false @elementlist_window.active = false @debuglist_window.active = false # Execute transition 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 # Refresh map $game_map.refresh # Prepare for transition Graphics.freeze @help_window.dispose @mainlist_window.dispose @debuglist_window.dispose @elementlist_window.dispose end #class Scene_VisibleDebug#def update() def update @help_window.update @mainlist_window.update @debuglist_window.update @elementlist_window.update if @mainlist_window.active update_mainlist elsif @debuglist_window.active update_debuglist elsif @elementlist_window.active update_elementlist end end #class Scene_VisibleDebug#def update_mainlist() def update_mainlist if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return elsif Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) it = @mainlist_window.item if it[0] >= 0 # if item's a item: if @mainlist_window.enabled?(@mainlist_window.index) # add/remove @debuglist_window.add_item(it) else @debuglist_window.remove_item(it) end $game_player.sdebug.infos = @debuglist_window.data # update @mainlist_window.draw_item(@mainlist_window.index) # redraw else # if item's a group: process_elementlist_open(it) # open the sub-list @mainlist_window.active = false @elementlist_window.active = true end elsif Input.trigger?(Input::R) || Input.trigger?(Input::L) $game_system.se_play($data_system.cursor_se) @mainlist_window.active = false @debuglist_window.active = true end end #class Scene_VisibleDebug#def update_debuglist() def update_debuglist if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return elsif Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) @debuglist_window.remove(@debuglist_window.index) # remove the item $game_player.sdebug.infos = @debuglist_window.data # update @mainlist_window.refresh # redraw elsif Input.trigger?(Input::R) || Input.trigger?(Input::L) $game_system.se_play($data_system.cursor_se) @mainlist_window.active = true @debuglist_window.active = false end end #class Scene_VisibleDebug#def update_elementlist() def update_elementlist if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @elementlist_window.active = false @mainlist_window.active = true @mainlist_window.visible = true @elementlist_window.visible = false elsif Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) it = @elementlist_window.item if @elementlist_window.enabled?(@elementlist_window.index) # add/remove @debuglist_window.add_item(it) else @debuglist_window.remove_item(it) end $game_player.sdebug.infos = @debuglist_window.data # update @elementlist_window.draw_item(@elementlist_window.index) # redraw end end #class Scene_VisibleDebug#def process_elementlist_open(it) def process_elementlist_open(it) # it contains the type and the size # collect elements of the group vals = [] for d in 1..it[1] # starting from 1, because there aren't IDs 0 vals << [it[0]*-1,d] # the type must be positive end # and let the window appears @elementlist_window.set_list(vals) @elementlist_window.index = 0 @mainlist_window.visible = false @elementlist_window.visible = true end endVisibile anche su PasteBin
Bugs e Conflitti Noti
I salvataggi vengono modificati per contenere la lista di dati scelta. È possibile comunque caricare salvataggi precedenti, mentre per continuare ad usare quelli effettuati in presenza dello script, nel caso quest'ultimo venisse rimosso, è presente nella demo un piccolo codicino - per nulla invadente - da lasciare.
Altri Dettagli
Grazie a @Silver Element per avermi ispirato l'idea (:
-
Negli Rpg Maker dall'XP in poi sono fatti in Ruby, con il Marshal. Quindi tramite Ruby basta un Marshal.load per caricarli.
Per gli script c'è una procedura un po' diversa, ma sempre il Marshal si usa. Vedi qua"]http://www.rpg2s.net...topic=15133]qua[/url]
Gli eventi invece hanno una serie di codici + parametri, e puoi vedere dal Game_Interpreter quale codice corrisponde a cosa, e quanti parametri necessita.
Come player alternativo, ce n'era uno che stava facendo un certo vgfvf ma non mi sembra fosse completo, non l'ho provato però ^^
Ah, open source ;)
-
Eccolo! :D
Bello, mi pare non ci siano script così ^^
Holy però nel VX, nelle istruzioni degli alias cerca di mettere un "unless $@", altrimenti ad ogni colpo di F12 viene ri-aliassizzato tutto. Anche in quel modulo, sono tutti alias incondizionati.
Il più delle volte continua a funzionare tutto, però sarebbe più giusto con la condizione ^^
-
Immagino D:
Però ci sei riuscito ed è venuta bene :D
Nei miei in verità ci perdo la testa anche io ahaha
-
Figo!
Grande che hai usato anche l'$imported :3
E hai fatto più script di me, devo recuperare xD
-
Ma devi togliere un determinato elemento, o l'elemento in una determinata posizione?
Dalla guida di rpg maker:
array = [1, 2, 3, 2, 1] p array.delete(2) # => 2 p array # => [1, 3, 1]
Se devi togliere un determinato elemento (e in questo caso rimuove tutte le occorrenze).
Oppure
array = [0, 1, 2, 3, 4] array.delete_at 2 p array # => [0, 1, 3, 4]
Se ti serve rimuovere ad una determinata posizione.
Per lo scalo degli elementi successivi come vedi è automatico ^^
-
Nell'aria dico in generale però ^^
Più che altro mi piacerebbe lavorare a solo un'engine che faccia funzionare i progetti creati con rpg maker. Su S.E.R.P.E. io invece programmavo l'editor. Quindi non so se mi ci rimetterei.
Kekko ogni tanto lo si vede, ma è sempre indaffarato xD
-
Per quanto ne so (ed essendo il programmatore qualcosa dovrei saperne lol) il progetto è bloccato da un bel po'.
Lo stavamo sviluppando in C# con un'interfaccia Ribbon. A qualcuno piaceva, qualcuno voleva toglierla e boh, so solo che poi non abbiamo continuato più.
Ora, può darsi che gli altri stiano continuando in segreto xD ma per quanto ne so io, non ci si lavora più, no.
Ma comunque l'idea di un qualcosa del genere è sempre lì, nell'aria (:
Che sia un tool migliorato, o un modo di far girare i giochi in qualche altro posto, secondo me prima o poi qualcuno riuscirà a fare qualcosa in merito.
E comunque a me piace già un sacco VX Ace ^^
-
Ah, capisco.
Beh, in questo caso credo abbiate ragione. Spirito artistico (:
Grazie per gli auguri ^^

- AIUTO CONFIGURAZIONE TASTIERA VX-ACE X CABINATO
in Supporto VX e VX-Ace
Posted
Salve :3
Ecco, puoi usare questo qui:
# ReMapped Keys v. 1.0 # VX Ace version # by mikb89 # Dettagli: # Questo script permette di rimappare i tasti, utile se usate uno script per la # tastiera estesa, come quello di Keroro. Metti caso che ad esempio volete far # girare il vostro gioco su un cabinato, ecco, questo script sembra fatto # apposta per voi! xD # Configurazioni: module REMAP ASSIGN = { # Tasti direzionali (Frecce e PagSu/Giù): #:DOWN =>, #:LEFT =>, #:RIGHT =>, #:UP =>, #:L =>, #:R =>, # Tasti di interazione: :A => :NUM4, # Tasto SHIFT: quello per la corsa. :B => :NUM3, # Tasto Esc: menu, annulla, indietro... :C => :NUM2, # Tasto Invio: azione, seleziona, ok... # Tasti aggiuntivi: :X => :NUM5, :Y => :NUM6, :Z => :NUM7, } #Impostate qui su i vari tasti (dipende dallo script di tastiera estesa in uso) end #Codename: remap ($imported ||= {})[:mikb89_remap] = true # License: # - You can ask me to include support for other scripts as long as these scripts # use the $imported[script] = true; # - You can modify and even repost my scripts, after having received a response # by me. For reposting it, anyway, you must have done heavy edit or porting, # you can't do a post with the script as is; # - You can use my scripts for whatever you want, from free to open to # commercial games. I'd appreciate by the way if you let me know about what # you're doing; # - You must credit me, if you use this script or part of it. class << Input alias press_b4_remap press? unless method_defined?(:press_b4_remap) alias trigg_b4_remap trigger? unless method_defined?(:trigg_b4_remap) alias repeat_b4_remap repeat? unless method_defined?(:repeat_b4_remap) end module Input module_function def press?(key) key = REMAP::ASSIGN[key] if REMAP::ASSIGN.include?(key) press_b4_remap(key) end def trigger?(key) key = REMAP::ASSIGN[key] if REMAP::ASSIGN.include?(key) trigg_b4_remap(key) end def repeat?(key) key = REMAP::ASSIGN[key] if REMAP::ASSIGN.include?(key) repeat_b4_remap(key) end endCrea un nuovo script sotto quello di Keroro e gli incolli questo dentro.
Dovrebbe già funzionare, ho messo 2 per Invio, 3 per Esc e 4 per Shift. 5, 6 e 7 per gli altri tasti che però non credo usi.
Ma i tasti corrispondono a quelli del tastierino numerico o ai tasti che sono in fila nella parte superiore della tastiera? Perché io ho preso in considerazione il secondo caso, ma non c'è problema a modificare... e poi, i tasti freccia funzionano già? O c'è bisogno di rimappare anche quelli? D:
Poi magari questo script lo posto nell'apposita sezione ^^