Dunque ho due problemi, il primo penso sia semplice, il secondo di meno.
1 - In primo luogo c'è un comando in RGSS che mi permette di cambiare windowskin oppure di non mostrarla (HIDE?) Perchè quando mi fa visualizzare la mappa sopra appare, dove c'è il nome della mappa, una finestra di messaggio e si vede la windowskin! Ovviamente devo mettere un comando all'inizio per mostrarmi un system e uno alla fine per mostrarmene un'altro oppure mettere un comando all'inizio per nascondermi il system e uno alla fine per rimostrarmelo.. @.@
2 - Veniamo al problema più complicato.. in pratica ho lo script per mostrare la mappa, bene, me la mostra perfettamente solo che non se ne va via l'immagine! Si accorge di sta cosa solo quando uso l'opzione "Ritorna ai Titoli" nel caso uno volesse ricaricare la partita che se ne va il menu e si vede la mappa dietro come sfondo! E' fastidiosa come cosa, in pratica e come se mi mostrasse l'immagine dietro a tutto ma non me la fa cancellare! Io ora, non sono un genio nel ruby, ma sto cercando di impararlo ma per questa cosa non riesco a risolverla..
Vi posto lo script di Daniel_Maximus2 se magari qualcuno vuole fare entrambe le aggiunte (o la seconda direttamente lì)
#===============================================================================
#-------------------------------------------------------------------------------
# - Map Item Script
#-------------------------------------------------------------------------------
#===============================================================================
#
# - Shows a map and compass in the screen
# - Made by - Daniel_Maximus2
# Cardinalis Corp ®
# - Script free for personal use since included the name and the team
# of the creator
# - Compatibility with many Scripts. See instructions for more information
#
# - Put the pictures in the folder Graphics/Pictures/Mapa (create the folder Mapa)
# - A map of 640x380
# - A compass of 60x60 (different sizes changes lines 81 and 82)
# - A picture of 640x3 (linha y)
# - A picture of 3x380 (linha x)
# - Created in 12-14-06
#
# classes: Window_Mapa
# Window_Text
# Scene_Mapa
#
#-------------------------------------------------------------------------------
#===============================================================================
COMPASS = 33 #id of Compass
MAP = 27 #id of Map
VAR_MAP_X = 2 #$game_variable[id] that stores X cordinate
VAR_MAP_Y= 3 #$game_variable[id] that stores Y cordinate
# If you do not define a cordinate for center of the world, delete lines 142
# to 172 and activate lines 173 e 174.
#===============================================================================
#-------------------------------------------------------------------------------
# - Window_Mapa
#-------------------------------------------------------------------------------
#===============================================================================
class Window_Mapa < Window_Base
def initialize
super(0, 65, 640, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.opacity = 0
refresh
end
def refresh
# variables that stores cordinates (Events/Paralell Process)
@wx = $game_variables[VAR_MAP_X]
@wy = $game_variables[VAR_MAP_Y]
@f_linex = @wx #cord x
@f_liney = @wy #cord y
# Draw the map ========================================================
@map = Sprite.new
@map.bitmap = RPG::Cache.picture("Mapa/worldmap.jpg")#Name of map file
@map.x = 0
@map.y = 0
# Draw the map ========================================================
# Draw the compass, if have ========================================
if $game_party.item_number(COMPASS) > 0
@i_linex = Sprite.new
@i_linex.bitmap = RPG::Cache.picture("Mapa/compasso_x.png")#Name of line x file
@i_linex.x = @map.x
@i_linex.y = @map.y
@i_liney = Sprite.new
@i_liney.bitmap = RPG::Cache.picture("Mapa/compasso_y.png")#Name of line y file
@i_liney.x = @map.x
@i_liney.y = @map.y
@compass = Sprite.new
@compass.bitmap = RPG::Cache.picture("Mapa/compasso.png")#Name of compass file
@cwid = 30 #half of compass width
@chei = 30 #half of compass height
@compass.x = @map.x - @cwid
@compass.y = @map.y - @chei
end
end
# Fim ======================================================================
def move_compass
correctx = @f_linex - @i_linex.x
correcty = @f_liney - @i_liney.y
correctcompx = @wx - @cwid - @compass.x
correctcompy = @wy - @chei - @compass.y
#====================
if @i_linex.x < (@f_linex - 10)
@i_linex.x += 10
end
if @i_linex.x >= (@f_linex - 10)
@i_linex.x += correctx
end
#====================
if @i_liney.y < (@f_liney - 10)
@i_liney.y += 10
end
if @i_liney.y >= (@f_liney - 10)
@i_liney.y += correcty
end
#====================
if @compass.x < (@wx - 10 - @cwid)
@compass.x += 10
end
if @compass.x >= (@wx - 10 - @cwid)
@compass.x += correctcompx
end
#====================
if @compass.y < (@wy - 10 - @chei)
@compass.y += 10
end
if @compass.y >= (@wy - 10 - @chei)
@compass.y += correctcompy
end
#====================
end
end
#===============================================================================
#-------------------------------------------------------------------------------
# - Mapa_Text - Write the location
#-------------------------------------------------------------------------------
#===============================================================================
class Game_Map
def name
$map_infos[@map_id]
end
end
class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
class Mapa_Text < Window_Base
def initialize
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 200#
refresh
end
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = $fontsize
if $game_party.item_number(COMPASS) > 0
text = "Posizione attuale: #{$game_map.name}" #{centerdist} km de (Name of world center place or city)." Put the name of center place
else
text = "Posizione attuale: #{$game_map.name}"
end
self.contents.draw_text(4, 0, self.width - 40, 32, text)
# delete till here and activate below (delete "#")
# text = "Your location: #{$game_map.name}."
# self.contents.draw_text(4, 0, self.width - 40, 32, text)
end
end
#===============================================================================
#-------------------------------------------------------------------------------
# - Scene_Mapa
#-------------------------------------------------------------------------------
#===============================================================================
class Scene_Mapa
def main
@help_window = Mapa_Text.new
@mapa_window = Window_Mapa.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $game_party.item_number(COMPASS) > 0
@mapa_window.move_compass
end
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@mapa_window.dispose
end
#-------------------------------------------------------------------------------
# - Update
#-------------------------------------------------------------------------------
def update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(0)
@map = Sprite.new
@map.bitmap = RPG::Cache.picture("Mapa/worldmapvuota.png")#Name of map file
@map.x = 0
@map.y = 0
return
end
end
end
Question
Thund
Ciao a tutti!
Dunque ho due problemi, il primo penso sia semplice, il secondo di meno.
1 - In primo luogo c'è un comando in RGSS che mi permette di cambiare windowskin oppure di non mostrarla (HIDE?) Perchè quando mi fa visualizzare la mappa sopra appare, dove c'è il nome della mappa, una finestra di messaggio e si vede la windowskin! Ovviamente devo mettere un comando all'inizio per mostrarmi un system e uno alla fine per mostrarmene un'altro oppure mettere un comando all'inizio per nascondermi il system e uno alla fine per rimostrarmelo.. @.@
2 - Veniamo al problema più complicato.. in pratica ho lo script per mostrare la mappa, bene, me la mostra perfettamente solo che non se ne va via l'immagine! Si accorge di sta cosa solo quando uso l'opzione "Ritorna ai Titoli" nel caso uno volesse ricaricare la partita che se ne va il menu e si vede la mappa dietro come sfondo! E' fastidiosa come cosa, in pratica e come se mi mostrasse l'immagine dietro a tutto ma non me la fa cancellare! Io ora, non sono un genio nel ruby, ma sto cercando di impararlo ma per questa cosa non riesco a risolverla..
Vi posto lo script di Daniel_Maximus2 se magari qualcuno vuole fare entrambe le aggiunte (o la seconda direttamente lì)
#=============================================================================== #------------------------------------------------------------------------------- # - Map Item Script #------------------------------------------------------------------------------- #=============================================================================== # # - Shows a map and compass in the screen # - Made by - Daniel_Maximus2 # Cardinalis Corp ® # - Script free for personal use since included the name and the team # of the creator # - Compatibility with many Scripts. See instructions for more information # # - Put the pictures in the folder Graphics/Pictures/Mapa (create the folder Mapa) # - A map of 640x380 # - A compass of 60x60 (different sizes changes lines 81 and 82) # - A picture of 640x3 (linha y) # - A picture of 3x380 (linha x) # - Created in 12-14-06 # # classes: Window_Mapa # Window_Text # Scene_Mapa # #------------------------------------------------------------------------------- #=============================================================================== COMPASS = 33 #id of Compass MAP = 27 #id of Map VAR_MAP_X = 2 #$game_variable[id] that stores X cordinate VAR_MAP_Y= 3 #$game_variable[id] that stores Y cordinate # If you do not define a cordinate for center of the world, delete lines 142 # to 172 and activate lines 173 e 174. #=============================================================================== #------------------------------------------------------------------------------- # - Window_Mapa #------------------------------------------------------------------------------- #=============================================================================== class Window_Mapa < Window_Base def initialize super(0, 65, 640, 416) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.opacity = 0 refresh end def refresh # variables that stores cordinates (Events/Paralell Process) @wx = $game_variables[VAR_MAP_X] @wy = $game_variables[VAR_MAP_Y] @f_linex = @wx #cord x @f_liney = @wy #cord y # Draw the map ======================================================== @map = Sprite.new @map.bitmap = RPG::Cache.picture("Mapa/worldmap.jpg")#Name of map file @map.x = 0 @map.y = 0 # Draw the map ======================================================== # Draw the compass, if have ======================================== if $game_party.item_number(COMPASS) > 0 @i_linex = Sprite.new @i_linex.bitmap = RPG::Cache.picture("Mapa/compasso_x.png")#Name of line x file @i_linex.x = @map.x @i_linex.y = @map.y @i_liney = Sprite.new @i_liney.bitmap = RPG::Cache.picture("Mapa/compasso_y.png")#Name of line y file @i_liney.x = @map.x @i_liney.y = @map.y @compass = Sprite.new @compass.bitmap = RPG::Cache.picture("Mapa/compasso.png")#Name of compass file @cwid = 30 #half of compass width @chei = 30 #half of compass height @compass.x = @map.x - @cwid @compass.y = @map.y - @chei end end # Fim ====================================================================== def move_compass correctx = @f_linex - @i_linex.x correcty = @f_liney - @i_liney.y correctcompx = @wx - @cwid - @compass.x correctcompy = @wy - @chei - @compass.y #==================== if @i_linex.x < (@f_linex - 10) @i_linex.x += 10 end if @i_linex.x >= (@f_linex - 10) @i_linex.x += correctx end #==================== if @i_liney.y < (@f_liney - 10) @i_liney.y += 10 end if @i_liney.y >= (@f_liney - 10) @i_liney.y += correcty end #==================== if @compass.x < (@wx - 10 - @cwid) @compass.x += 10 end if @compass.x >= (@wx - 10 - @cwid) @compass.x += correctcompx end #==================== if @compass.y < (@wy - 10 - @chei) @compass.y += 10 end if @compass.y >= (@wy - 10 - @chei) @compass.y += correctcompy end #==================== end end #=============================================================================== #------------------------------------------------------------------------------- # - Mapa_Text - Write the location #------------------------------------------------------------------------------- #=============================================================================== class Game_Map def name $map_infos[@map_id] end end class Scene_Title $map_infos = load_data("Data/MapInfos.rxdata") for key in $map_infos.keys $map_infos[key] = $map_infos[key].name end end class Mapa_Text < Window_Base def initialize super(0, 0, 640, 64) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 200# refresh end def refresh self.contents.clear self.contents.font.color = normal_color self.contents.font.size = $fontsize if $game_party.item_number(COMPASS) > 0 text = "Posizione attuale: #{$game_map.name}" #{centerdist} km de (Name of world center place or city)." Put the name of center place else text = "Posizione attuale: #{$game_map.name}" end self.contents.draw_text(4, 0, self.width - 40, 32, text) # delete till here and activate below (delete "#") # text = "Your location: #{$game_map.name}." # self.contents.draw_text(4, 0, self.width - 40, 32, text) end end #=============================================================================== #------------------------------------------------------------------------------- # - Scene_Mapa #------------------------------------------------------------------------------- #=============================================================================== class Scene_Mapa def main @help_window = Mapa_Text.new @mapa_window = Window_Mapa.new Graphics.transition loop do Graphics.update Input.update update if $game_party.item_number(COMPASS) > 0 @mapa_window.move_compass end if $scene != self break end end Graphics.freeze @help_window.dispose @mapa_window.dispose end #------------------------------------------------------------------------------- # - Update #------------------------------------------------------------------------------- def update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(0) @map = Sprite.new @map.bitmap = RPG::Cache.picture("Mapa/worldmapvuota.png")#Name of map file @map.x = 0 @map.y = 0 return end end end
Edited by ThundLink to comment
Share on other sites
3 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now