Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Debug Position
Autor Wiadomość
Melvin 




Preferowany:
RPG Maker XP

Ranga RM:
1 gra

Pomógł: 35 razy
Dołączył: 23 Paź 2009
Posty: 1063
Wysłany: Pią 20 Sty, 2012 01:35
Debug Position
~ Debug Position ~


Krótki opis:
Prosty skrypt, który pokazuję "X" i "Y" gracza na mapie i ekranie.
Konfiguracja według własnych potrzeb.

Autor:
Melvin

Kompatybilność:
RPG Maker XP

Skrypt:
Spoiler:

Kod:
#======================================================================
# Name: Debug Position
# Author: Melvin
# Verion: 1.0
#======================================================================
# KONFIGURACJA
#======================================================================
module Melvin
# Włączony:
  $DebugPosition = true # false
# Automatyczne odświerzanie:
  AutoRef = true # false
# Klawisz odświerzania: (jeśli wyłączone auto)
  InputRef = Input::L # Q
# Pozycja:
  Position = 3
# 1 - Prawy, górny róg
# 2 - Prawy, dolny róg
# 3 - Lewy górny róg
# 4 - Lewy, dolny róg
end
#======================================================================
class Scene_Map
  alias sm_mn_mel main
  def main
    @window_debug_position = Window_DebugPosition.new
    @window_debug_position.visible = $DebugPosition
    if Melvin::Position == 1
      @PosX = 480
      @PosY = 0
    elsif Melvin::Position == 2
      @PosX = 480
      @PosY = 320
    elsif Melvin::Position == 3
      @PosX = 0
      @PosY = 0
    elsif Melvin::Position == 4
      @PosX = 0
      @PosY = 320
    end
    @window_debug_position.x = @PosX
    @window_debug_position.y = @PosY
    sm_mn_mel
    @window_debug_position.dispose
  end
  alias sm_up_mel update
  def update
    if Melvin::Position == 1
      if $game_player.screen_x >= 464 and $game_player.screen_y <= 192
        @window_debug_position.opacity = 50
      else
        @window_debug_position.opacity = 150
      end
    elsif Melvin::Position == 2
      if $game_player.screen_x >= 464 and $game_player.screen_y >= 320
        @window_debug_position.opacity = 50
      else
        @window_debug_position.opacity = 150
      end
    elsif Melvin::Position == 3
      if $game_player.screen_x <= 176 and $game_player.screen_y <= 192
        @window_debug_position.opacity = 50
      else
        @window_debug_position.opacity = 150
      end
    elsif Melvin::Position == 4
      if $game_player.screen_x <= 176 and $game_player.screen_y >= 320
        @window_debug_position.opacity = 50
      else
        @window_debug_position.opacity = 150
      end
    end
    @window_debug_position.update
    if Melvin::AutoRef == true
      @window_debug_position.refresh
    else
      if Input.trigger?(Melvin::InputRef)
        @window_debug_position.refresh
      end
    end
    sm_up_mel
  end
end
class Window_DebugPosition < Window_Base
  def initialize
    super(0, 0, 160, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 150
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 200, 32, "Player X")
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, 200, 79, "Map: #{$game_player.x}")
    self.contents.draw_text(0, 0, 200, 111, "Screen: #{$game_player.screen_x}")
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 200, 153, "Player Y")
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, 200, 185, "Map: #{$game_player.y}")
    self.contents.draw_text(0, 0, 200, 217, "Screen: #{$game_player.screen_y}")
  end
end


Screeny:
Spoiler:



Dodatkowe informacje:
1. Wklej skrypt nad "Main" w Edytorze Skryptu.
2. Reszta instrukcji znajduje się w treści skryptu.
________________________
MelvinClass:
Spoiler:

 
 
SaNq 




Preferowany:
RPG Maker XP

Dołączył: 17 Sty 2012
Posty: 17
Skąd: Brzeg
Wysłany: Pią 20 Sty, 2012 11:08
Przyda sie :D
________________________
Czekamy tylko na ,,Akail - Forgotten Villige''

NOWA GRA KTÓRA ODMIENI RPG MAKERY

myślisz że rpg maker to prosta rzecz?? to tylko ci się tak zdaje nie patrz na komentarze 5min i gotowa gra.
 
 
The Big Master 




Preferowany:
RPG Maker XP

Pomógł: 6 razy
Dołączył: 19 Gru 2012
Posty: 81
Skąd: Masz taki nr. IQ ?
Wysłany: Sob 12 Sty, 2013 16:36
Uwaga w Polskim RM'ie wersja 1.00 nie widać napisów, pozwoliłem sobie dopisać 2 linijki aby było je widać, oto i skrypt na polaka 1.0:
Spoiler:


Kod:

#======================================================================
# Name: Debug Position
# Author: Melvin
# Poprawka: GuGuś
# Verion: 1.0
#======================================================================
# KONFIGURACJA
#======================================================================
module Melvin
# Włączony:
  $DebugPosition = true # false
# Automatyczne odświerzanie:
  AutoRef = true # false
# Klawisz odświerzania: (jeśli wyłączone auto)
  InputRef = Input::L # Q
# Pozycja:
  Position = 3
# 1 - Prawy, górny róg
# 2 - Prawy, dolny róg
# 3 - Lewy górny róg
# 4 - Lewy, dolny róg
end
#======================================================================
class Scene_Map
  alias sm_mn_mel main
  def main
    @window_debug_position = Window_DebugPosition.new
    @window_debug_position.visible = $DebugPosition
    if Melvin::Position == 1
      @PosX = 480
      @PosY = 0
    elsif Melvin::Position == 2
      @PosX = 480
      @PosY = 320
    elsif Melvin::Position == 3
      @PosX = 0
      @PosY = 0
    elsif Melvin::Position == 4
      @PosX = 0
      @PosY = 320
    end
    @window_debug_position.x = @PosX
    @window_debug_position.y = @PosY
    sm_mn_mel
    @window_debug_position.dispose
  end
  alias sm_up_mel update
  def update
    if Melvin::Position == 1
      if $game_player.screen_x >= 464 and $game_player.screen_y <= 192
        @window_debug_position.opacity = 50
      else
        @window_debug_position.opacity = 150
      end
    elsif Melvin::Position == 2
      if $game_player.screen_x >= 464 and $game_player.screen_y >= 320
        @window_debug_position.opacity = 50
      else
        @window_debug_position.opacity = 150
      end
    elsif Melvin::Position == 3
      if $game_player.screen_x <= 176 and $game_player.screen_y <= 192
        @window_debug_position.opacity = 50
      else
        @window_debug_position.opacity = 150
      end
    elsif Melvin::Position == 4
      if $game_player.screen_x <= 176 and $game_player.screen_y >= 320
        @window_debug_position.opacity = 50
      else
        @window_debug_position.opacity = 150
      end
    end
    @window_debug_position.update
    if Melvin::AutoRef == true
      @window_debug_position.refresh
    else
      if Input.trigger?(Melvin::InputRef)
        @window_debug_position.refresh
      end
    end
    sm_up_mel
  end
end
class Window_DebugPosition < Window_Base
  def initialize
    super(0, 0, 160, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    self.opacity = 150
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 200, 32, "Player X")
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, 200, 79, "Map: #{$game_player.x}")
    self.contents.draw_text(0, 0, 200, 111, "Screen: #{$game_player.screen_x}")
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 200, 153, "Player Y")
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, 200, 185, "Map: #{$game_player.y}")
    self.contents.draw_text(0, 0, 200, 217, "Screen: #{$game_player.screen_y}")
  end
end

________________________
Siema

Gość, Jeżeli ci Pomogłem, możesz mi dać .
_______________________________________________________________
Niestety, padł mi komp z Projektami, więc przez pewien czas niestety nici z Projektów :C
 
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene