Quedada del ChatBox
Conectarse

Recuperar mi contraseña

Estadísticas
Tenemos 2162 miembros registrados.
El último usuario registrado es chichox.

Nuestros miembros han publicado un total de 37850 mensajes en 4923 argumentos.
Últimos temas
» No tienes photoshop? - PIXLR
por Leaser Hoy a las 6:11 pm

» Relato de Seytan
por mrhawi Hoy a las 5:46 pm

» Pequeño tilemap de Pokemon
por Wecoc Hoy a las 5:39 pm

» Vehiculos por agua
por orochii Hoy a las 5:30 pm

» Denme su opinión sobre este sprite
por mrhawi Hoy a las 5:13 pm

» Saludos gente
por orochii Hoy a las 4:43 pm

» CONCURSO DE TROFEOS (Nº2)
por EdénTheGame Hoy a las 4:40 pm

» script Titulo animado -Modificacion-
por Felipe_9595 Hoy a las 4:27 pm

» Galeria de Dibujos
por Wecoc Hoy a las 3:32 pm

» D.R.E.A.M.S [RPGXP] [DEMO 2.0!]
por ZeroTwilight Hoy a las 3:05 pm

Afiliados
Temas importantes
----------------------------------------
Páginas con recursos RPG Maker
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
Topic de screens
----------------------------------------
Navega con Firefox
[DESCARGA]

Ayuda con código en un script para XP [RESUELTO]

 :: RPG Maker :: Scripts

Ver el tema anterior Ver el tema siguiente Ir abajo

RPG Maker XP Ayuda con código en un script para XP [RESUELTO]

Mensaje por Dweller el Vie Dic 03, 2010 12:26 am

Estoy desarrollando un rpg con Blizzard ABS y quiero incluir una ventana estilo "chat" típica de los mmorpgs donde se va dando información de misiones, daño, criticos, etc...

Esta funcionando ya bastante bien pero me he topado con un problema que seguro es de fácil solución para cualquier scripter medio, pero que yo no logro resolver.

Quiero poner de fondo de esa ventana una imagen. Lo hago sin problemas aunque lo hace dentro de un margen dentro de la misma. Tocando los parámetro de super ()
Código:
def initialize
    super(-16, -16, 250, 110)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end


He conseguido alinearlo a la izquierda obviando el margen izquierdo, pero el margen superior no consigo evitarlo.

En esta imagen es como me queda la imagen sobre la ventana:
Spoiler:


Y quiero que quede como esta imagen:
Spoiler:


Espero que alguien pueda ayudarme.

El script que uso para la ventana de "chat" es:
Spoiler:
Código:
#==============================================================================#
#                  Message panel by Dweller based on
#                    Game Guy's Coordinate Displayer                          #
#==============================================================================#
=begin
This will show a window on the map displaying X and Y coordinates.

Customization
module
  Location = "Upper Right Corner" "Lower Left Corner" "Upper Left Corner" or "Lower Right Corner"
  Transparent = "Non Transparent" "Semi-Transparent" "Transparent"
  UsePicture = true or false if set to true and transparent = "Non Transparent" it will automatically set it to "Transparent"
  PictureName = "picture name here" must be in quotes
end
=end
LOCATION  = ""
TRANSPARENT = "Semi-Transparent"
USEPICTURE = false  #NOT WORKING YET SO GO AHEAD AND SET IT TO TRUE BUT STILL WONT WORK
PICTURENAME = "picture name here"
class Window_Coordinate < Window_Base
 
  def initialize
    super(-16, -16, 250, 110)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  def refresh
   
    self.contents.clear
    @bitmap = RPG::Cache.battler("chatShape.png", 0)
    self.contents.blt(0, 0, @bitmap, Rect.new(0, 0, 250, 107), 220)
    self.contents.font.color = normal_color
    self.contents.font.size = 16
    self.contents.draw_text(4+16, 0, 200, 32, "> " + $text1.to_s)
    self.contents.font.color = Color.new(225, 215, 255)
    self.contents.draw_text(4+16, 18, 200, 32, "> " + $text2.to_s)
    self.contents.draw_text(4+16, 36, 200, 32, "> " + $text3.to_s)
    self.contents.draw_text(4+16, 54, 200, 32, "> " + $text4.to_s)
 
  end
 
  def update
    super
    #$playerx = $game_player.x * 32
    #$playery = $game_player.y * 32
    refresh
  end
 
end

class Scene_Map

  alias add_coordinate_window_later main
  def main
    if $DEBUG
      @coordinate = Window_Coordinate.new
      if LOCATION == "Upper Right Corner"
        @coordinate.x = 480
      elsif LOCATION == "Upper Left Corner"
        @coordinate.x = 0
      elsif LOCATION == "Lower Right Corner"
        @coordinate.x = 480
        @coordinate.y = 374
      else
        @coordinate.y = 374
      end
      if USEPICTURE == true
        if TRANSPARENT == "Non Transparent"
          @coordinate.opacity = 0
          @coordinate.back_opacity = 0
        end
      end
      if TRANSPARENT == "Transparent"
        @coordinate.opacity = 0
        @coordinate.back_opacity = 0
      elsif TRANSPARENT == "Semi-Transparent"
        @coordinate.opacity = 155
        @coordinate.back_opacity = 155
      else
        @coordinate.opacity = 255
        @coordinate.back_opacity = 255
      end
    end
    @spriteset = Spriteset_Map.new
    @message_window = Window_Message.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @coordinate.dispose
    @message_window.dispose
    if $scene.is_a?(Scene_Title)
      Graphics.transition
      Graphics.freeze
    end
    Graphics.freeze
  end

  alias update_coordinate_window_later update
  def update
    if $DEBUG
      if @coordinate.active
        update_coordinate
      end
    end
    update_coordinate_window_later
  end
 
  def update_coordinate
    if $DEBUG
      if Input.trigger?(Input::A)
        if @coordinate.visible
          @coordinate.visible = false
        else
          @coordinate.visible = true
        end
      end
      @coordinate.update if @coordinate.visible && @coordinate.active
    end
  end
end



Última edición por Dweller el Vie Dic 03, 2010 7:05 am, editado 1 vez

Dweller
Novato
Novato

0/3

Créditos 82


http://subirdenivel.blogspot.com/

Volver arriba Ir abajo

RPG Maker XP Re: Ayuda con código en un script para XP [RESUELTO]

Mensaje por orochii el Vie Dic 03, 2010 1:19 am

Listo :), el script no me gusta porque no me gusta cómo lo hicieron (algunas cosas que habría hecho yo de otra forma que de seguro no habrían funcionado jajajaja y me hubiera hartado al final D:!). Pero bueno, esos son mis gustos ¿y qué? ¿algún problema :DDD? jaja, bueno, dejo de lado mis tonterías...
Acá el script. Ya lo alineé a la esquina, y bueno le puse una propiedad al comienzo del script llamada TEXT_OFFSET para que ajustes el... offset xD del texto a tu gusto (la altura, osea para que lo pongas más alto o más bajo lalalaa).

Como diría un makero conocido xD, sin más dilaciones, el script.
Código:

#==============================================================================#
#                  Message panel by Dweller based on
#                    Game Guy's Coordinate Displayer                          #
#==============================================================================#
=begin
This will show a window on the map displaying X and Y coordinates.

Customization
module
  Location = "Upper Right Corner" "Lower Left Corner" "Upper Left Corner" or "Lower Right Corner"
  Transparent = "Non Transparent" "Semi-Transparent" "Transparent"
  UsePicture = true or false if set to true and transparent = "Non Transparent" it will automatically set it to "Transparent"
  PictureName = "picture name here" must be in quotes
end
=end
LOCATION  = ""
TRANSPARENT = "Transparent"
USEPICTURE = true  #NOT WORKING YET SO GO AHEAD AND SET IT TO TRUE BUT STILL WONT WORK
PICTURENAME = "sintitulo2fg"
TEXT_OFFSET = 16 #Añadido por mí para acomodar el texto según tus necesidades.
class Window_Coordinate < Window_Base
 
  def initialize
    super(-16, -32, 250+32, 110+32)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  def refresh
   
    self.contents.clear
    @bitmap = RPG::Cache.battler("chatShape.png", 0)
    self.contents.blt(0, 0, @bitmap, Rect.new(0, 0, 250, 107), 220)
    self.contents.font.color = normal_color
    self.contents.font.size = 16
    self.contents.draw_text(4+16, 0+TEXT_OFFSET, 200, 32, "> " + $text1.to_s)
    self.contents.font.color = Color.new(225, 215, 255)
    self.contents.draw_text(4+16, 18+TEXT_OFFSET, 200, 32, "> " + $text2.to_s)
    self.contents.draw_text(4+16, 36+TEXT_OFFSET, 200, 32, "> " + $text3.to_s)
    self.contents.draw_text(4+16, 54+TEXT_OFFSET, 200, 32, "> " + $text4.to_s)
 
  end
 
  def update
    super
    #$playerx = $game_player.x * 32
    #$playery = $game_player.y * 32
    refresh
  end
 
end

class Scene_Map

  alias add_coordinate_window_later main
  def main
    if $DEBUG
      @coordinate = Window_Coordinate.new
      if LOCATION == "Upper Right Corner"
        @coordinate.x = 480
      elsif LOCATION == "Upper Left Corner"
        @coordinate.x = 0
      elsif LOCATION == "Lower Right Corner"
        @coordinate.x = 480
        @coordinate.y = 374
      else
        @coordinate.y = 374
      end
      @coordinate.y -=11
      if USEPICTURE == true
        if TRANSPARENT == "Non Transparent"
          @coordinate.opacity = 0
          @coordinate.back_opacity = 0
        end
      end
      if TRANSPARENT == "Transparent"
        @coordinate.opacity = 0
        @coordinate.back_opacity = 0
      elsif TRANSPARENT == "Semi-Transparent"
        @coordinate.opacity = 155
        @coordinate.back_opacity = 155
      else
        @coordinate.opacity = 255
        @coordinate.back_opacity = 255
      end
    end
    @spriteset = Spriteset_Map.new
    @message_window = Window_Message.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @coordinate.dispose
    @message_window.dispose
    if $scene.is_a?(Scene_Title)
      Graphics.transition
      Graphics.freeze
    end
    Graphics.freeze
  end

  alias update_coordinate_window_later update
  def update
    if $DEBUG
      if @coordinate.active
        update_coordinate
      end
    end
    update_coordinate_window_later
  end
 
  def update_coordinate
    if $DEBUG
      if Input.trigger?(Input::A)
        if @coordinate.visible
          @coordinate.visible = false
        else
          @coordinate.visible = true
        end
      end
      @coordinate.update if @coordinate.visible && @coordinate.active
    end
  end
end


Yo ni sé qué significa exactamente dilaciones, pero bueno para eso existe el Rae.es, suerte,
Orochii Zouveleki

Edit: >:D


Última edición por orochii el Vie Dic 03, 2010 2:40 am, editado 1 vez (Razón : >:D)

orochii
Aventurero
Aventurero

0/3

Créditos 2766


http://orochii.xtreemhost.cc/

Volver arriba Ir abajo

RPG Maker XP Re: Ayuda con código en un script para XP [RESUELTO]

Mensaje por Metalero el Vie Dic 03, 2010 1:53 am

Ahi la imagen se ve, aunque queda bastante feo con la image que subiste, por que es mas chica que la ventana, y es opaca (un recorte de un screen shot retocado tal vez)

Y otra cosa... ni idea como usaras ese "chat" ya que viendo el script no es un script de chat, si no una mini consola para debuggear scripts (solo funciona en modo debug XD)

bueno aca el codigo (pones al principio en nombre del arcivo, que debe estar dentro den Picrtures)

Spoiler:

Código:

#==============================================================================#
#                  Message panel by Dweller based on
#                    Game Guy's Coordinate Displayer                          #
#==============================================================================#
=begin
This will show a window on the map displaying X and Y coordinates.

Customization
module
  Location = "Upper Right Corner" "Lower Left Corner" "Upper Left Corner" or "Lower Right Corner"
  Transparent = "Non Transparent" "Semi-Transparent" "Transparent"
  UsePicture = true or false if set to true and transparent = "Non Transparent" it will automatically set it to "Transparent"
  PictureName = "picture name here" must be in quotes
end
=end
LOCATION  = ""
TRANSPARENT = "Semi-Transparent"
USEPICTURE = true  #NOT WORKING YET SO GO AHEAD AND SET IT TO TRUE BUT STILL WONT WORK
PICTURENAME = "Shape"
class Window_Coordinate < Window_Base
 
  def initialize
    super(0, 0, 250, 110)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  def refresh
   
    self.contents.clear
 
    self.contents.font.color = normal_color
    self.contents.font.size = 16
    self.contents.draw_text(4+16, 0, 200, 32, "> " + $text1.to_s)
    self.contents.font.color = Color.new(225, 215, 255)
    self.contents.draw_text(4+16, 18, 200, 32, "> " + $text2.to_s)
    self.contents.draw_text(4+16, 36, 200, 32, "> " + $text3.to_s)
    self.contents.draw_text(4+16, 54, 200, 32, "> " + $text4.to_s)
 
  end
 
  def update
   
    super
    #$playerx = $game_player.x * 32
    #$playery = $game_player.y * 32
    refresh
  end
 
end

class Scene_Map

  alias add_coordinate_window_later main
  def main
    if $DEBUG
      @coordinate = Window_Coordinate.new
      if LOCATION == "Upper Right Corner"
        @coordinate.x = 480
      elsif LOCATION == "Upper Left Corner"
        @coordinate.x = 0
      elsif LOCATION == "Lower Right Corner"
        @coordinate.x = 480
        @coordinate.y = 374
      else
        @coordinate.y = 374
      end
      if USEPICTURE == true
        if TRANSPARENT == "Non Transparent"
          @coordinate.opacity = 0
          @coordinate.back_opacity = 0
        end
      end
      if TRANSPARENT == "Transparent"
        @coordinate.opacity = 0
        @coordinate.back_opacity = 0
      elsif TRANSPARENT == "Semi-Transparent"
        @coordinate.opacity = 155
        @coordinate.back_opacity = 155
      else
        @coordinate.opacity = 255
        @coordinate.back_opacity = 255
      end
    end

    if USEPICTURE
      @chatSprite = Sprite.new
      @chatSprite.bitmap = RPG::Cache.picture(PICTURENAME)
      @chatSprite.x = @coordinate.x
      @chatSprite.y = @coordinate.y
     
      @chatSprite.z = @coordinate.z + 1
    end
   
    @spriteset = Spriteset_Map.new
    @message_window = Window_Message.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @coordinate.dispose
    @message_window.dispose
    if USEPICTURE
      @chatSprite.dispose
    end
    if $scene.is_a?(Scene_Title)
      Graphics.transition
      Graphics.freeze
    end
    Graphics.freeze
  end

  alias update_coordinate_window_later update
  def update
    if $DEBUG
      if @coordinate.active
        update_coordinate
      end
    end
    update_coordinate_window_later
   
  end
 
  def update_coordinate
   
    if $DEBUG
      if Input.trigger?(Input::A)
        @coordinate.visible = !@coordinate.visible
        if USEPICTURE
          @chatSprite.visible =  @coordinate.visible
        end
      end
      @coordinate.update if @coordinate.visible && @coordinate.active
    end
  end
end



PD: orochii, me ganaste de mano ¬¬ XD

_________________

Metalero
Administrador
Administrador



Créditos 964


http://www.asedio-metal.com.ar

Volver arriba Ir abajo

RPG Maker XP Re: Ayuda con código en un script para XP [RESUELTO]

Mensaje por Dweller el Vie Dic 03, 2010 6:59 am

Vaya, que rapidez y eficiencia, 2 edits del scripts que funcionan perfectamente, muchas gracias .
Buscaba más bien un poco de guía para hacerlo yo mismo, no queria molestaros hasta el punto de editarmelo, pero muchas gracias a ambos. Al final voy a intentar añadir al edit de orochii la idea de Metalero para poder cambiar la imagen de fondo a lo largo del juego (no se me habia ocurrido).

Dije lo de "chat" para describir el tipo de ventana que quería, en realidad su uso será el de dar información al jugador sobre ciertas cosas que pasan en el juego como: "... 3/12 orcos muertos...", "... nuevo record de golpe critico: 323!!!", "has descubierto un nuevo tipo de monstruo: Burning slime", etc... La imagen que uso es solo para el test y sí, era un recorte de un screenshot.

Lo dicho muchas gracias por vuestro tiempo.

Dweller
Novato
Novato

0/3

Créditos 82


http://subirdenivel.blogspot.com/

Volver arriba Ir abajo

RPG Maker XP Re: Ayuda con código en un script para XP [RESUELTO]

Mensaje por Metalero el Vie Dic 03, 2010 3:43 pm

en ese caso seberias quitar todos los "if $debug" y sus "end" por que asi como esta, solo te va a andar en modo debug (ejecutandolo desde el maker)

_________________

Metalero
Administrador
Administrador



Créditos 964


http://www.asedio-metal.com.ar

Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba


 :: RPG Maker :: Scripts

Permiso de este foro:
No puedes responder a temas en este foro.