-
Posts
1,352 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Calendar
Everything posted by Squall_Leonheart
-
Non mostra proprio + la picture
-
Non mi si vede proprio...appare solo il numero dei soldi e se scelgo la finestra...Ma la picture non la dispone proprio #==============================================================================# ** Window_Gold#------------------------------------------------------------------------------# This window displays amount of gold.#============================================================================== class Window_Gold < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 640, 64) self.contents = Bitmap.new(width - 32, height - 32) bitmap = RPG::Cache.picture("HUD_GOLD") self.contents.blt(640, 64 , bitmap, Rect.new(0, 0, 640, 64), 255) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.name = "Anime Ace 2.0 BB" cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(480, 0, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = normal_color self.contents.draw_text(600-cx, 0, cx, 32, $data_system.words.gold, 2) endend
-
[code="ruby"#========================================================================== ==== # ** Window_Gold #------------------------------------------------------------------------------ # This window displays amount of gold. #============================================================================== class Window_Gold < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 640, 64) self.contents = Bitmap.new(width - 32, height - 32) @gold = Sprite.new @gold.bitmap = Bitmap.new("Graphics/Pictures/HUD_GOLD") @gold.opacity = 170 refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.name = "Anime Ace 2.0 BB" cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = normal_color self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2) end end][/code] Fatto,questa è la window_gold modificata ma mi fa lo stesso difetto...Non scompare l'img
-
Allora questo l'ho fatto,il mio problema è che l'immagine di sfondo della window gold non scompare alla pressione del tasto che la rende invisibile #==============================================================================# ** Scene_Map#------------------------------------------------------------------------------# This class performs map screen processing.#============================================================================== class Scene_Map #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make sprite set @spriteset = Spriteset_Map.new # Make message window @message_window = Window_Message.new @window_gold = Scene_Gold.new # Transition run Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of sprite set @spriteset.dispose # Dispose of message window @message_window.dispose # If switching to title screen if $scene.is_a?(Scene_Title) # Fade out screen Graphics.transition Graphics.freeze end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Loop loop do # Update map, interpreter, and player order # (this update order is important for when conditions are fulfilled # to run any event, and the player isn't provided the opportunity to # move in an instant) $game_map.update $game_system.map_interpreter.update $game_player.update # Update system (timer), screen $game_system.update $game_screen.update # Abort loop if player isn't place moving unless $game_temp.player_transferring break end # Run place move transfer_player # Abort loop if transition processing if $game_temp.transition_processing break end end # Update sprite set @spriteset.update # Update message window @message_window.update # If game over if $game_temp.gameover # Switch to game over screen $scene = Scene_Gameover.new return end # If returning to title screen if $game_temp.to_title # Change to title screen $scene = Scene_Title.new return end # If transition processing if $game_temp.transition_processing # Clear transition processing flag $game_temp.transition_processing = false # Execute transition if $game_temp.transition_name == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name) end end # If showing message window if $game_temp.message_window_showing return end # If encounter list isn't empty, and encounter count is 0 if $game_player.encounter_count == 0 and $game_map.encounter_list != [] # If event is running or encounter is not forbidden unless $game_system.map_interpreter.running? or $game_system.encounter_disabled # Confirm troop n = rand($game_map.encounter_list.size) troop_id = $game_map.encounter_list[n] # If troop is valid if $data_troops[troop_id] != nil # Set battle calling flag $game_temp.battle_calling = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil end end end if Input.trigger?(Input::A) @window_gold.visible = !@window_gold.visible end # If B button was pressed if Input.trigger?(Input::B) # If event is running, or menu is not forbidden unless $game_system.map_interpreter.running? or $game_system.menu_disabled # Set menu calling flag or beep flag $game_temp.menu_calling = true $game_temp.menu_beep = true end end # If debug mode is ON and F9 key was pressed if $DEBUG and Input.press?(Input::F9) # Set debug calling flag $game_temp.debug_calling = true end # If player is not moving unless $game_player.moving? # Run calling of each screen if $game_temp.battle_calling call_battle elsif $game_temp.shop_calling call_shop elsif $game_temp.name_calling call_name elsif $game_temp.menu_calling call_menu elsif $game_temp.save_calling call_save elsif $game_temp.debug_calling call_debug end end end #-------------------------------------------------------------------------- # * Battle Call #-------------------------------------------------------------------------- def call_battle # Clear battle calling flag $game_temp.battle_calling = false # Clear menu calling flag $game_temp.menu_calling = false $game_temp.menu_beep = false # Make encounter count $game_player.make_encounter_count # Memorize map BGM and stop BGM $game_temp.map_bgm = $game_system.playing_bgm $game_system.bgm_stop # Play battle start SE $game_system.se_play($data_system.battle_start_se) # Play battle BGM $game_system.bgm_play($game_system.battle_bgm) # Straighten player position $game_player.straighten # Switch to battle screen $scene = Scene_Battle.new end #-------------------------------------------------------------------------- # * Shop Call #-------------------------------------------------------------------------- def call_shop # Clear shop call flag $game_temp.shop_calling = false # Straighten player position $game_player.straighten # Switch to shop screen $scene = Scene_Shop.new end #-------------------------------------------------------------------------- # * Name Input Call #-------------------------------------------------------------------------- def call_name # Clear name input call flag $game_temp.name_calling = false # Straighten player position $game_player.straighten # Switch to name input screen $scene = Scene_Name.new end #-------------------------------------------------------------------------- # * Menu Call #-------------------------------------------------------------------------- def call_menu # Clear menu call flag $game_temp.menu_calling = false # If menu beep flag is set if $game_temp.menu_beep # Play decision SE $game_system.se_play($data_system.decision_se) # Clear menu beep flag $game_temp.menu_beep = false end # Straighten player position $game_player.straighten # Switch to menu screen $scene = Scene_Menu.new end #-------------------------------------------------------------------------- # * Save Call #-------------------------------------------------------------------------- def call_save # Straighten player position $game_player.straighten # Switch to save screen $scene = Scene_Save.new end #-------------------------------------------------------------------------- # * Debug Call #-------------------------------------------------------------------------- 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_Debug.new end #-------------------------------------------------------------------------- # * Player Place Move #-------------------------------------------------------------------------- def transfer_player # Clear player place move call flag $game_temp.player_transferring = false # If move destination is different than current map if $game_map.map_id != $game_temp.player_new_map_id # Set up a new map $game_map.setup($game_temp.player_new_map_id) end # Set up player position $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y) # Set player direction case $game_temp.player_new_direction when 2 # down $game_player.turn_down when 4 # left $game_player.turn_left when 6 # right $game_player.turn_right when 8 # up $game_player.turn_up end # Straighten player position $game_player.straighten # Update map (run parallel process event) $game_map.update # Remake sprite set @spriteset.dispose @spriteset = Spriteset_Map.new # If processing transition if $game_temp.transition_processing # Clear transition processing flag $game_temp.transition_processing = false # Execute transition Graphics.transition(20) end # Run automatic change for BGM and BGS set on the map $game_map.autoplay # Frame reset Graphics.frame_reset # Update input information Input.update endend Questa è la Scene_Map modificata da me.
-
Allora,si ora mi sono accorto di avero scritto in maniera errata,ora è + logico: #==============================================================================# ** Scene_Gold_Gold#============================================================================== class Scene_Gold < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 640, 64) self.contents = Bitmap.new(width - 32, height - 32) @gold = Sprite.new @gold.bitmap = Bitmap.new("Graphics/Pictures/HUD_GOLD") @gold.opacity = 170 refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(480, 0, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = normal_color self.contents.draw_text(600-cx, 0, cx, 32, $data_system.words.gold, 2) end def update_command if Input.trigger?(Input::A) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to menu screen $scene = Scene_Map.new return end end end Poi,giver la tua soluzione non dà errori ma nemmeno risultati:/ quando ripremo A da trasparente l mette visibile:/ Riguardo la window,inizialmente avevo impostato in un evento che alla pressione di un tasto la window gold diventasse visibile e alla ripressione invisibile...Però non mi garbava la grafica quindi ho optato per questa soluzione...Ma non capisco perchè non si toglie l'immagine alla pressione:S :rovatfl: Per richiamare tramite evento ho scritto: Window_Gold = Scene_Gold.newWindow_Gold.visible = trueWindow_Gold.opacity = 0 E per toglierlo Window_Gold.visible = false
-
Dunque,il mio problema è questo: Quando premo A per tornare alla mappa non mi elimina la picture,eccovi lo script(Lo script sarebbe una window picture che mostra i soldi su mappa alla pressione di A) #==============================================================================# ** Scene_Gold_Gold#============================================================================== class Scene_Gold < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 640, 64) self.contents = Bitmap.new(width - 32, height - 32) @gold = Sprite.new @gold.bitmap = Bitmap.new("Graphics/Pictures/HUD_GOLD") @gold.opacity = 170 refresh end if Input.trigger?(Input::A) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to menu screen $scene = Scene_Map.new return end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(480, 0, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = normal_color self.contents.draw_text(600-cx, 0, cx, 32, $data_system.words.gold, 2) endend
-
Ma se il tema è questo...Cioè questi tre motivi devono essere illustrati con immagini significative anke con vignette magari? Perkè io già nello slogan vedo 3 motivixD
-
Salve,mi chiedevo se esistesse uno script per le ombre che non rikiedeva l'SDK ke provoca una miriade di conflitti...
-
Scelta per il PG iniziale
Squall_Leonheart replied to webelli's question in Richieste scripts RGSS (XP)
Avrei una cosa da chiedervi riguardo questo script...C'è un modo per far si che ogni pg scelto ha una sua mappa iniziale?Tipo eroe 1 mappa 1 eroe 2 mappa 2 -
Salve,con un processo parallelo stavo cercando di far apparire un immagine relativa all'eroe con questo comando: @hud = Sprite.new @hud.bitmap = Bitmap.new("Graphics/Pictures/"+@actor.hero_name) Però mi dà l'errore...E se scrivo direttamente il nome dell'img mi riporta la mancanza dell'initialize... Ho provato anke a cambiare hero con battler ma niente. Cosa devo fare?Creare tutta una scene_window e dargli il richiamo tramite script?
-
Se cerchi nel forum ne postai uno io,perkè avevo qlk problema con l' RTAB
-
Onorevole maestro,ho provato una variante dello scene extra *-* Prima cosa l'ho messa nel menù e non nel title...Aggiungendo L's4 con il when etc... Poi nella scena ho introdotto la help window,ho utilizzato questo metodo #==============================================================================# - Scene_Extra#------------------------------------------------------------------------------# La scena coi contenuti extra#============================================================================== class Scene_Extra #-------------------------------------------------------------------------- # - Processo Principale #-------------------------------------------------------------------------- def main # Inizializza l'indice @pic_index = 0 # Inizializza la picture @picture = Sprite.new @picture.bitmap = Bitmap.new(640,480) @picture.x = 320 @picture.y = 240 @help_window = Window_Help.new @help_window.y = 480-64 @help_window.opacity = 255 # Fade Graphics.transition loop do # Aggiornamento Grafica Graphics.update # Aggiornamento Input Input.update # Aggiornamento Frame update # Quando cambia la scena blocca il loop if $scene != self break end end # Preparazione Fade Graphics.freeze # Eliminazione picture @picture.dispose @help_window.dispose end #-------------------------------------------------------------------------- # - Aggiornamento Frame #-------------------------------------------------------------------------- def update # Quando SX è premuto if Input.repeat?(Input::LEFT) # Se l'indice è 0 deve ritornare # al valore 4 if Input.trigger?(Input::LEFT) or @pic_index > 0 # Suona SE Cursore $game_system.se_play($data_system.cursor_se) # Riduci l'indice @pic_index = (@pic_index - 1) % 5 return end end # Quando DX è premuto if Input.repeat?(Input::RIGHT) # Se l'indice è 4 deve ritornare # al valore 0 if Input.trigger?(Input::RIGHT) or @pic_index < 4 # Suona SE Cursore $game_system.se_play($data_system.cursor_se) # Aumenta l'indice @pic_index = (@pic_index + 1) % 5 return end end # Quando B è premuto if Input.trigger?(Input::B) # Suona SE Annulla $game_system.se_play($data_system.cancel_se) # Torna alla mappa $scene = Scene_Menu.new return end # Quando C è premuto if Input.trigger?(Input::C) # Suona SE Azione Impossibile $game_system.se_play($data_system.buzzer_se) return end #Setta l'help per ogni immagine if @pic_index > -1 @help_window.set_text("File Humanoid.") end if @pic_index > 0 @help_window.set_text("Ancora?") end if @pic_index > 1 @help_window.set_text("O frà tu si malat") end if @pic_index > 2 @help_window.set_text("...") end if @pic_index > 3 @help_window.set_text("Ti skifo.") end # Seleziona l'immagine pic = @pic_index + 1 @picture.bitmap= RPG::Cache.picture(pic.to_s+".png") # Centra l'immagine @picture.ox = @picture.bitmap.width / 2 @picture.oy = @picture.bitmap.height / 2 @picture.update return end end Ora vorrei impostare alcune che devono sbloccarsi sotto un ordine impostato tramite chiama script...Quel vorrei mi illudeXD P.s. Ignorate i commenti nell'helpxD
-
Grazie Giver...Il modulo detto da Giver si trova nello Xas Sistem...Io ho copiato in un altra classe solo quello insieme alla classe di sopra...Ora funge.
-
Si ho provato su un nuovo progetto senza nessuno script e mi dà l'errore
-
Salve gente,ritorno a seccareXD Dunque ho trovato all'interno della demo Xas Hero uno script che permette al chara un animazione da fermo...L'autore sta scritto all'interno dello script...Il punto è che quando lo passo su un nuovo progetto mi dà un errore alla tredicisima riga( new_name = filename + SUFFIX filename = new_name if RPG_FileTest.character_exist?(new_name))...Vedete se ci capite voi perchè non ne vengo a capo. #===============================================================================# By Xiderowg / 桜雅 在土 # [url="http://xms.rdy.jp/"]http://xms.rdy.jp/[/url]# [url="http://scriptshelf.jpn.org/x/"]http://scriptshelf.jpn.org/x/[/url]#===============================================================================module XRXS_BreakActs SUFFIX = "_ANI" WCOUNT = 0 def character_name filename = super if @breakacting new_name = filename + SUFFIX filename = new_name if RPG_FileTest.character_exist?(new_name) end return filename end def breakact=(b) @breakacting = b @step_anime = b end def update super if controllable? if @breakact_count.to_i > 0 @breakact_count -= 1 else self.breakact = true end else @breakact_count = WCOUNT unless self.action != nil or $game_map.starting? or self.knockbacking? self.breakact = false end end endendclass Game_Player < Game_Character include XRXS_BreakActsendclass Game_Player < Game_Character def controllable? return !(moving? or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing or Input.trigger?(Input::C) or Input.press?(Input::C) or Input.trigger?(Input::Y) or Input.press?(Input::Y) or Input.trigger?(Input::Z) or Input.press?(Input::Z) or Input.trigger?(Input::A) or Input.press?(Input::A) or Input.trigger?(Input::LEFT) or Input.trigger?(Input::RIGHT) or Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN) or Input.press?(Input::LEFT) or Input.press?(Input::RIGHT) or Input.press?(Input::UP) or Input.press?(Input::DOWN)) endend
-
Figurati è stato un piacere^^ Credo che confrontarsi con demo etc sia uno dei metodi fondamentali per far crescere il making italiano(che non è al top,per niente) Se ti serve una mano per qualcosa non esitare a chiedere^^
-
Si a meno che le date nei post siano taroccatexD Comunque chiedere uno script del genere e come chiedere di farsi impostare il giocoxD Il mio consiglio è di farli con le scelte...Tipo scegli il sesso e attivi lo switch maskio e di conseguenza metti la if... Prima di fare questo scaricati dei tutorial sulle switch e sulle variabili che è meglio.
-
Ciao,premetto che sono riuscito a giocare fin quando quell'essere nell'aula di astronomia non mi ha fatto fare gameoverxD Dunque vediamo,mi piace la intro ed il title,in linea di massima la grafica è buono per lo stile di gioco. L'idea del documento e del bs uguale a parasite evil le apprezzo molto,anche se la grafica del bs non la vedo molto fluida... Il sonoro invece è quasi tutto rippato...Che dire,la storia ha una sua strada è mi fa piacere..Ma in linea di massima non mi tocca molto...Sarà che non riesco a vedere ler risorse stile rtp usate per un horrorXD Comunque è un buon gioco,Cerca di dargli più atmosfera e di migliorare la grafica nel bs Spero di rigiocarci appena avrò un pò di tempo(Quel maledetto deve pagarlaxD) Buona fortuna se parteci al contest^^ Ciauz
-
Ti ringrazio,ma manca che la window item sia visibile anche quando non è interagibile :/ Edit: Risolto,bastava mettere true alla prima window Grazie^^
-
Allora aspetto Mastersion
-
Allora,ora ti posto le 3 classi cosi vedi tu: Scene_Menu #==============================================================================# ** Scene_Menu#------------------------------------------------------------------------------# This class performs menu screen processing.#==============================================================================class Scene_Menu #-------------------------------------------------------------------------- # * Object Initialization # menu_index : command cursor's initial position #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make command window s1 = "Usa Oggetti" s2 = "Save" s3 = "End Game" @command_window = Window_Command.new(160, [s1, s2, s3,]) @command_window.x = 500 @command_window.y = 100 @command_window.opacity = 0 @command_window.index = @menu_index # If number of party members is 0 if $game_party.actors.size == 0 # Disable items, skills, equipment, and status @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # If save is forbidden if $game_system.save_disabled # Disable save @command_window.disable_item(4) end # Make play time window @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 400 @playtime_window.opacity = 0 # Make steps window # Make gold window @gold_window = Window_Gold.new @gold_window.x = 400 @gold_window.y = 416 @gold_window.opacity = 0 @items_window = Window_ItemS.new @items_window.opacity = 0 # Make status window @menu = Sprite.new @menu.bitmap = Bitmap.new("Graphics/Pictures/Menù") # 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 # Prepare for transition Graphics.freeze # Dispose of windows @command_window.dispose @playtime_window.dispose @gold_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @command_window.update @playtime_window.update @gold_window.update # If command window is active: call update_command if @command_window.active update_command return end # If status window is active: call update_status if @status_window.active update_status return end end #-------------------------------------------------------------------------- # * Frame Update (when command window is active) #-------------------------------------------------------------------------- def update_command # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to map screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # If command other than save or end game, and party members = 0 if $game_party.actors.size == 0 and @command_window.index < 4 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Branch by command window cursor position case @command_window.index when 0 # item # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to item screen $scene = Scene_ItemS.new when 1 # save # If saving is forbidden if $game_system.save_disabled # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to save screen $scene = Scene_Save.new when 2 # end game # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to end game screen $scene = Scene_End.new end return end end end Scene_ItemS #==============================================================================# ** Scene_Item#------------------------------------------------------------------------------# This class performs item screen processing.#============================================================================== class Scene_ItemS #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make help window, item window @help_window = Window_Help.new @item_window = Window_Item.new # Associate help window @item_window.help_window = @help_window # Make target window (set to invisible / inactive) @target_window = Window_Target.new @target_window.visible = false @target_window.active = false @item_window.opacity = 0 @help_window.y = 420 @help_window.opacity = 0 @menu = Sprite.new @menu.bitmap = Bitmap.new("Graphics/Pictures/Menù") # 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 # Prepare for transition Graphics.freeze # Dispose of windows @help_window.dispose @item_window.dispose @target_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @help_window.update @item_window.update @target_window.update # If item window is active: call update_item if @item_window.active update_item return end # If target window is active: call update_target if @target_window.active update_target return end end #-------------------------------------------------------------------------- # * Frame Update (when item window is active) #-------------------------------------------------------------------------- def update_item # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to menu screen $scene = Scene_Menu.new(0) return end # If C button was pressed if Input.trigger?(Input::C) # Get currently selected data on the item window @item = @item_window.item # If not a use item unless @item.is_a?(RPG::Item) # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # If it can't be used unless $game_party.item_can_use?(@item.id) # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # If effect scope is an ally if @item.scope >= 3 # Activate target window @item_window.active = false @target_window.x = (@item_window.index + 1) % 2 * 304 @target_window.visible = true @target_window.active = true # Set cursor position to effect scope (single / all) if @item.scope == 4 || @item.scope == 6 @target_window.index = -1 else @target_window.index = 0 end # If effect scope is other than an ally else # If command event ID is valid if @item.common_event_id > 0 # Command event call reservation $game_temp.common_event_id = @item.common_event_id # Play item use SE $game_system.se_play(@item.menu_se) # If consumable if @item.consumable # Decrease used items by 1 $game_party.lose_item(@item.id, 1) # Draw item window item @item_window.draw_item(@item_window.index) end # Switch to map screen $scene = Scene_Map.new return end end return end end #-------------------------------------------------------------------------- # * Frame Update (when target window is active) #-------------------------------------------------------------------------- def update_target # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # If unable to use because items ran out unless $game_party.item_can_use?(@item.id) # Remake item window contents @item_window.refresh end # Erase target window @item_window.active = true @target_window.visible = false @target_window.active = false return end # If C button was pressed if Input.trigger?(Input::C) # If items are used up if $game_party.item_number(@item.id) == 0 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # If target is all if @target_window.index == -1 # Apply item effects to entire party used = false for i in $game_party.actors used |= i.item_effect(@item) end end # If single target if @target_window.index >= 0 # Apply item use effects to target actor target = $game_party.actors[@target_window.index] used = target.item_effect(@item) end # If an item was used if used # Play item use SE $game_system.se_play(@item.menu_se) # If consumable if @item.consumable # Decrease used items by 1 $game_party.lose_item(@item.id, 1) # Redraw item window item @item_window.draw_item(@item_window.index) end # Remake target window contents @target_window.refresh # If all party members are dead if $game_party.all_dead? # Switch to game over screen $scene = Scene_Gameover.new return end # If common event ID is valid if @item.common_event_id > 0 # Common event call reservation $game_temp.common_event_id = @item.common_event_id # Switch to map screen $scene = Scene_Map.new return end end # If item wasn't used unless used # Play buzzer SE $game_system.se_play($data_system.buzzer_se) end return end endend Window ItemS: #=========================================================================== class Window_ItemS < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 480, 16) @column_max = 3 refresh self.y = 74 self.height = 340 self.back_opacity = 255 end end #-------------------------------------------------------------------------- # * Get Item #-------------------------------------------------------------------------- def item return @data[self.index] end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_items.size if $game_party.item_number(i) > 0 @data.push($data_items[i]) end end @item_max = @data.size if @item_max > 0 for i in 0...@item_max draw_item(i) end end end #-------------------------------------------------------------------------- # * Draw Item # index : item number #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % 2 * (288 + 32) y = index / 2 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 240, y, 16, 32, ":", 1) self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2) end #-------------------------------------------------------------------------- # * Help Text Update #-------------------------------------------------------------------------- def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end Il problema me lo da quando deve visualizzare l'icona dell'oggetto nello scene menu. Non fare caso hai commenti perchè ho editato quelli standard
-
Si ma questo lo avevo fattoASD Se leggi sopra il mio problema è che quando l'eroe ha degli oggetti mi da l'errore nelle righe sopracitate
-
Allora la finestra oggetti si deve già vedere nella scene,poi quando premi su oggetti i bottoni salva etc scompaiono e si può interagire con gli oggetti
-
Salve a tutti,dunque stavo cercando di creare un menù impostato in questo modo: Nell'index del menù ci sono le opzioni esci salva ed oggetti,sotto c'è la window play time e la window gold,a sinistra si dovrebbero visualizzare gli oggetti in possesso,qui se ne ho uno il maker mi segnala l'errore nella window item,precisamente qui : def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_items.size if $game_party.item_number(i) > 0 @data.push($data_items[i]) end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end Credo riguardo la visione del bitmap,ma non capisco perchè faccia cosi. Inoltre per usare gli oggetti ho messo che clikkando sul comando si interagisca come di solito nella casella item,questo funge tranquillamente però..Quindi non trovo l'errore
-
Eccomi qui,Nonostante sia arrivato ultimo poco mi importa,io credo che prima della classifica bisogna leggere i commenti e capire i propri errori ma sopratutto seguire i consigli dalle persone con + esperienza...Certo mi spiace leggere il mio nome in fondo,però ai prossimi contest seguendo consigli etc. Cercherò di risalire ad un posto gradevole ^^ Grazie per i commenti
