TW0FACE'S PROFILE
Tw0Face
5579
I'm an indie videogame developer from Germany and I've been making games for several years now.
Find all my games here:
https://twofacegames.itch.io
Find all my games here:
https://twofacegames.itch.io
Search
Filter
[GUESSING GAME] Secret Santa Sign-ups 2018
author=Tw0Face
I would like to join as well but it seems like I'm one day to late for this. :( If I can still join, I'm in. If not then have lots of fun, folks.
3 examples on how to respond to this quote:
1. "sorry, you're too late to join this time. No exceptions."
2. "we'll let you in, exceptionally, so we have an even number of people."
3. by completely ignoring it.
Well, thanks for choosing 3.
[RMMV] How would I make an event that activates in different ways?
Easy. Create an Event and choose Event Contact as Trigger. Then use Conditional Branch and ask if Button C is being pressed (Conditional Branch, Page 4). If yes, insert your text for talking normally. If not (else), insert whatever your Event will do when it gets mad.
Greetings,
Tw0Face
Greetings,
Tw0Face
[GUESSING GAME] Secret Santa Sign-ups 2018
I would like to join as well but it seems like I'm one day to late for this. :( If I can still join, I'm in. If not then have lots of fun, folks.
[RMVX ACE] Compatibility issue with MOG - Scene File A (V1.3)
[RMVX ACE] Compatibility issue with MOG - Scene File A (V1.3)
Hi guys,
I need some help to make my Mouse Script compatible with Moghunter's Save-Script (MOG - Scene File A (V1.3) ). Currently, they don't seem to work together. I think, the Moghunter's Save-Script need to be altered a lil bit in order to work with my Mouse System, because whenever I want to load or save, I receive this super sweet error message.
I hope someone can help me with that. Thanks for your time. I'll make sure to credit you of course. ;)
Mouse Script:
MOG - Scene File A (V1.3)
Greetings,
Tw0Face
I need some help to make my Mouse Script compatible with Moghunter's Save-Script (MOG - Scene File A (V1.3) ). Currently, they don't seem to work together. I think, the Moghunter's Save-Script need to be altered a lil bit in order to work with my Mouse System, because whenever I want to load or save, I receive this super sweet error message.

I hope someone can help me with that. Thanks for your time. I'll make sure to credit you of course. ;)
Mouse Script:
CPOS = Win32API.new 'user32', 'GetCursorPos', , 'v'
WINX = Win32API.new 'user32', 'FindWindowEx', , 'i'
ASKS = Win32API.new 'user32', 'GetAsyncKeyState', , 'i'
SMET = Win32API.new 'user32', 'GetSystemMetrics', , 'i'
WREC = Win32API.new 'user32', 'GetWindowRect', , 'v'
#MOUSE_ICON, set to the index of the icon to use as a cursor
MOUSE_ICON = 33
CURSOR_OFFSET_X = -12
CURSOR_OFFSET_Y = -12
#Keeps cursor sprite within the game window
MOUSE_KEEP_WINDOW = true
#Whether clicking requires cursor to be within window or not
MOUSE_CLICK_WITHIN = false
#Whether to use 8 directional movement or not
MOUSE_DIR8 = false
#Use the Mouse Button Overlay:
USE_MOUSE_BUTTONS = false
#And here is where you set up your buttons! Simple overlay:
#(Picture files are to be stored in System)
#
#
MOUSE_BUTTONS = [
,
, ]
SHOWMOUS = Win32API.new 'user32', 'ShowCursor', 'i', 'i'
SHOWMOUS.call(0)
#Switch option to enable/disable the script
USE_MOUSE_SWITCH = false
MOUSE_SWITCH = 487
module Mouse
def self.setup
@enabled = true
@delay = 0
bwap = true if SMET.call(23) != 0
bwap ? @lmb = 0x02 : @lmb = 0x01
bwap ? @rmb = 0x02 : @rmb = 0x02
end
def self.update
return false unless @enabled
return false if USE_MOUSE_SWITCH && !$game_switches
self.setup if @lmb.nil?
@delay -= 1
@window_loc = WINX.call(0,0,"RGSS PLAYER",0)
if ASKS.call(@lmb) == 0 then @l_clicked = false end
if ASKS.call(@rmb) == 0 then @r_clicked = false end
rect = '0000000000000000'
cursor_pos = '00000000'
WREC.call(@window_loc, rect)
side, top = rect.unpack("ll")
CPOS.call(cursor_pos)
@m_x, @m_y = cursor_pos.unpack("ll")
w_x = side + SMET.call(5) + SMET.call(45)
w_y = top + SMET.call(6) + SMET.call(46) + SMET.call(4)
@m_x -= w_x; @m_y -= w_y
if MOUSE_KEEP_WINDOW
@m_x = [.max,Graphics.width-5].min
@m_y = [.max,Graphics.height-5].min
end
return true
end
def self.pos?
return unless self.update
return
end
def self.lclick?(repeat = false)
return unless self.update
return false if @l_clicked
if ASKS.call(@lmb) != 0 then
@l_clicked = true if !repeat
return true end
end
def self.rclick?(repeat = false)
return unless self.update
return false if @r_clicked
if ASKS.call(@rmb) != 0 then
@r_clicked = true if !repeat
return true end
end
def self.slowpeat
return unless self.update
return false if @delay > 0
@delay = 120
return true
end
def self.within?(rect)
return unless self.update
return false if @m_x < rect.x or @m_y < rect.y
bound_x = rect.x + rect.width; bound_y = rect.y + rect.height
return true if @m_x < bound_x and @m_y < bound_y
return false
end
def self.disable
@enabled = false
SHOWMOUS.call(1)
end
def self.enable
@enabled = true
SHOWMOUS.call(0)
end
end
Mouse.setup
module DataManager
class << self
alias mouse_init init
end
def self.init
mouse_init
$cursor = Mouse_Cursor.new
end
end
class Scene_Base
alias cursor_update update_basic
def update_basic
cursor_update
mouse_cursor
end
def mouse_cursor
pos = Mouse.pos?
$cursor.x = pos + CURSOR_OFFSET_X
$cursor.y = pos + CURSOR_OFFSET_Y
end
end
class Mouse_Cursor < Sprite_Base
def initialize
super
@icon = MOUSE_ICON
self.bitmap = Bitmap.new(24,24)
draw_cursor
self.z = 255
end
def set_icon(icon)
return if @icon == icon
@icon = icon
draw_cursor
end
def draw_cursor
self.bitmap.clear
icon_bitmap = Cache.system("Iconset")
rect = Rect.new(@icon % 16 * 24, @icon / 16 * 24, 24, 24)
self.bitmap.blt(0, 0, icon_bitmap, rect)
end
end
class Window_Selectable
alias mouse_update update
alias mouse_init initialize
def initialize(x,y,w,h)
mouse_init(x,y,w,h)
@mouse_all_rects =
@timer = 0
end
def update
mouse_update
update_mouse if self.active
end
def update_mouse
@timer -= 1
@mouse_all_rects =
item_max.times {|i|
rect = item_rect(i)
rect.x += self.x + standard_padding - self.ox
rect.y += self.y + standard_padding - self.oy
if !self.viewport.nil?
rect.x += self.viewport.rect.x - self.viewport.ox
rect.y += self.viewport.rect.y - self.viewport.oy
end
@mouse_all_rects.push(rect) }
item_max.times {|i|
next if @timer > 0
next unless Mouse.within?(@mouse_all_rects)
@timer = 10 if i > top_row * 2 + page_item_max - 1
@timer = 10 if i < top_row * 2
self.index = i }
process_cancel if Mouse.rclick? && cancel_enabled?
return if MOUSE_CLICK_WITHIN && !within_index
process_ok if Mouse.lclick? && ok_enabled?
end
def within_index
item_max.times {|i|
return true if Mouse.within?(@mouse_all_rects) }
return false
end
end
class Window_NameInput
alias mouse_process_handling process_handling
def process_handling
mouse_process_handling
process_back if Mouse.rclick?
end
def item_max
return 90
end
end
class Window_Message < Window_Base
def input_pause
self.pause = true
wait(10)
Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C) || Mouse.lclick? #if !SceneManager.scene_is?(Scene_Map))
Input.update
self.pause = false
end
end
class Scene_File < Scene_MenuBase
alias mouse_update update
def update
mouse_update
mouse_input
end
def mouse_input
xx = 0
yy = 56
width = Graphics.width
rectcm1 = Rect.new(xx, yy, width, savefile_height)
rectcm2 = Rect.new(xx, yy + rectcm1.height, width, savefile_height)
rectcm3 = Rect.new(xx, yy + rectcm1.height * 2, width, savefile_height)
rectcm4 = Rect.new(xx, yy + rectcm1.height * 3, width, savefile_height)
rectttl = Rect.new(xx, yy, width, rectcm1.height * 4)
rectcmA = Rect.new(0, yy - 12, Graphics.width, 24)
rectcmB = Rect.new(0, Graphics.height - 12, Graphics.width, 24)
@scroll = self.top_index
last_index = @index
@index = (0 + @scroll) if Mouse.within?(rectcm1)
@index = (1 + @scroll) if Mouse.within?(rectcm2)
@index = (2 + @scroll) if Mouse.within?(rectcm3)
@index = (3 + @scroll) if Mouse.within?(rectcm4)
cursor_down(false) if Mouse.within?(rectcmB) and Mouse.slowpeat
cursor_up(false) if Mouse.within?(rectcmA) and Mouse.slowpeat
if @index != last_index
Sound.play_cursor
@savefile_windows.selected = false
@savefile_windows.selected = true
end
on_savefile_ok if Mouse.lclick? and Mouse.within?(rectttl)
on_savefile_cancel if Mouse.rclick? and Mouse.within?(rectttl)
end
end
class Scene_Gameover
alias mouse_update update
def update
mouse_update
goto_title if Mouse.lclick? or Mouse.rclick?
end
end
class Game_Player < Game_Character < Scene_MenuBase
alias mouse_move_update update
def update
mouse_move_update
mouse_input
end
def mouse_input
begin
return if USE_MOUSE_BUTTONS && SceneManager.scene.mouse_overlay.update
rescue
return
end
Graphics.width / 32 % 2 == 0 ? xxx = 16 : xxx = 0
Graphics.height / 32 % 2 == 0 ? yyy = 16 : yyy = 0
x = $game_map.display_x + (Mouse.pos? + xxx) / 32
y = $game_map.display_y + (Mouse.pos? + yyy) / 32
x -= 0.5 if Graphics.width / 32 % 2 == 0
y -= 0.5 if Graphics.height / 32 % 2 == 0
if MOUSE_DIR8
x = (-((($game_player.screen_x-16)/32)-$game_player.x)) * 32 + Mouse.pos?
y = (-((($game_player.screen_y-16)/32)-$game_player.y)) * 32 + Mouse.pos?
x -= @x * 32 + 16
y -= @y * 32 + 16
aimangle = Math.atan((x.abs)/(y.abs)) * (180 / Math::PI) if y.abs !=0
if y.abs == 0 && x.abs >= 0
aimangle = 90
end
if y.abs == 0 && x.abs < 0
aimangle = 270
end
aimangle = 180 - aimangle if x > 0 && y >= 0
aimangle += 180 if x <= 0 && y >= 0
aimangle = 360 - aimangle if x <= 0 && y < 0
$aim = aimangle * Math::PI / 180
$lightaim = aimangle
set_direction(8) if aimangle >= 337.6 || aimangle <= 22.5
set_direction(9) if aimangle >= 22.6 && aimangle <= 67.5
set_direction(6) if aimangle >= 67.6 && aimangle <= 112.5
set_direction(3) if aimangle >= 112.6 && aimangle <= 157.5
set_direction(2) if aimangle >= 157.6 && aimangle <= 202.5
set_direction(1) if aimangle >= 202.6 && aimangle <= 247.5
set_direction(4) if aimangle >= 247.6 && aimangle <= 292.5
set_direction(7) if aimangle >= 292.6 && aimangle <= 337.5
else
x = $game_map.display_x + Mouse.pos? / 32
y = $game_map.display_y + Mouse.pos? / 32
sx = distance_x_from(x)
sy = distance_y_from(y)
if sx.abs > sy.abs
set_direction(sx > 0 ? 4 : 6)
set_direction(sy > 0 ? 8 : 2) if !@move_succeed && sy != 0
elsif sy != 0
set_direction(sy > 0 ? 8 : 2)
set_direction(sx > 0 ? 4 : 6) if !@move_succeed && sx != 0
end
end
end
end
WINX = Win32API.new 'user32', 'FindWindowEx', , 'i'
ASKS = Win32API.new 'user32', 'GetAsyncKeyState', , 'i'
SMET = Win32API.new 'user32', 'GetSystemMetrics', , 'i'
WREC = Win32API.new 'user32', 'GetWindowRect', , 'v'
#MOUSE_ICON, set to the index of the icon to use as a cursor
MOUSE_ICON = 33
CURSOR_OFFSET_X = -12
CURSOR_OFFSET_Y = -12
#Keeps cursor sprite within the game window
MOUSE_KEEP_WINDOW = true
#Whether clicking requires cursor to be within window or not
MOUSE_CLICK_WITHIN = false
#Whether to use 8 directional movement or not
MOUSE_DIR8 = false
#Use the Mouse Button Overlay:
USE_MOUSE_BUTTONS = false
#And here is where you set up your buttons! Simple overlay:
#(Picture files are to be stored in System)
#
#
MOUSE_BUTTONS = [
,
, ]
SHOWMOUS = Win32API.new 'user32', 'ShowCursor', 'i', 'i'
SHOWMOUS.call(0)
#Switch option to enable/disable the script
USE_MOUSE_SWITCH = false
MOUSE_SWITCH = 487
module Mouse
def self.setup
@enabled = true
@delay = 0
bwap = true if SMET.call(23) != 0
bwap ? @lmb = 0x02 : @lmb = 0x01
bwap ? @rmb = 0x02 : @rmb = 0x02
end
def self.update
return false unless @enabled
return false if USE_MOUSE_SWITCH && !$game_switches
self.setup if @lmb.nil?
@delay -= 1
@window_loc = WINX.call(0,0,"RGSS PLAYER",0)
if ASKS.call(@lmb) == 0 then @l_clicked = false end
if ASKS.call(@rmb) == 0 then @r_clicked = false end
rect = '0000000000000000'
cursor_pos = '00000000'
WREC.call(@window_loc, rect)
side, top = rect.unpack("ll")
CPOS.call(cursor_pos)
@m_x, @m_y = cursor_pos.unpack("ll")
w_x = side + SMET.call(5) + SMET.call(45)
w_y = top + SMET.call(6) + SMET.call(46) + SMET.call(4)
@m_x -= w_x; @m_y -= w_y
if MOUSE_KEEP_WINDOW
@m_x = [.max,Graphics.width-5].min
@m_y = [.max,Graphics.height-5].min
end
return true
end
def self.pos?
return unless self.update
return
end
def self.lclick?(repeat = false)
return unless self.update
return false if @l_clicked
if ASKS.call(@lmb) != 0 then
@l_clicked = true if !repeat
return true end
end
def self.rclick?(repeat = false)
return unless self.update
return false if @r_clicked
if ASKS.call(@rmb) != 0 then
@r_clicked = true if !repeat
return true end
end
def self.slowpeat
return unless self.update
return false if @delay > 0
@delay = 120
return true
end
def self.within?(rect)
return unless self.update
return false if @m_x < rect.x or @m_y < rect.y
bound_x = rect.x + rect.width; bound_y = rect.y + rect.height
return true if @m_x < bound_x and @m_y < bound_y
return false
end
def self.disable
@enabled = false
SHOWMOUS.call(1)
end
def self.enable
@enabled = true
SHOWMOUS.call(0)
end
end
Mouse.setup
module DataManager
class << self
alias mouse_init init
end
def self.init
mouse_init
$cursor = Mouse_Cursor.new
end
end
class Scene_Base
alias cursor_update update_basic
def update_basic
cursor_update
mouse_cursor
end
def mouse_cursor
pos = Mouse.pos?
$cursor.x = pos + CURSOR_OFFSET_X
$cursor.y = pos + CURSOR_OFFSET_Y
end
end
class Mouse_Cursor < Sprite_Base
def initialize
super
@icon = MOUSE_ICON
self.bitmap = Bitmap.new(24,24)
draw_cursor
self.z = 255
end
def set_icon(icon)
return if @icon == icon
@icon = icon
draw_cursor
end
def draw_cursor
self.bitmap.clear
icon_bitmap = Cache.system("Iconset")
rect = Rect.new(@icon % 16 * 24, @icon / 16 * 24, 24, 24)
self.bitmap.blt(0, 0, icon_bitmap, rect)
end
end
class Window_Selectable
alias mouse_update update
alias mouse_init initialize
def initialize(x,y,w,h)
mouse_init(x,y,w,h)
@mouse_all_rects =
@timer = 0
end
def update
mouse_update
update_mouse if self.active
end
def update_mouse
@timer -= 1
@mouse_all_rects =
item_max.times {|i|
rect = item_rect(i)
rect.x += self.x + standard_padding - self.ox
rect.y += self.y + standard_padding - self.oy
if !self.viewport.nil?
rect.x += self.viewport.rect.x - self.viewport.ox
rect.y += self.viewport.rect.y - self.viewport.oy
end
@mouse_all_rects.push(rect) }
item_max.times {|i|
next if @timer > 0
next unless Mouse.within?(@mouse_all_rects)
@timer = 10 if i > top_row * 2 + page_item_max - 1
@timer = 10 if i < top_row * 2
self.index = i }
process_cancel if Mouse.rclick? && cancel_enabled?
return if MOUSE_CLICK_WITHIN && !within_index
process_ok if Mouse.lclick? && ok_enabled?
end
def within_index
item_max.times {|i|
return true if Mouse.within?(@mouse_all_rects) }
return false
end
end
class Window_NameInput
alias mouse_process_handling process_handling
def process_handling
mouse_process_handling
process_back if Mouse.rclick?
end
def item_max
return 90
end
end
class Window_Message < Window_Base
def input_pause
self.pause = true
wait(10)
Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C) || Mouse.lclick? #if !SceneManager.scene_is?(Scene_Map))
Input.update
self.pause = false
end
end
class Scene_File < Scene_MenuBase
alias mouse_update update
def update
mouse_update
mouse_input
end
def mouse_input
xx = 0
yy = 56
width = Graphics.width
rectcm1 = Rect.new(xx, yy, width, savefile_height)
rectcm2 = Rect.new(xx, yy + rectcm1.height, width, savefile_height)
rectcm3 = Rect.new(xx, yy + rectcm1.height * 2, width, savefile_height)
rectcm4 = Rect.new(xx, yy + rectcm1.height * 3, width, savefile_height)
rectttl = Rect.new(xx, yy, width, rectcm1.height * 4)
rectcmA = Rect.new(0, yy - 12, Graphics.width, 24)
rectcmB = Rect.new(0, Graphics.height - 12, Graphics.width, 24)
@scroll = self.top_index
last_index = @index
@index = (0 + @scroll) if Mouse.within?(rectcm1)
@index = (1 + @scroll) if Mouse.within?(rectcm2)
@index = (2 + @scroll) if Mouse.within?(rectcm3)
@index = (3 + @scroll) if Mouse.within?(rectcm4)
cursor_down(false) if Mouse.within?(rectcmB) and Mouse.slowpeat
cursor_up(false) if Mouse.within?(rectcmA) and Mouse.slowpeat
if @index != last_index
Sound.play_cursor
@savefile_windows.selected = false
@savefile_windows.selected = true
end
on_savefile_ok if Mouse.lclick? and Mouse.within?(rectttl)
on_savefile_cancel if Mouse.rclick? and Mouse.within?(rectttl)
end
end
class Scene_Gameover
alias mouse_update update
def update
mouse_update
goto_title if Mouse.lclick? or Mouse.rclick?
end
end
class Game_Player < Game_Character < Scene_MenuBase
alias mouse_move_update update
def update
mouse_move_update
mouse_input
end
def mouse_input
begin
return if USE_MOUSE_BUTTONS && SceneManager.scene.mouse_overlay.update
rescue
return
end
Graphics.width / 32 % 2 == 0 ? xxx = 16 : xxx = 0
Graphics.height / 32 % 2 == 0 ? yyy = 16 : yyy = 0
x = $game_map.display_x + (Mouse.pos? + xxx) / 32
y = $game_map.display_y + (Mouse.pos? + yyy) / 32
x -= 0.5 if Graphics.width / 32 % 2 == 0
y -= 0.5 if Graphics.height / 32 % 2 == 0
if MOUSE_DIR8
x = (-((($game_player.screen_x-16)/32)-$game_player.x)) * 32 + Mouse.pos?
y = (-((($game_player.screen_y-16)/32)-$game_player.y)) * 32 + Mouse.pos?
x -= @x * 32 + 16
y -= @y * 32 + 16
aimangle = Math.atan((x.abs)/(y.abs)) * (180 / Math::PI) if y.abs !=0
if y.abs == 0 && x.abs >= 0
aimangle = 90
end
if y.abs == 0 && x.abs < 0
aimangle = 270
end
aimangle = 180 - aimangle if x > 0 && y >= 0
aimangle += 180 if x <= 0 && y >= 0
aimangle = 360 - aimangle if x <= 0 && y < 0
$aim = aimangle * Math::PI / 180
$lightaim = aimangle
set_direction(8) if aimangle >= 337.6 || aimangle <= 22.5
set_direction(9) if aimangle >= 22.6 && aimangle <= 67.5
set_direction(6) if aimangle >= 67.6 && aimangle <= 112.5
set_direction(3) if aimangle >= 112.6 && aimangle <= 157.5
set_direction(2) if aimangle >= 157.6 && aimangle <= 202.5
set_direction(1) if aimangle >= 202.6 && aimangle <= 247.5
set_direction(4) if aimangle >= 247.6 && aimangle <= 292.5
set_direction(7) if aimangle >= 292.6 && aimangle <= 337.5
else
x = $game_map.display_x + Mouse.pos? / 32
y = $game_map.display_y + Mouse.pos? / 32
sx = distance_x_from(x)
sy = distance_y_from(y)
if sx.abs > sy.abs
set_direction(sx > 0 ? 4 : 6)
set_direction(sy > 0 ? 8 : 2) if !@move_succeed && sy != 0
elsif sy != 0
set_direction(sy > 0 ? 8 : 2)
set_direction(sx > 0 ? 4 : 6) if !@move_succeed && sx != 0
end
end
end
end
MOG - Scene File A (V1.3)
#==============================================================================
# +++ MOG - Scene File A (V1.3) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# Tela de salvar e carregar animado versão A.
#==============================================================================
# Serão necessários as seguintes imagens na pasta Graphics/System
#
# Save_Number.png
# Save_Background.png
# Save_Character_Floor.png
# Save_Layout01.png
# Save_Layout02.png
# Save_Window01.png
# Save_Window02.png
#
#==============================================================================
#
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 1.3 - Melhor codificação.
# v 1.1 - Melhoria no sistema de dispose de imagens.
#==============================================================================
module MOG_SCENE_FILE
#Quantidade de slots de saves.
FILES_MAX = 10
end
#==============================================================================
# ■ Game Temp
#==============================================================================
class Game_Temp
attr_accessor :scene_save
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_scene_file_initialize initialize
def initialize
mog_scene_file_initialize
@scene_save = false
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● draw_picture_number(x,y,value,file_name,align, space, frame_max ,frame_index)
#--------------------------------------------------------------------------
# X - Posição na horizontal
# Y - Posição na vertical
# VALUE - Valor Numérico
# FILE_NAME - Nome do arquivo
# ALIGN - Centralizar 0 - Esquerda 1- Centro 2 - Direita
# SPACE - Espaço entre os números.
# FRAME_MAX - Quantidade de quadros(Linhas) que a imagem vai ter.
# FRAME_INDEX - Definição do quadro a ser utilizado.
#--------------------------------------------------------------------------
def draw_picture_number(x,y,value, file_name,align = 0, space = 0, frame_max = 1,frame_index = 0)
number_image = Cache.system(file_name)
frame_max = 1 if frame_max < 1
frame_index = frame_max -1 if frame_index > frame_max -1
align = 2 if align > 2
cw = number_image.width / 10
ch = number_image.height / frame_max
h = ch * frame_index
number = value.abs.to_s.split(//)
case align
when 0
plus_x = (-cw + space) * number.size
when 1
plus_x = (-cw + space) * number.size
plus_x /= 2
when 2
plus_x = 0
end
for r in 0..number.size - 1
number_abs = number.to_i
number_rect = Rect.new(cw * number_abs, h, cw, ch)
self.contents.blt(plus_x + x + ((cw - space) * r), y , number_image, number_rect)
end
number_image.dispose
end
#--------------------------------------------------------------------------
# ● Draw Help Layout
#--------------------------------------------------------------------------
def draw_face_save(name,x,y,type)
if type == 0
image_name = name + "_0"
elsif type == 1
image_name = name + "_1"
else
image_name = name + "_2"
end
image = Cache.face(image_name)
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
#--------------------------------------------------------------------------
# ● draw_parameter_layout
#--------------------------------------------------------------------------
def draw_parameter_layout(x,y)
image = Cache.system("Save_Window01")
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
#--------------------------------------------------------------------------
# ● draw_parameter_layout2
#--------------------------------------------------------------------------
def draw_parameter_layout2(x,y,type)
if type == 0
image = Cache.system("Save_Window02")
else
image = Cache.system("Save_Window03")
end
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
#--------------------------------------------------------------------------
# ● draw_character_floor
#--------------------------------------------------------------------------
def draw_character_floor(x,y)
image = Cache.system("Save_Character_Floor")
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
end
#==============================================================================
# ■ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# ● Make Save Header
#--------------------------------------------------------------------------
def self.make_save_header
header = {}
header = $game_party.characters_for_savefile
header = $game_system.playtime_s
header = $game_system.playtime
header = $game_map.display_name
header = $game_party.members
header
end
end
#==============================================================================
# ■ Window_SaveFile
#==============================================================================
class Window_SaveFile_A < Window_Base
attr_reader :filename
attr_reader :file_exist
attr_reader :time_stamp
attr_reader :selected
attr_reader :file_index
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(file_index, filename)
super(0, 0,720, 140)
self.opacity = 0
@file_index = file_index
@filename = filename
load_gamedata
refresh
@selected = false
end
#--------------------------------------------------------------------------
# ● load_gamedata
#--------------------------------------------------------------------------
def load_gamedata
@time_stamp = Time.at(0)
@file_exist = FileTest.exist?(@filename)
if @file_exist
header = DataManager.load_header(@file_index)
if header == nil
@file_exist = false
return
end
@characters = header
@total_sec = header
@mapname = header
@members = header
end
end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
xp = 96
ex = 60
if @file_exist
if @total_sec == nil
draw_parameter_layout2(0,50,0)
draw_parameter_layout(-10 + xp,0)
value = @file_index + 1
draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,0)
self.contents.draw_text(140, 50, 450, 32, "Error! - Please, dont't use your old Save Files...", 0)
return
end
draw_parameter_layout2(0,50,0)
draw_parameter_layout(-10 + xp,0)
value = @file_index + 1
draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,1)
draw_party_characters(180 + xp, 75,ex)
draw_playtime(495, 20, contents.width - 4, 2)
draw_map_location( 400 + xp,64)
draw_level(185 + xp,85,ex)
draw_face_save(40 + xp,0)
else
draw_parameter_layout2(0,50,1)
draw_parameter_layout(-10 + xp,0)
value = @file_index + 1
draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,0)
self.contents.draw_text(260, 50, 120, 32, "No Data", 1)
end
end
#--------------------------------------------------------------------------
# ● draw_face
#--------------------------------------------------------------------------
def draw_face_save(x,y)
draw_actor_face(@members, x, y)
end
#--------------------------------------------------------------------------
# ● draw_level
#--------------------------------------------------------------------------
def draw_level(x,y,ex)
self.contents.font.color = normal_color
for i in 0...@members.size
break if i > 3
level = @members.level
draw_picture_number(x + (ex * i) , y ,level - 1, "Save_Number_01",1,0,3,1)
end
end
#--------------------------------------------------------------------------
# ● draw_map_location
#--------------------------------------------------------------------------
def draw_map_location(x,y)
self.contents.font.bold = false
self.contents.font.name = "Verdana"
self.contents.font.size = 13
self.contents.font.italic = false
self.contents.draw_text(400, 60, 125, 20, @mapname.to_s, 0)
end
#--------------------------------------------------------------------------
# ● draw_party_characters
#--------------------------------------------------------------------------
def draw_party_characters(x, y,ex)
for i in 0...@characters.size
break if i > 3
name = @characters
index = @characters
draw_character_floor(- 35 + x + i * ex,y - 20)
draw_character(name, index, x + i * ex, y)
end
end
#--------------------------------------------------------------------------
# ● draw_playtime
#--------------------------------------------------------------------------
def draw_playtime(x, y, width, align)
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
draw_picture_number(x + 18 * 0, y ,0, "Save_Number_01",0,0,3,0) if hour < 10
draw_picture_number(x + 18 * 1, y ,hour, "Save_Number_01",0,0,3,0)
draw_picture_number(x + 18 * 3, y ,0, "Save_Number_01",0,0,3,0) if min < 10
draw_picture_number(x + 18 * 4, y ,min, "Save_Number_01",0,0,3,0)
draw_picture_number(x + 18 * 6, y ,0, "Save_Number_01",0,0,3,0) if sec < 10
draw_picture_number(x + 18 * 7, y ,sec , "Save_Number_01",0,0,3,0)
end
#--------------------------------------------------------------------------
# ● selected
#--------------------------------------------------------------------------
def selected=(selected)
@selected = selected
end
end
#==============================================================================
# ■ Scene Save
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
$game_temp.scene_save = true
super
end
end
#==============================================================================
# ■ Scene Load
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
$game_temp.scene_save = false
super
end
end
#==============================================================================
# ■ Scene_File
#==============================================================================
class Scene_File
include MOG_SCENE_FILE
#--------------------------------------------------------------------------
# ● initialize
#--------------------------------------------------------------------------
def initialize
@saving = $game_temp.scene_save
@file_max = FILES_MAX
@file_max = 1 if FILES_MAX < 1
execute_dispose
create_layout
create_savefile_windows
@index = DataManager.last_savefile_index
@check_prev_index = true
@savefile_windows.selected = true
end
#--------------------------------------------------------------------------
# ● Main
#--------------------------------------------------------------------------
def main
Graphics.transition
execute_loop
execute_dispose
end
#--------------------------------------------------------------------------
# ● Execute Loop
#--------------------------------------------------------------------------
def execute_loop
loop do
Graphics.update
Input.update
update
if SceneManager.scene != self
break
end
end
end
#--------------------------------------------------------------------------
# ● Create_background
#--------------------------------------------------------------------------
def create_layout
@background = Plane.new
@background.bitmap = Cache.system("Save_Background")
@background.z = 0
@layout_01 = Sprite.new
@layout_01.bitmap = Cache.system("Save_Layout01")
@layout_01.z = 1
@layout_01.blend_type = 1
image = Cache.system("Save_Layout02")
@bitmap = Bitmap.new(image.width,image.height)
cw = image.width
ch = image.height / 2
if @saving
h = 0
else
h = ch
end
src_rect = Rect.new(0, h, cw, ch)
@bitmap.blt(0,0, image, src_rect)
@layout_02 = Sprite.new
@layout_02.bitmap = @bitmap
@layout_02.z = 3
@layout_02.y = 370
image.dispose
end
#--------------------------------------------------------------------------
# ● Execute Dispose
#--------------------------------------------------------------------------
def execute_dispose
return if @background == nil
Graphics.freeze
@background.bitmap.dispose
@background.dispose
@background = nil
@layout_01.bitmap.dispose
@layout_01.dispose
@layout_02.bitmap.dispose
@layout_02.dispose
@bitmap.dispose
dispose_item_windows
end
#--------------------------------------------------------------------------
# ● Frame Update
#--------------------------------------------------------------------------
def update
update_savefile_windows
update_savefile_selection
check_start_index
end
#--------------------------------------------------------------------------
# ● check_start_index
#--------------------------------------------------------------------------
def check_start_index
return if @check_prev_index == false
@check_prev_index = false
check_active_window
end
#--------------------------------------------------------------------------
# ● check_active_window
#--------------------------------------------------------------------------
def check_active_window
@index = 0 if @index == nil
for i in 0...@file_max
@pw = @index - 1
@pw = 0 if @pw > @file_max - 1
@pw = @file_max- 1 if @pw < 0
@aw = @index
@nw = @index + 1
@nw = 0 if @nw > @file_max - 1
@nw = @file_max - 1 if @nw < 0
case @savefile_windows.file_index
when @pw,@nw
@savefile_windows.visible = true
@savefile_windows.contents_opacity = 80
when @aw
@savefile_windows.visible = true
@savefile_windows.contents_opacity = 255
else
@savefile_windows.visible = false
end
end
end
#--------------------------------------------------------------------------
# ● Create Save File Window
#--------------------------------------------------------------------------
def create_savefile_windows
@pw_pos =
@aw_pos =
@nw_pos =
@savefile_windows =
for i in 0...@file_max
@savefile_windows = Window_SaveFile_A.new(i, DataManager.make_filename(i))
@savefile_windows.z = 2
@savefile_windows.visible = false
@savefile_windows.x = 400
end
check_active_window
@item_max = @file_max
end
#--------------------------------------------------------------------------
# ● Dispose of Save File Window
#--------------------------------------------------------------------------
def dispose_item_windows
for window in @savefile_windows
window.dispose
end
end
#--------------------------------------------------------------------------
# ● Update Save File Window
#--------------------------------------------------------------------------
def update_savefile_windows
update_slide_window
for window in @savefile_windows
window.update
end
end
#--------------------------------------------------------------------------
# ● update_slide_window
#--------------------------------------------------------------------------
def update_slide_window
@background.ox += 0
slide_window_x(@pw,@pw_pos)
slide_window_x(@aw,@aw_pos)
slide_window_x(@nw,@nw_pos)
slide_window_y(@pw,@pw_pos)
slide_window_y(@aw,@aw_pos)
slide_window_y(@nw,@nw_pos)
end
#--------------------------------------------------------------------------
# ● slide_window_x
#--------------------------------------------------------------------------
def slide_window_x(i,x_pos)
if @savefile_windows.x < x_pos
@savefile_windows.x += 15
@savefile_windows.x = x_pos if @savefile_windows.x > x_pos
end
if @savefile_windows.x > x_pos
@savefile_windows.x -= 15
@savefile_windows.x = x_pos if @savefile_windows.x < x_pos
end
end
#--------------------------------------------------------------------------
# ● slide_window_y
#--------------------------------------------------------------------------
def slide_window_y(i,y_pos)
if @savefile_windows.y < y_pos
@savefile_windows.y += 15
@savefile_windows.y = y_pos if @savefile_windows.y > y_pos
end
if @savefile_windows.y > y_pos
@savefile_windows.y -= 15
@savefile_windows.y = y_pos if @savefile_windows.y < y_pos
end
end
#--------------------------------------------------------------------------
# ● reset_position
#--------------------------------------------------------------------------
def reset_position(diretion)
check_active_window
case diretion
when 0
@savefile_windows.y = -64
@savefile_windows.x = 0
when 1
@savefile_windows.y = 440
@savefile_windows.x = 0
end
end
#--------------------------------------------------------------------------
# ● Update Save File Selection
#--------------------------------------------------------------------------
def update_savefile_selection
if Input.trigger?(Input::C)
on_savefile_ok
elsif Input.trigger?(Input::B)
Sound.play_cancel
return_scene
else
last_index = @index
if Input.trigger?(Input::DOWN)
execute_index(1)
if @file_max > 2
reset_position(1)
else
reset_position(0)
end
end
if Input.trigger?(Input::UP)
execute_index(-1)
reset_position(0)
end
if @index != last_index
Sound.play_cursor
@savefile_windows.selected = false
@savefile_windows.selected = true
end
end
end
#--------------------------------------------------------------------------
# ● Execute Index
#--------------------------------------------------------------------------
def execute_index(value)
@index += value
@index = @index >= @file_max ? 0 : @index < 0 ? (@file_max - 1) : @index
end
end
$mog_rgss3_scene_file = true
# +++ MOG - Scene File A (V1.3) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# Tela de salvar e carregar animado versão A.
#==============================================================================
# Serão necessários as seguintes imagens na pasta Graphics/System
#
# Save_Number.png
# Save_Background.png
# Save_Character_Floor.png
# Save_Layout01.png
# Save_Layout02.png
# Save_Window01.png
# Save_Window02.png
#
#==============================================================================
#
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 1.3 - Melhor codificação.
# v 1.1 - Melhoria no sistema de dispose de imagens.
#==============================================================================
module MOG_SCENE_FILE
#Quantidade de slots de saves.
FILES_MAX = 10
end
#==============================================================================
# ■ Game Temp
#==============================================================================
class Game_Temp
attr_accessor :scene_save
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_scene_file_initialize initialize
def initialize
mog_scene_file_initialize
@scene_save = false
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● draw_picture_number(x,y,value,file_name,align, space, frame_max ,frame_index)
#--------------------------------------------------------------------------
# X - Posição na horizontal
# Y - Posição na vertical
# VALUE - Valor Numérico
# FILE_NAME - Nome do arquivo
# ALIGN - Centralizar 0 - Esquerda 1- Centro 2 - Direita
# SPACE - Espaço entre os números.
# FRAME_MAX - Quantidade de quadros(Linhas) que a imagem vai ter.
# FRAME_INDEX - Definição do quadro a ser utilizado.
#--------------------------------------------------------------------------
def draw_picture_number(x,y,value, file_name,align = 0, space = 0, frame_max = 1,frame_index = 0)
number_image = Cache.system(file_name)
frame_max = 1 if frame_max < 1
frame_index = frame_max -1 if frame_index > frame_max -1
align = 2 if align > 2
cw = number_image.width / 10
ch = number_image.height / frame_max
h = ch * frame_index
number = value.abs.to_s.split(//)
case align
when 0
plus_x = (-cw + space) * number.size
when 1
plus_x = (-cw + space) * number.size
plus_x /= 2
when 2
plus_x = 0
end
for r in 0..number.size - 1
number_abs = number.to_i
number_rect = Rect.new(cw * number_abs, h, cw, ch)
self.contents.blt(plus_x + x + ((cw - space) * r), y , number_image, number_rect)
end
number_image.dispose
end
#--------------------------------------------------------------------------
# ● Draw Help Layout
#--------------------------------------------------------------------------
def draw_face_save(name,x,y,type)
if type == 0
image_name = name + "_0"
elsif type == 1
image_name = name + "_1"
else
image_name = name + "_2"
end
image = Cache.face(image_name)
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
#--------------------------------------------------------------------------
# ● draw_parameter_layout
#--------------------------------------------------------------------------
def draw_parameter_layout(x,y)
image = Cache.system("Save_Window01")
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
#--------------------------------------------------------------------------
# ● draw_parameter_layout2
#--------------------------------------------------------------------------
def draw_parameter_layout2(x,y,type)
if type == 0
image = Cache.system("Save_Window02")
else
image = Cache.system("Save_Window03")
end
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
#--------------------------------------------------------------------------
# ● draw_character_floor
#--------------------------------------------------------------------------
def draw_character_floor(x,y)
image = Cache.system("Save_Character_Floor")
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
end
#==============================================================================
# ■ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# ● Make Save Header
#--------------------------------------------------------------------------
def self.make_save_header
header = {}
header = $game_party.characters_for_savefile
header = $game_system.playtime_s
header = $game_system.playtime
header = $game_map.display_name
header = $game_party.members
header
end
end
#==============================================================================
# ■ Window_SaveFile
#==============================================================================
class Window_SaveFile_A < Window_Base
attr_reader :filename
attr_reader :file_exist
attr_reader :time_stamp
attr_reader :selected
attr_reader :file_index
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(file_index, filename)
super(0, 0,720, 140)
self.opacity = 0
@file_index = file_index
@filename = filename
load_gamedata
refresh
@selected = false
end
#--------------------------------------------------------------------------
# ● load_gamedata
#--------------------------------------------------------------------------
def load_gamedata
@time_stamp = Time.at(0)
@file_exist = FileTest.exist?(@filename)
if @file_exist
header = DataManager.load_header(@file_index)
if header == nil
@file_exist = false
return
end
@characters = header
@total_sec = header
@mapname = header
@members = header
end
end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
xp = 96
ex = 60
if @file_exist
if @total_sec == nil
draw_parameter_layout2(0,50,0)
draw_parameter_layout(-10 + xp,0)
value = @file_index + 1
draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,0)
self.contents.draw_text(140, 50, 450, 32, "Error! - Please, dont't use your old Save Files...", 0)
return
end
draw_parameter_layout2(0,50,0)
draw_parameter_layout(-10 + xp,0)
value = @file_index + 1
draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,1)
draw_party_characters(180 + xp, 75,ex)
draw_playtime(495, 20, contents.width - 4, 2)
draw_map_location( 400 + xp,64)
draw_level(185 + xp,85,ex)
draw_face_save(40 + xp,0)
else
draw_parameter_layout2(0,50,1)
draw_parameter_layout(-10 + xp,0)
value = @file_index + 1
draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,0)
self.contents.draw_text(260, 50, 120, 32, "No Data", 1)
end
end
#--------------------------------------------------------------------------
# ● draw_face
#--------------------------------------------------------------------------
def draw_face_save(x,y)
draw_actor_face(@members, x, y)
end
#--------------------------------------------------------------------------
# ● draw_level
#--------------------------------------------------------------------------
def draw_level(x,y,ex)
self.contents.font.color = normal_color
for i in 0...@members.size
break if i > 3
level = @members.level
draw_picture_number(x + (ex * i) , y ,level - 1, "Save_Number_01",1,0,3,1)
end
end
#--------------------------------------------------------------------------
# ● draw_map_location
#--------------------------------------------------------------------------
def draw_map_location(x,y)
self.contents.font.bold = false
self.contents.font.name = "Verdana"
self.contents.font.size = 13
self.contents.font.italic = false
self.contents.draw_text(400, 60, 125, 20, @mapname.to_s, 0)
end
#--------------------------------------------------------------------------
# ● draw_party_characters
#--------------------------------------------------------------------------
def draw_party_characters(x, y,ex)
for i in 0...@characters.size
break if i > 3
name = @characters
index = @characters
draw_character_floor(- 35 + x + i * ex,y - 20)
draw_character(name, index, x + i * ex, y)
end
end
#--------------------------------------------------------------------------
# ● draw_playtime
#--------------------------------------------------------------------------
def draw_playtime(x, y, width, align)
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
draw_picture_number(x + 18 * 0, y ,0, "Save_Number_01",0,0,3,0) if hour < 10
draw_picture_number(x + 18 * 1, y ,hour, "Save_Number_01",0,0,3,0)
draw_picture_number(x + 18 * 3, y ,0, "Save_Number_01",0,0,3,0) if min < 10
draw_picture_number(x + 18 * 4, y ,min, "Save_Number_01",0,0,3,0)
draw_picture_number(x + 18 * 6, y ,0, "Save_Number_01",0,0,3,0) if sec < 10
draw_picture_number(x + 18 * 7, y ,sec , "Save_Number_01",0,0,3,0)
end
#--------------------------------------------------------------------------
# ● selected
#--------------------------------------------------------------------------
def selected=(selected)
@selected = selected
end
end
#==============================================================================
# ■ Scene Save
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
$game_temp.scene_save = true
super
end
end
#==============================================================================
# ■ Scene Load
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
$game_temp.scene_save = false
super
end
end
#==============================================================================
# ■ Scene_File
#==============================================================================
class Scene_File
include MOG_SCENE_FILE
#--------------------------------------------------------------------------
# ● initialize
#--------------------------------------------------------------------------
def initialize
@saving = $game_temp.scene_save
@file_max = FILES_MAX
@file_max = 1 if FILES_MAX < 1
execute_dispose
create_layout
create_savefile_windows
@index = DataManager.last_savefile_index
@check_prev_index = true
@savefile_windows.selected = true
end
#--------------------------------------------------------------------------
# ● Main
#--------------------------------------------------------------------------
def main
Graphics.transition
execute_loop
execute_dispose
end
#--------------------------------------------------------------------------
# ● Execute Loop
#--------------------------------------------------------------------------
def execute_loop
loop do
Graphics.update
Input.update
update
if SceneManager.scene != self
break
end
end
end
#--------------------------------------------------------------------------
# ● Create_background
#--------------------------------------------------------------------------
def create_layout
@background = Plane.new
@background.bitmap = Cache.system("Save_Background")
@background.z = 0
@layout_01 = Sprite.new
@layout_01.bitmap = Cache.system("Save_Layout01")
@layout_01.z = 1
@layout_01.blend_type = 1
image = Cache.system("Save_Layout02")
@bitmap = Bitmap.new(image.width,image.height)
cw = image.width
ch = image.height / 2
if @saving
h = 0
else
h = ch
end
src_rect = Rect.new(0, h, cw, ch)
@bitmap.blt(0,0, image, src_rect)
@layout_02 = Sprite.new
@layout_02.bitmap = @bitmap
@layout_02.z = 3
@layout_02.y = 370
image.dispose
end
#--------------------------------------------------------------------------
# ● Execute Dispose
#--------------------------------------------------------------------------
def execute_dispose
return if @background == nil
Graphics.freeze
@background.bitmap.dispose
@background.dispose
@background = nil
@layout_01.bitmap.dispose
@layout_01.dispose
@layout_02.bitmap.dispose
@layout_02.dispose
@bitmap.dispose
dispose_item_windows
end
#--------------------------------------------------------------------------
# ● Frame Update
#--------------------------------------------------------------------------
def update
update_savefile_windows
update_savefile_selection
check_start_index
end
#--------------------------------------------------------------------------
# ● check_start_index
#--------------------------------------------------------------------------
def check_start_index
return if @check_prev_index == false
@check_prev_index = false
check_active_window
end
#--------------------------------------------------------------------------
# ● check_active_window
#--------------------------------------------------------------------------
def check_active_window
@index = 0 if @index == nil
for i in 0...@file_max
@pw = @index - 1
@pw = 0 if @pw > @file_max - 1
@pw = @file_max- 1 if @pw < 0
@aw = @index
@nw = @index + 1
@nw = 0 if @nw > @file_max - 1
@nw = @file_max - 1 if @nw < 0
case @savefile_windows.file_index
when @pw,@nw
@savefile_windows.visible = true
@savefile_windows.contents_opacity = 80
when @aw
@savefile_windows.visible = true
@savefile_windows.contents_opacity = 255
else
@savefile_windows.visible = false
end
end
end
#--------------------------------------------------------------------------
# ● Create Save File Window
#--------------------------------------------------------------------------
def create_savefile_windows
@pw_pos =
@aw_pos =
@nw_pos =
@savefile_windows =
for i in 0...@file_max
@savefile_windows = Window_SaveFile_A.new(i, DataManager.make_filename(i))
@savefile_windows.z = 2
@savefile_windows.visible = false
@savefile_windows.x = 400
end
check_active_window
@item_max = @file_max
end
#--------------------------------------------------------------------------
# ● Dispose of Save File Window
#--------------------------------------------------------------------------
def dispose_item_windows
for window in @savefile_windows
window.dispose
end
end
#--------------------------------------------------------------------------
# ● Update Save File Window
#--------------------------------------------------------------------------
def update_savefile_windows
update_slide_window
for window in @savefile_windows
window.update
end
end
#--------------------------------------------------------------------------
# ● update_slide_window
#--------------------------------------------------------------------------
def update_slide_window
@background.ox += 0
slide_window_x(@pw,@pw_pos)
slide_window_x(@aw,@aw_pos)
slide_window_x(@nw,@nw_pos)
slide_window_y(@pw,@pw_pos)
slide_window_y(@aw,@aw_pos)
slide_window_y(@nw,@nw_pos)
end
#--------------------------------------------------------------------------
# ● slide_window_x
#--------------------------------------------------------------------------
def slide_window_x(i,x_pos)
if @savefile_windows.x < x_pos
@savefile_windows.x += 15
@savefile_windows.x = x_pos if @savefile_windows.x > x_pos
end
if @savefile_windows.x > x_pos
@savefile_windows.x -= 15
@savefile_windows.x = x_pos if @savefile_windows.x < x_pos
end
end
#--------------------------------------------------------------------------
# ● slide_window_y
#--------------------------------------------------------------------------
def slide_window_y(i,y_pos)
if @savefile_windows.y < y_pos
@savefile_windows.y += 15
@savefile_windows.y = y_pos if @savefile_windows.y > y_pos
end
if @savefile_windows.y > y_pos
@savefile_windows.y -= 15
@savefile_windows.y = y_pos if @savefile_windows.y < y_pos
end
end
#--------------------------------------------------------------------------
# ● reset_position
#--------------------------------------------------------------------------
def reset_position(diretion)
check_active_window
case diretion
when 0
@savefile_windows.y = -64
@savefile_windows.x = 0
when 1
@savefile_windows.y = 440
@savefile_windows.x = 0
end
end
#--------------------------------------------------------------------------
# ● Update Save File Selection
#--------------------------------------------------------------------------
def update_savefile_selection
if Input.trigger?(Input::C)
on_savefile_ok
elsif Input.trigger?(Input::B)
Sound.play_cancel
return_scene
else
last_index = @index
if Input.trigger?(Input::DOWN)
execute_index(1)
if @file_max > 2
reset_position(1)
else
reset_position(0)
end
end
if Input.trigger?(Input::UP)
execute_index(-1)
reset_position(0)
end
if @index != last_index
Sound.play_cursor
@savefile_windows.selected = false
@savefile_windows.selected = true
end
end
end
#--------------------------------------------------------------------------
# ● Execute Index
#--------------------------------------------------------------------------
def execute_index(value)
@index += value
@index = @index >= @file_max ? 0 : @index < 0 ? (@file_max - 1) : @index
end
end
$mog_rgss3_scene_file = true
Greetings,
Tw0Face
[RMVX ACE] SE is sometimes skipped.
@Link_2112:
Yes. It's not three to five bullets at one time. It's just one bullet at a time, but I was trying to say that the sound was skipped for three to five shots in a row.
author=Link_2112
Are you sure you sent me the same thing your testing? Because your saying here that you see 3 or 5 bullets on the screen at one time? I could only shoot 1 bullet at a time, but when I was close to enemies and it was shooting fast there was no skipping.
Yes. It's not three to five bullets at one time. It's just one bullet at a time, but I was trying to say that the sound was skipped for three to five shots in a row.
[RMVX ACE] SE is sometimes skipped.
@GreatRedSpirit: Yes, you can shoot while walking across the map. If I walk across the map while shooting, I feel like there's a 90% chance that some of the shooting SEs will be skipped. Anyway, thanks for your suggestion. I set it up like this
for the most SEs I have. But it haven't made things better. It even seems to me as if even more SEs were skipped now.
@Mirak:
It could really be my sound card. But in the meantime, I asked a few people to test my game and some of them encountered the same problems. Unfortunately, I really start to believe that there's no solution to this problem. At least, I feel like this can't be done by just using events.
Greetings,
Tw0Face
Control Variable: CurrentFrame = Graphics.frame_count
Control Variable: FramesSinceLastSE = CurrentFrame
Control Variable: FramesSinceLastSE -= SEFramePlayed
Conditional Branch: Variable FramesSinceLastSE > 3
Play SE: "CoD - Schuss"
Control Variable: SEFramePlayed = CurrentFrame
End Conditional Branch]
@Mirak:
author=Mirak
I hope you find a solution and it really isn't an unfixable quirk of the engine.
It could really be my sound card. But in the meantime, I asked a few people to test my game and some of them encountered the same problems. Unfortunately, I really start to believe that there's no solution to this problem. At least, I feel like this can't be done by just using events.
Greetings,
Tw0Face
[RMVX ACE] SE is sometimes skipped.
@GreatRedSpirit: I'll try that and see if I can get it to work. Thanks.
@Link_2112:
I'm aware of that but I put bullet movement and SE into the same event. When I test play I can see three to five bullets flying around without any SE playing, meaning the event is actually triggered but without any SE playing.
I'm looking forward to see the video. This could help me a lot. Thank you very much for testing it on your computer.
@Link_2112:
author=Link_2112
The event can't be triggered again to play more SE until it's complete.
I'm aware of that but I put bullet movement and SE into the same event. When I test play I can see three to five bullets flying around without any SE playing, meaning the event is actually triggered but without any SE playing.
I'm looking forward to see the video. This could help me a lot. Thank you very much for testing it on your computer.
[RMVX ACE] SE is sometimes skipped.
@Link_2112: Thank you. I've sent you a PM. Maybe you'll find out why my SEs don't work.
Today, I spent the whole day searching for the cause but I haven't made any progress. I don't want to remove the SEs, but if the cause cannot be found, I'll have no choice (dang, this would be really annoying).
Today, I spent the whole day searching for the cause but I haven't made any progress. I don't want to remove the SEs, but if the cause cannot be found, I'll have no choice (dang, this would be really annoying).
[RMVX ACE] SE is sometimes skipped.
@Link_2112: You can't add 0 frame waits in RM Vx Ace. You can at least add 1 frame waits. That's what I've tried but it doesn't seem to help with my issue.
I completely overhauled the bullet event. I even tried to include the SE into the Movement Route of the bullet to make sure the SE is played exactly when the bullet starts to move. But even this doesn't help. The SE is still skipped from time to time. I don't know what else to try. Any further suggestions?
I completely overhauled the bullet event. I even tried to include the SE into the Movement Route of the bullet to make sure the SE is played exactly when the bullet starts to move. But even this doesn't help. The SE is still skipped from time to time. I don't know what else to try. Any further suggestions?













