Wyglądają ładnie. Munkis faktycznie trochę jak z Diablo.
Mam taką prośbę. Czy mógłby wrzucić cały skrypt na UF?
Na rpgmakervx.net coś nie tak z moim kontem.
W demie są tylko grafiki a sam skrypt powinieneś skopiować z linku który dałem w 4 komentarzu, a jak masz problemy z logowaniem na rpgmakervx.net to spróbuj to:
Spoiler:
#--------------------------------------------------------------------
# A list of colors that you may use to configure the font and gauge
# colors in the config section. Simply replace the last part of each
# statement, i.e., the part in the brackets <> below:
#
# Colors::<White>
#--------------------------------------------------------------------
# Continue below for the configuration section
#--------------------------------------------------------------------
# * Revisions
# 10/10/09 - Creation
# 10/19/09 - Added show_hud command.
# Added visibility options by switch, map name, or leader
# 11/05/09 - Added fadout option
# 11/08/09 - Fixed bug caused by stale event listeners
#--------------------------------------------------------------------
# * Basic Commands
#--------------------------------------------------------------------
# * You can force the HUD to hide by using the "Script..."
# event command with this text:
#
# $scene.hide_hud
#
# You can show the hud once again by using this line:
#
# $scene_show_hud
#--------------------------------------------------------------------
module Colors
#--------------------------------------------------------------------
# do not touch this
class Point
attr_reader :x
attr_reader :y
def initialize(x, y)
@x, @y = x, y
end
def to_a
[@x, @y]
end
end
# or this
class ScrollDirection
Left = 0
Right = 1
end
#--------------------------------------------------------------------
# The actor id of the main character in your game.
# This will be the character in the main hud window.
PLAYER_ID = 1
# if this is set to 'true' the HUD will go opaque.
# when the player is walking.
TRANSPARENT_WHEN_MOVING = true
# this is the minimum opacity value reached while walking.
# this should be a value between 0 and 255.
TRANSPARENCY_WHEN_MOVING = 64
# this value determines how fast the HUD will fade out and in.
# this is in incremenets per frame (60 frames per second).
TRANSPARENCY_SWITCH_SPEED = 2
# If this switch is 'ON' the hud will not appear at all.
# Set this to 'nil' to disable the feature completely
NO_SHOW_SWITCH = nil
# If this text is found in a map name the hud will
# be disabled for that map at all times. This text
# will be removed from the map name proper in case
# you are using a map name script or somethin like that.
NO_SHOW_TEXT = 'hud no show'
# Display an empty hud if there is no party leader?
SHOW_IF_NO_LEADER = false
# Name of the player (main character) hud graphic
PLAYER_HUD_IMAGE_NAME = 'player_hud'
# Use the gren and blue mp/hp gauges?
# You may use your own graphics, but they must
# adhere to the same format as the originals, i.e.,
#
# hud_bar_hp_000.png
#
# Where the '000' part is a multiple of five, from 0-100.
PLAYER_USE_CUSTOM_GAUGE = true
# The physical location of the hud sprite.
# All of the other graphic locations are relative to this one.
PLAYER_HUD_LOC = Point.new(0, 0)
# The relative location of the hud image to the hud sprite.
PLAYER_HUD_IMAGE_LOCATION = Point.new(0, 0)
# The starting location of each peice of the HP gauge.
PLAYER_HP_GAUGE_LOCATION = Point.new(0, 0)
# the starting location of each peice of the MP gauge.
PLAYER_MP_GAUGE_LOCATION = Point.new(0, 0)
SHOW_PLAYER_FACE_IMAGE = true
# The location of the face graphic.
FACE_LOCATION = Point.new(35, 0)
# Show all party members? (THESE FEATURES ARE NOT YET IMPLEMENTED)
USE_MEMBER_WINDOW = true
MEMBER_HUD_IMAGE_NAME = 'member_hud'
MEMBER_USE_CUSTOM_GAUGE = false
# Allow the player to hide the HUD by pressing a button?
ALLOW_HUD_HIDE = true
# The button which will trigger a hud move.
HIDE_HUD_INPUT = Input::X
# The speed at which to move the hud.
HUD_HIDE_SPEED = 7
# replace "Left" with "Right" below to change the scroll direction
HUD_SCROLL_DIRECTION = ScrollDirection::Left
# Global values which are convenient for setting
# multiple values to the same thing.
GLOBAL_FONT_NAME = ['Magneto', 'Consolas', 'Verdana', 'Ariel', 'Courier New']
GLOBAL_PLAYER_FONT_SIZE = 22
GLOBAL_MEMBER_FONT_SIZE = 22
SHOW_PLAYER_NAME = true
# The rest of the settings deal with setting the
# location and style of the text displayed in the HDU
PLAYER_NAME_FONT = GLOBAL_FONT_NAME
PLAYER_NAME_COLOR = Colors::Silver
PLAYER_NAME_USE_ITALICS = false
PLAYER_NAME_USE_BOLD = false
PLAYER_NAME_USE_SHADOW = true
PLAYER_NAME_FONT_SIZE = 20
PLAYER_NAME_LOCATION = Point.new(125,0)
PLAYER_NAME_WIDTH = 90
PLAYER_NAME_HEIGHT = 22
def player_begin_move
@new_opacity = TRANSPARENCY_WHEN_MOVING
end
def update
if TRANSPARENT_WHEN_MOVING && self.opacity != @new_opacity
incr = TRANSPARENCY_SWITCH_SPEED
if @new_opacity < self.opacity
new_opacity = [self.opacity - incr, @new_opacity].max
else
new_opacity = [self.opacity + incr, @new_opacity].min
end
self.opacity = new_opacity
end
super
end
def actor=(value)
# allow nil values to cause a refresh so that the hud
# is painted at all times, even when there are no party members.
return if @actor == value unless value.nil?
remove_listeners(@actor)
add_listeners(value)
@actor = value
create_player_face_image
refresh
end
def hud_visible?
@hud_visible
end
def hud_visible=(value)
if @hud_visible != value
@hud_visible = value
refresh
end
end
def image_rect
ret = hud_image.rect
ret.x, ret.y = *PLAYER_HUD_LOC.to_a
return ret
end
# Stupid hack to get standard text colors because
# I did not feel like copy & pasting those methods.
def hp_color
return (@window ||= create_dummy_window).hp_color(@actor, true)
end
def mp_color
return (@window ||= create_dummy_window).mp_color(@actor, true)
end
def hud_image
return Cache.picture(PLAYER_HUD_IMAGE_NAME)
end
def hud_location
return PLAYER_HUD_IMAGE_LOCATION
end
def hp_gauge_location
return PLAYER_HP_GAUGE_LOCATION
end
def mp_gauge_location
return PLAYER_MP_GAUGE_LOCATION
end
def name_draw_rect
return Rect.new(
PLAYER_NAME_LOCATION.x,
PLAYER_NAME_LOCATION.y,
PLAYER_NAME_WIDTH,
PLAYER_NAME_HEIGHT
)
end
def level_draw_rect
return Rect.new(
PLAYER_LEVEL_LOCATION.x,
PLAYER_LEVEL_LOCATION.y,
PLAYER_LEVEL_WIDTH,
PLAYER_LEVEL_HEIGHT
)
end
def hp_draw_rect
return Rect.new(
PLAYER_HP_LOCATION.x,
PLAYER_HP_LOCATION.y,
PLAYER_HP_WIDTH,
PLAYER_HP_HEIGHT
)
end
def mp_draw_rect
return Rect.new(
PLAYER_MP_LOCATION.x,
PLAYER_MP_LOCATION.y,
PLAYER_MP_WIDTH,
PLAYER_MP_HEIGHT
)
end
def name_font
font = Font.new(PLAYER_NAME_FONT, PLAYER_NAME_FONT_SIZE)
font.color = PLAYER_NAME_COLOR
font.italic = PLAYER_NAME_USE_ITALICS
font.bold = PLAYER_NAME_USE_BOLD
font.shadow = PLAYER_NAME_USE_SHADOW
return font
end
def hp_font
font = Font.new(PLAYER_HP_FONT, PLAYER_HP_FONT_SIZE)
font.color = hp_color
font.italic = PLAYER_HP_FONT_USE_ITALICS
font.bold = PLAYER_HP_FONT_USE_BOLD
font.shadow = PLAYER_HP_FONT_USE_SHADOW
return font
end
def mp_font
font = Font.new(PLAYER_MP_FONT, PLAYER_MP_FONT_SIZE)
font.color = mp_color
font.italic = PLAYER_MP_FONT_USE_ITALICS
font.bold = PLAYER_MP_FONT_USE_BOLD
font.shadow = PLAYER_MP_FONT_USE_SHADOW
return font
end
def level_font
font = Font.new(PLAYER_LEVEL_FONT, PLAYER_LEVEL_FONT_SIZE)
font.color = PLAYER_LEVEL_COLOR
font.italic = PLAYER_LEVEL_USE_ITALICS
font.bold = PLAYER_LEVEL_USE_BOLD
font.shadow = PLAYER_LEVEL_USE_SHADOW
return font
end
def player_face_mask_image
return Cache.picture(PLAYER_FACE_MASK_NAME)
end
def create_player_face_image(size=96)
if @actor.nil?
@face_image = Bitmap.new(size, size)
return
end
rect = Rect.new(0, 0, 0, 0)
rect.x = @actor.face_index % 4 * 96 + (96 - size) / 2
rect.y = @actor.face_index / 4 * 96 + (96 - size) / 2
rect.width = size
rect.height = size
face = Cache.face(@actor.face_name)
mask = player_face_mask_image
@face_image = Bitmap.new(rect.width, rect.height)
@face_image.blt(0, 0, face, rect)
for y in 0...rect.height
for x in 0...rect.width
mask_color = mask.get_pixel(x, y)
@face_image.set_pixel(x, y, mask_color) if mask_color.alpha.zero?
end
end
end
def add_listeners(actor)
return if actor.nil?
func = lambda { refresh }
actor.hp_changed.add_listener(self, func)
actor.maxhp_changed.add_listener(self, func)
actor.mp_changed.add_listener(self, func)
actor.maxmp_changed.add_listener(self, func)
end
def hp_value_changed
refresh
end
def remove_listeners(actor)
return if actor.nil?
actor.hp_changed.remove_listener(self)
actor.maxhp_changed.remove_listener(self)
actor.mp_changed.remove_listener(self)
actor.maxmp_changed.remove_listener(self)
end
def round_to_multiple_of(multiple_of, num)
# why in the fuck did I do this this way?
# leave comments for yourself in the future dumbass.
leftover = num % multiple_of
return num if leftover.zero?
if leftover > multiple_of / 2
sym = :+
else
sym = :-
end
ret = num
loop do
ret = ret.send sym, 1
break if ret % multiple_of == 0
end
return ret
end
def check_health_bounds(num, multiple)
# dont allow the gauge to read 100 or 0 unless
# the current health actually is 100 or 0.
next_lower = 100 - multiple
if num > next_lower && num < 100
return next_lower
elsif num < multiple && num > 0
return multiple
else
return num
end
end
def draw_face
self.bitmap.blt(FACE_LOCATION.x, FACE_LOCATION.y, @face_image, @face_image.rect)
end
def draw_name
return if @actor.nil?
name = @actor.name
rect = name_draw_rect
font = name_font
temp_font = self.bitmap.font
self.bitmap.font = font
self.bitmap.draw_text(rect, name)
self.bitmap.font = temp_font
end
def draw_level
return if @actor.nil?
level = @actor.level
rect = level_draw_rect
font = level_font
temp_font = self.bitmap.font
self.bitmap.font = font
self.bitmap.draw_text(rect, level, 1)
self.bitmap.font = temp_font
end
def use_custom_gauges?
return PLAYER_USE_CUSTOM_GAUGE
end
def health_text(prefix, cur, max)
return "#{prefix}: #{cur}/#{max}"
end
def draw_health(rect, font, prefix, cur, max)
self.bitmap.font = font
xr = rect.x + rect.width
health_width = (rect.width * 0.33).round
spacer_width = (health_width / 2.1).round
temp_font = self.bitmap.font
prefixf = prefix + ':'
# fuck this pile of shit, move along, this will just hurt your head
self.bitmap.draw_text(rect.x, rect.y, self.bitmap.text_size(prefixf).width, rect.height, prefixf)
self.bitmap.draw_text(xr - spacer_width - health_width * 2 + (health_width * 0.15).round, rect.y, health_width, rect.height, cur, 2)
self.bitmap.draw_text(xr - spacer_width - health_width, rect.y, spacer_width, rect.height, "/", 2)
self.bitmap.draw_text(xr - health_width, rect.y, health_width, rect.height, max, 2)
self.bitmap.font = temp_font
end
def draw_hp
return if @actor.nil?
draw_health(hp_draw_rect, hp_font, Vocab.hp_a, @actor.hp, @actor.maxhp)
end
def draw_mp
return if @actor.nil?
draw_health(mp_draw_rect, mp_font, Vocab.mp_a, @actor.mp, @actor.maxmp)
end
def refresh
self.bitmap.clear
return unless hud_visible?
draw_face if SHOW_PLAYER_FACE_IMAGE
draw_hud
draw_name if SHOW_PLAYER_NAME
draw_level if SHOW_PLAYER_LEVEL
draw_hp if USE_HP_TEXT_DISPLAY
draw_mp if USE_MP_TEXT_DISPLAY
end
def dispose
remove_listeners(@actor)
$game_player.move_begun.remove_listener(self)
$game_player.move_end.remove_listener(self)
unless @window.nil?
@window.dispose
@window = nil
end
super
end
end
class SubHud < MainHud
end
class Game_Map
alias :pre_confhud_gm_setup :setup
def setup(*args)
id = *args
@info = load_data('Data/MapInfos.rvdata')[id]
pre_confhud_gm_setup(*args)
end
def display_hud?
return !@info.name.include?(HudConfig::NO_SHOW_TEXT)
end
end
class Scene_Map < Scene_Base
include HudConfig
attr_reader :player_hud
# used to keep track of the hud location between
# setups and teardowns, i.e., if you enter the menu or battle.
@@last_hud_ox = 0
alias :pre_confhud_sm_start :start unless $@
def start
pre_confhud_sm_start
initialize_hud
$game_party.party_leader_changed.add_listener(self, lambda { @player_hud.actor = $game_party.members.first })
end
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