Johnny 97 Posted October 14, 2010 Share Posted October 14, 2010 (edited) Cheats WindowDescrizioneConsideratelo pure come un mio ingresso nel mondo dello scripting! Oggi, festeggio il mio primo script... Cioè, non l'ho fatto io, ma mi sono limitato ad adattarlo per VX, comunque, per uno come me che non ha mai studiato programmazione è un buon inizio, e poi, è da una giornata intera che continuo a cambiare value, variabili, classi, metodi e altro... Non è stato mica facile!!! Grazie a questo script adesso, potrete inserire dei cheats nel vostro gioco! AutoreBudsieBuds per aver creato lo script;Alex'94 & mew2 per averlo migliorato eJohnny 97 (cioè io!) per averlo adattato al VX Istruzioni per l'usoDentro lo script Script #===============================================================================#===========================# Con questo script potrete aggiungere dei cheats al vostro gioco. Inserite# nel Call Script $scene = Scene_Cheats.new per chiamare la finestra di # inserimento. Alla 51° riga troverete altre istruzioni.#===============================================================================#===========================#------------------------------------------------------------------------------# by BudsieBuds Modificato da Alex'94 & mew2 Adattato per VX da Johnny 97#==============================================================================class Scene_Cheats#--------------------------------------------------------------------------# def main#--------------------------------------------------------------------------def main @edit_window = Window_CheatsEdit.new @input_window = Window_CheatsInput.new Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @edit_window.dispose @input_window.disposeend#--------------------------------------------------------------------------# def update#--------------------------------------------------------------------------def update @edit_window.update @input_window.update if Input.repeat?(Input::B) if @edit_window.index == 0 return end Audio.se_play("Audio/SE/" + "Cancel", 100, 50) @edit_window.back return end if Input.trigger?(Input::C) if @input_window.character == nil @cheat_word = @edit_window.cheat.downcase # START EDITING // #===============================================================================#===========================## elsif @cheat_word == "Per iniziare a mettere nuovi trucchi nel gioco." #Queste sono le combinazioni# $game_party.gain_item(Item ID, How many) #per inserire altri oggetti# $game_party.gain_gold(How many) # Per inserire altro oro# $game_party.gain_weapon(Weapon ID, How many) #Per inserire nuove armi# $game_party.gain_armor(Armor ID, How many) # Per inserire nuove armature# $game_party.actors[Actor ID].learn_skill(Skill ID) # Per inserire nuove magie# $game_system.se_play($data_system.decision_se) # Questo è il suono di verifica## Il primo codice deve iniziare con 'if' invece che con 'elsif'!##===============================================================================#=========================== if @cheat_word == "everythingismine" $game_party.gain_gold(20) # 20 Gold $game_party.gain_item(17, 3) # 3x Seed of Life $game_system.se_play($data_system.decision_se) elsif @cheat_word == "iamarealfighter" $game_party.gain_weapon(1, 2) # 2x Bronze Sword $game_party.gain_armor(21, 1) # 1x Cotton Robe $game_system.se_play($data_system.decision_se) # STOP EDITING else Audio.se_play("Audio/SE/" + "Buzzer2", 100, 50) end $scene = Scene_Map.new Graphics.resize_screen(544, 416) return end if @input_window.character == "" Audio.se_play("Audio/SE/" + "Buzzer2", 100, 50) return end Audio.se_play("Audio/SE/" + "Decision2", 100, 50) @edit_window.add(@input_window.character) return endendend #==============================================================================# Window_Base#------------------------------------------------------------------------------# by BudsieBuds Modificato da Alex'94 & mew2 Adattato per VX da Johnny 97#============================================================================== class Window_Base < Window def draw_icon_graphic(icon, x, y) bitmap = Cache.system("cursor") cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)endend #==============================================================================# Window_CheatsEdit#------------------------------------------------------------------------------# by BudsieBuds Modificato da Alex'94 & mew2 Adattato per VX da Johnny 97#============================================================================== class Window_CheatsEdit < Window_Base#--------------------------------------------------------------------------# def ?!#--------------------------------------------------------------------------attr_reader :cheatattr_reader :index#--------------------------------------------------------------------------# def initialize#--------------------------------------------------------------------------def initialize super(0, 0, 640, 128) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.size = $fontsize == nil ? Font.default_size : $fontsize self.contents.font.name = $fontface == nil ? Font.default_name : $fontface @max_char = 17 @index = 0 @cheat = "" refresh update_cursor_rectend#--------------------------------------------------------------------------# def add(character)#--------------------------------------------------------------------------def add(character) if @index < @max_char and character != "" @cheat += character @index += 1 refresh update_cursor_rect endend#--------------------------------------------------------------------------# def back#--------------------------------------------------------------------------def back if @index > 0 name_array = @cheat.split(//) @cheat = "" for i in 0...name_array.size-1 @cheat += name_array[i] end @index -= 1 refresh update_cursor_rect endend#--------------------------------------------------------------------------# def refresh#--------------------------------------------------------------------------def refresh self.contents.clear name_array = @cheat.split(//) for i in 0...@max_char c = name_array[i] if c == nil c = "_" end x = (i + 1) * 32 self.contents.draw_text(x, 32, 28, 32, c, 1) end draw_icon_graphic("cheat", 16, 60)end#--------------------------------------------------------------------------# def update_cursor_rect#--------------------------------------------------------------------------def update_cursor_rect x = (@index + 1) * 32 self.cursor_rect.set(x, 32, 28, 32)end#--------------------------------------------------------------------------# def update#--------------------------------------------------------------------------def update super update_cursor_rectendend #==============================================================================# Window_CheatsInput#------------------------------------------------------------------------------# by BudsieBuds Modificato da Alex'94 & mew2 Adattato per VX da Johnny 97#============================================================================== class Window_CheatsInput < Window_BaseCHARACTER_TABLE =[ 'A','B','C','D','E', 'F','G','H','I','J', 'K','L','M','N','O', 'P','Q','R','S','T', 'U','V','W','X','Y', 'Z','@','"','!','£', '$','%','&','/','(', '<','>','|','[',']', '#','{','}','©','®', 'a','b','c','d','e', 'f','g','h','i','j', 'k','l','m','n','o', 'p','q','r','s','t', 'u','v','w','x','y', 'z',')','=','?','^', ',','.','-','_','€', '1','2','3','4','5', '6','7','8','9','0',]#--------------------------------------------------------------------------# def initialize#--------------------------------------------------------------------------def initialize Graphics.resize_screen(640, 480) super(0, 128, 640, 352) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.size = $fontsize == nil ? Font.default_size : $fontsize self.contents.font.name = $fontface == nil ? Font.default_name : $fontface @index = 0 refresh update_cursor_rectend#--------------------------------------------------------------------------# def character#--------------------------------------------------------------------------def character return CHARACTER_TABLE[@index]end#--------------------------------------------------------------------------# def refresh#--------------------------------------------------------------------------def refresh self.contents.clear for i in 0...90 x = 140 + i / 5 / 9 * 180 + i % 5 * 32 y = i / 5 % 9 * 32 self.contents.draw_text(x, y, 32, 32, CHARACTER_TABLE[i], 1) end self.contents.draw_text(428, 9 * 32, 48, 32, "OK", 1) end#--------------------------------------------------------------------------# def update_cursor_rect#--------------------------------------------------------------------------def update_cursor_rect if @index >= 90 self.cursor_rect.set(428, 9 * 32, 48, 32) else x = 140 + @index / 5 / 9 * 180 + @index % 5 * 32 y = @index / 5 % 9 * 32 self.cursor_rect.set(x, y, 32, 32) endend#--------------------------------------------------------------------------# def update#--------------------------------------------------------------------------def update super if @index >= 90 if Input.trigger?(Input::DOWN) Audio.se_play("Audio/SE/" + "Cursor", 100, 50) @index -= 90 end if Input.repeat?(Input::UP) Audio.se_play("Audio/SE/" + "Cursor", 100, 50) @index -= 90 - 40 end else if Input.repeat?(Input::RIGHT) if Input.trigger?(Input::RIGHT) or @index / 45 < 3 or @index % 5 < 4 Audio.se_play("Audio/SE/" + "Cursor", 100, 50) if @index % 5 < 4 @index += 1 else @index += 45 - 4 end if @index >= 90 @index -= 90 end end end if Input.repeat?(Input::LEFT) if Input.trigger?(Input::LEFT) or @index / 45 > 0 or @index % 5 > 0 Audio.se_play("Audio/SE/" + "Cursor", 100, 50) if @index % 5 > 0 @index -= 1 else @index -= 45 - 4 end if @index < 0 @index += 90 end end end if Input.repeat?(Input::DOWN) Audio.se_play("Audio/SE/" + "Cursor", 100, 50) if @index % 45 < 40 @index += 5 else @index += 90 - 40 end end if Input.repeat?(Input::UP) if Input.trigger?(Input::UP) or @index % 45 >= 5 Audio.se_play("Audio/SE/" + "Cursor", 100, 50) if @index % 45 >= 5 @index -= 5 else @index += 90 end end end if Input.repeat?(Input::L) or Input.repeat?(Input::R) Audio.se_play("Audio/SE/" + "Cursor", 100, 50) if @index < 45 @index += 45 else @index -= 45 end end end update_cursor_rectendend Bugs e Conflitti NotiN/A Lo SPOILER non mi funziona... Qualcuno mi sa dire perché? Edited February 4, 2011 by Johnny 97 Link to comment Share on other sites More sharing options...
Dexter Posted October 14, 2010 Share Posted October 14, 2010 Di script per i cheat nel vx mi sembra ce ne siano già!^^Però hai comunque fatto un buon lavoro, io non saprei neanche da dove cominciare!=PBravo! http://img89.imageshack.us/img89/618/qzfc.pngPremi:http://i49.tinypic.com/2cpdkb8.jpghttp://i40.tinypic.com/w0tfev.jpghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://www.rpgmkr.net/contest/screen-contest-primo.pnghttp://www.rpgmkr.net/contest/screen-contest-secondo.pnghttp://www.rpgmkr.net/contest/screen-contest-secondo.png http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gif http://oi60.tinypic.com/206c3nc.jpg Link to comment Share on other sites More sharing options...
Johnny 97 Posted October 15, 2010 Author Share Posted October 15, 2010 Di script per i cheat nel vx mi sembra ce ne siano già!^^Però hai comunque fatto un buon lavoro, io non saprei neanche da dove cominciare!=PBravo! Se ti metti a leggere script, una buon parte della programmazione la capisci... Comunque, grazie... Per quanto riguarda ad altri script su cheat nel VX non ce n'erano, ovviamente ho cercato prima di fare tutto questo lavoro... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now