Guest Access
Administrator
Administrator

Administrator
profile
DXYL it rhymes with PIXEL, say it with me...
Where's my RMXP makers @?
G@MeF@Ce
![]() | ![]() | |
![]() | ||
![]() | ![]() |

profile

DXYL it rhymes with PIXEL, say it with me...
DXYL!

D for facing direction, X and Y coordinates and L for locator (not location).
I've seen some map/locator/compass scripts out there, but I got the idea working with Mr_Wiggles on Code_Crash. When he was utilizing the HUD to read out coordinates to Debug, I thought how cool it would be to make a little bot with DXY and use that as a way of locating secrets later in the game that may have been missed early on.
So I started drinking some wine with Martha100 and got busy scripting code...
I think this script could come in handy for any RMXP game maker that wants the player to go on a late game easter egg hunt.
Features:
disable switch
two-button-input to toggle visibility
positioned at the bottom right corner (doesn't interfere with bottom textbox)

D for facing direction, X and Y coordinates and L for locator (not location).
I've seen some map/locator/compass scripts out there, but I got the idea working with Mr_Wiggles on Code_Crash. When he was utilizing the HUD to read out coordinates to Debug, I thought how cool it would be to make a little bot with DXY and use that as a way of locating secrets later in the game that may have been missed early on.
So I started drinking some wine with Martha100 and got busy scripting code...
I think this script could come in handy for any RMXP game maker that wants the player to go on a late game easter egg hunt.

Features:
disable switch
two-button-input to toggle visibility
positioned at the bottom right corner (doesn't interfere with bottom textbox)
- Code:
#===============================================================================
# RMXP - DXYL Locator v1.0 by G@MeF@Ce 2/11/21
#===============================================================================
=begin
A nifty little info box that displays facing direction amd x/y coordinates
useful for revealing secrets later in the game that were missed early on.
=end
#==============================================================================
# Settings
#==============================================================================
module G101_DXYL
#disable switch
DXYL_SWITCH = 8
#button config to toggle visibility
PRESS_HOLD = Input::L
TRIGGER_INFO = Input::R
#window loaction
WIN_X = 562
WIN_Y = 308
WIN_W = 76
WIN_H = 154
#X location
X_X = -18
X_Y = 34
#Y location
Y_X = -18
Y_Y = 70
#Direction Location
D_X = -10
D_Y = -20
#true = start visible, false = hidden
START_ON = false
#windowskin opacity
DXY_OPACITY = 160
end
#==============================================================================
# Window
#==============================================================================
class Window_Base < Window
include G101_DXYL
#--------------------------------------------------------------------------
# DXY_Locator x=horizontal y=vertical w=width h=height a=alignment
#--------------------------------------------------------------------------
def dxyl_locator(x, y, w, h, a)
@player_x = $game_player.x
@player_y = $game_player.y
thisx = @player_x.to_s
thisy = @player_y.to_s
self.contents.draw_text(X_X + 8, X_Y - 16, w, h, "X", 1)
self.contents.draw_text(X_X + 8, X_Y + 4, w, h, thisx, 1)
self.contents.draw_text(Y_X + 8, Y_Y - 6, w, h, "Y", 1)
self.contents.draw_text(Y_X + 8, Y_Y + 14, w, h, thisy, 1)
end
end #end class
#==============================================================================
# Scene_Map
#==============================================================================
class Scene_Map
include G101_DXYL
alias :other_main :main
def main
@dxyl_on.dispose unless @dxyl_on.nil?
@dxyl_on = Window_Location.new(WIN_X, WIN_Y, false)
other_main
@dxyl_on.dispose unless (@dxyl_on.disposed? || @dxyl_on.nil?)
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
alias :other_update :update
def update
@dxyl_on.update unless (@dxyl_on.disposed? || @dxyl_on.nil?)
other_update
end
end #end class
#==============================================================================
# ** Window_Location
#==============================================================================
class Window_Location < Window_Base
include G101_DXYL
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y, dir_check = true)
@dir_check = dir_check
super(x, y, WIN_W, WIN_H)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = DXY_OPACITY
self.visible = START_ON
update
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
def update
#toggle with button combo
if Input.press?(PRESS_HOLD) and Input.trigger?(TRIGGER_INFO)
self.visible = ! self.visible
end
if $game_switches[DXYL_SWITCH]
self.visible = false
end
self.contents.clear
if @dir_check == false
case $game_player.direction #working on color case
when 2; way = "S" #and Color.new(0,0,255),#blue
when 4; way = "W" #and Color.new(0,255,0),#green
when 6; way = "E" #and Color.new(255,255,0),#yellow
when 8; way = "N" #and Color.new(255,0,0),#red
end
self.contents.font.size = 30
self.contents.draw_text(D_X, D_Y, 60, 60, way,1)
self.contents.font.size = 20
dxyl_locator(0, 40, 60, 60, 0)
end
end
end#end of script ^,^
Where's my RMXP makers @?
Administrator
Show Signature