This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
I made a 3 person CMS for my game. I hope you enjoy it.
Update:
New Load Command that fully works.
Menu
Code:
#================================
# 3 Person CMS by RPG Fan (R2
# Thanks to Dubealex and XRXS for Location and
# Transparency
#================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 333)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype # "Main" window font
self.contents.font.size = $defaultfontsize
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
if @item_max >= 4
print ("This menu was designed for 3 people")
exit
end
for i in 0...$game_party.actors.size
x = 64
y = i * 100
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
#draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
#--------------------------------------------------------------------------
# ● カーソルの矩形更新
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 100, self.width - 32, 96)
end
end
end
class Window_Info < Window_Base
def initialize
super(0,0,640,90)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype # "Number of Steps" window font
self.contents.font.size = $defaultfontsize
refresh
end
def refresh
# Gold
x = 4
y = 0
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
temp_x = x + 120
self.contents.draw_text(4, y, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(50-cx, y, cx, 32, $data_system.words.gold, 2)
x += 200
# Playtime
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, "Play Time")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(x, y + 32, 120, 32, text, 2)
x += 200
# Location
self.contents.font.color = system_color
self.contents.draw_text(x,y, 120, 32, "Location")
self.contents.font.color = normal_color
self.contents.draw_text(x, y + 32, 120, 32, $game_map.name.to_s, 2)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#=========================================
# ▼ CLASS Game_Map Additional Code Begins
#=========================================
class Game_Map
#Dubealex's Addition (from XRXS) to show Map Name on screen
def name
$map_infos[@map_id]
end
end
#=========================================
# ▲ CLASS Game_Map Additional Code Ends
#=========================================
#=========================================
# ▼ CLASS Scene_Title Additional Code Begins
#=========================================
class Scene_Title
#Dubealex's Addition (from XRXS) to show Map Name on screen
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
#=========================================
# ▲ CLASS Scene_Title Additional Code Ends
#=========================================
#================================================= =============================
# â– Window_Base
#================================================= =============================
class Window_Base < Window
alias xrxs_mp7_initialize initialize
def initialize(x, y, width, height)
xrxs_mp7_initialize(x, y, width, height)
if $scene.is_a?(Scene_Menu) or
$scene.is_a?(Scene_Item) or
$scene.is_a?(Scene_Skill) or
$scene.is_a?(Scene_Equip) or
$scene.is_a?(Scene_Status) or
$scene.is_a?(Scene_Save) or
$scene.is_a?(Scene_End)
self.back_opacity = 170
end
end
end
#================================================= =============================
# â–¡ XRXS_MP7_Module
#================================================= =============================
module XRXS_MP7_Module
def create_spriteset
@spriteset_bgmap = Spriteset_Map.new
end
def dispose_spriteset
@spriteset_bgmap.dispose
end
end
#================================================= =============================
# â– Scene_Menu
#================================================= =============================
class Scene_Menu
include XRXS_MP7_Module
alias xrxs_mp7_main main
def main
create_spriteset
xrxs_mp7_main
dispose_spriteset
end
end
#================================================= =============================
# â– Scene_Item
#================================================= =============================
class Scene_Item
include XRXS_MP7_Module
alias xrxs_mp7_main main
def main
create_spriteset
xrxs_mp7_main
dispose_spriteset
end
end
#================================================= =============================
# â– Scene_Skill
#================================================= =============================
class Scene_Skill
include XRXS_MP7_Module
alias xrxs_mp7_main main
def main
create_spriteset
xrxs_mp7_main
dispose_spriteset
end
end
#================================================= =============================
# â– Scene_Equip
#================================================= =============================
class Scene_Equip
include XRXS_MP7_Module
alias xrxs_mp7_main main
def main
create_spriteset
xrxs_mp7_main
dispose_spriteset
end
end
#================================================= =============================
# â– Scene_Status
#================================================= =============================
class Scene_Status
include XRXS_MP7_Module
alias xrxs_mp7_main main
def main
create_spriteset
xrxs_mp7_main
dispose_spriteset
end
end
#================================================= =============================
# â– Scene_Save
#================================================= =============================
class Scene_Save
include XRXS_MP7_Module
alias xrxs_mp7_main main
def main
create_spriteset
xrxs_mp7_main
dispose_spriteset
end
end
#================================================= =============================
# â– Scene_End
#================================================= =============================
class Scene_End
include XRXS_MP7_Module
alias xrxs_mp7_main main
def main
create_spriteset
xrxs_mp7_main
dispose_spriteset
end
end